From 7515702ee563399f869f850a327855e7051d5424 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Mar 2021 18:43:17 +0300 Subject: =?UTF-8?q?fixes=20#2777=20(Notes=20and=20Reminders:=20=D1=83?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B9=D0=BA=D1=83=20"=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D1=82=D1=8C=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82=D1=8B?= =?UTF-8?q?=20=D0=B2=20=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B0")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NotesAndReminders/res/resource.rc | 6 ++---- plugins/NotesAndReminders/src/main.cpp | 10 ++++------ plugins/NotesAndReminders/src/options.cpp | 14 ++++++-------- plugins/NotesAndReminders/src/resource.h | 1 - plugins/NotesAndReminders/src/stdafx.h | 2 +- 5 files changed, 13 insertions(+), 20 deletions(-) (limited to 'plugins/NotesAndReminders') diff --git a/plugins/NotesAndReminders/res/resource.rc b/plugins/NotesAndReminders/res/resource.rc index 05f7ce409e..abe7c93541 100644 --- a/plugins/NotesAndReminders/res/resource.rc +++ b/plugins/NotesAndReminders/res/resource.rc @@ -67,11 +67,9 @@ BEGIN COMBOBOX IDC_COMBODATE,53,95,92,149,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Title Time",IDC_STATIC,12,115,32,8 COMBOBOX IDC_COMBOTIME,53,114,92,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Startup options",IDC_STATIC,168,6,128,56 + GROUPBOX "Startup options",IDC_STATIC,168,6,128,51 CONTROL "Hide notes at startup",IDC_CHECK_HIDENOTES,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | BS_FLAT | WS_TABSTOP,172,17,119,16 - CONTROL "Add Contact list menu items",IDC_CHECK_MENUS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | BS_FLAT | WS_TABSTOP,172,35,119,10 - CTEXT "(Requires Miranda restart)",IDC_STATIC,172,50,119,10 - GROUPBOX "Reminder options",IDC_STATIC,168,66,128,95 + GROUPBOX "Reminder options",IDC_STATIC,168,61,128,95 CONTROL "Add Reminder closes dialog",IDC_CHECK_CLOSE,"Button",BS_AUTOCHECKBOX | BS_FLAT | WS_TABSTOP,172,81,119,10 CONTROL "Use MCI to play alert sounds",IDC_CHECK_MSI,"Button",BS_AUTOCHECKBOX | BS_FLAT | WS_TABSTOP,172,96,119,10 GROUPBOX "Note transparency",IDC_STATIC,6,161,290,35 diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index f717e33e4d..d3ad2c6d21 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -72,11 +72,10 @@ int OnTopToolBarInit(WPARAM, LPARAM) static void addMenuItem(CMenuItem &mi) { - if (g_plugin.bAddContListMI) { - HGENMENU save = mi.root; mi.root = nullptr; - Menu_AddContactMenuItem(&mi); - mi.root = save; - } + HGENMENU save = mi.root; mi.root = nullptr; + Menu_AddContactMenuItem(&mi); + mi.root = save; + Menu_AddMainMenuItem(&mi); } @@ -170,7 +169,6 @@ static int OnPreShutdown(WPARAM, LPARAM) CMPlugin::CMPlugin() : PLUGIN(MODULENAME, pluginInfoEx), - bAddContListMI(MODULENAME, "AddContactMenuItems", true), bShowNotesAtStart(MODULENAME, "ShowNotesAtStart", true), bShowNoteButtons(MODULENAME, "ShowNoteButtons", true), bShowScrollbar(MODULENAME, "ShowScrollbar", true), diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 3aa14ff5af..dd198455e2 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -200,17 +200,19 @@ class CNROptionsDlg : public CDlgBase cmbDate.SetCurSel(g_NoteTitleDate ? g_NoteTitleDate - 1 : cmbDate.GetCount()-1); cmbTime.SetCurSel(g_NoteTitleTime ? g_NoteTitleTime - 1 : cmbTime.GetCount()-1); - SendDlgItemMessage(m_hwnd, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 255 - g_Transparency); + slider.SetPosition(255 - g_Transparency); } CCtrlEdit edtBrowser, edtEmail; CCtrlCombo cmbDate, cmbTime; - CCtrlCheck chkHide, chkMenus, chkButtons, chkScroll, chkClose, chkMSI; + CCtrlCheck chkHide, chkButtons, chkScroll, chkClose, chkMSI; CCtrlButton btnBrowse, btnReset; + CCtrlSlider slider; public: CNROptionsDlg() : CDlgBase(g_plugin, IDD_STNOTEOPTIONS), + slider(this, IDC_SLIDER_TRANSPARENCY, 255 - MIN_ALPHA), edtEmail(this, IDC_EDIT_EMAILSMS), edtBrowser(this, IDC_EDIT_ALTBROWSER), cmbDate(this, IDC_COMBODATE), @@ -218,7 +220,6 @@ public: chkMSI(this, IDC_CHECK_MSI), chkHide(this, IDC_CHECK_HIDENOTES), chkClose(this, IDC_CHECK_CLOSE), - chkMenus(this, IDC_CHECK_MENUS), chkScroll(this, IDC_CHECK_SCROLLBARS), chkButtons(this, IDC_CHECK_BUTTONS), btnReset(this, IDC_BUTTON_RESET), @@ -229,15 +230,12 @@ public: CreateLink(chkMSI, g_plugin.bUseMSI); CreateLink(chkClose, g_plugin.bCloseAfterAddReminder); - CreateLink(chkMenus, g_plugin.bAddContListMI); CreateLink(chkScroll, g_plugin.bShowScrollbar); CreateLink(chkButtons, g_plugin.bShowNoteButtons); } bool OnInitDialog() override { - SendDlgItemMessage(m_hwnd, IDC_SLIDER_TRANSPARENCY, TBM_SETRANGE, TRUE, MAKELONG(0, 255 - MIN_ALPHA)); - cmbDate.ResetContent(); for (auto &it : dateFormats) cmbDate.AddString(it.lpszUI); @@ -266,7 +264,7 @@ public: BOOL LB; g_NoteWidth = GetDlgItemInt(m_hwnd, IDC_EDIT_WIDTH, &LB, FALSE); g_NoteHeight = GetDlgItemInt(m_hwnd, IDC_EDIT_HEIGHT, &LB, FALSE); - g_Transparency = 255 - SendDlgItemMessage(m_hwnd, IDC_SLIDER_TRANSPARENCY, TBM_GETPOS, 0, 0); + g_Transparency = 255 - slider.GetPosition(); g_NoteTitleDate = (cmbDate.GetCurSel()+1) % cmbDate.GetCount(); g_NoteTitleTime = (cmbTime.GetCurSel()+1) % cmbTime.GetCount(); @@ -328,7 +326,7 @@ public: replaceStr(g_RemindSMS, nullptr); replaceStr(g_lpszAltBrowser, nullptr); - g_plugin.bShowNotesAtStart = g_plugin.bAddContListMI = g_plugin.bShowScrollbar = g_plugin.bShowNoteButtons = true; + g_plugin.bShowNotesAtStart = g_plugin.bShowScrollbar = g_plugin.bShowNoteButtons = true; g_plugin.bCloseAfterAddReminder = g_plugin.bUseMSI = true; g_NoteTitleDate = 1; diff --git a/plugins/NotesAndReminders/src/resource.h b/plugins/NotesAndReminders/src/resource.h index a03b3755e3..d74d0aaf14 100644 --- a/plugins/NotesAndReminders/src/resource.h +++ b/plugins/NotesAndReminders/src/resource.h @@ -38,7 +38,6 @@ #define IDC_DAILY 1009 #define IDC_CHECK_HIDENOTES 1010 #define IDC_WEEKLY 1010 -#define IDC_CHECK_MENUS 1011 #define IDC_MONTHLY 1011 #define IDC_EDIT_WIDTH 1012 #define IDC_EDIT_HEIGHT 1013 diff --git a/plugins/NotesAndReminders/src/stdafx.h b/plugins/NotesAndReminders/src/stdafx.h index e5d1ddc3ad..37d4382e78 100644 --- a/plugins/NotesAndReminders/src/stdafx.h +++ b/plugins/NotesAndReminders/src/stdafx.h @@ -40,7 +40,7 @@ struct CMPlugin : public PLUGIN { CMPlugin(); - CMOption bShowNotesAtStart, bShowScrollbar, bAddContListMI, bShowNoteButtons; + CMOption bShowNotesAtStart, bShowScrollbar, bShowNoteButtons; CMOption bCloseAfterAddReminder, bUseMSI; int Load() override; -- cgit v1.2.3