diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-05 19:03:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-05 19:03:57 +0300 |
commit | 01e2e633ef9c613464b84d8065d103d1112d4156 (patch) | |
tree | 367fc5552a313fbbdc25c5cb58a49b234a08507b /plugins/NewStory | |
parent | cfc04a114e5d83318f26e0641cfd36ed26736196 (diff) |
NewStory: option to hide scrollbar
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/res/resource.rc | 9 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 8 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 3 |
6 files changed, 19 insertions, 9 deletions
diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc index 667a1b290b..4dd4a167ca 100644 --- a/plugins/NewStory/res/resource.rc +++ b/plugins/NewStory/res/resource.rc @@ -17,7 +17,7 @@ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) +#pragma code_page(1251) ///////////////////////////////////////////////////////////////////////////// // @@ -80,7 +80,6 @@ ICO_TIMETREE ICON "timetree.ico" IDD_HISTORY DIALOGEX 0, 0, 380, 319 STYLE DS_SETFONT | DS_NOIDLEMSG | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "",IDC_USERINFO,"MButtonClass",WS_TABSTOP,0,99,16,14 @@ -97,7 +96,7 @@ BEGIN EDITTEXT IDC_SEARCHTEXT,19,305,305,14,ES_AUTOHSCROLL ICON "",IDC_SEARCHICON,1,298,20,20,SS_CENTERIMAGE CONTROL "",IDC_LOGOPTIONS,"MButtonClass",WS_TABSTOP,116,99,16,14 - CONTROL "",IDC_TIMETREEVIEW,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_SINGLEEXPAND | NOT WS_VISIBLE | WS_TABSTOP,0,134,84,160,WS_EX_STATICEDGE + CONTROL "",IDC_TIMETREEVIEW,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_SINGLEEXPAND | NOT WS_VISIBLE | WS_TABSTOP,0,134,84,160,WS_EX_STATICEDGE CONTROL "",IDC_DATEPOPUP,"MButtonClass",WS_TABSTOP,148,99,16,14 CONTROL "",IDC_HISTORYCONTROL,"NewstoryList",WS_TABSTOP,90,132,290,166 CONTROL "",IDC_IB_SEPARATOR,"Static",SS_ETCHEDHORZ,21,76,124,1 @@ -144,7 +143,8 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN CONTROL "Group messages",IDC_GROUPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,9,289,14 - GROUPBOX "Log window",IDC_STATIC,0,0,307,29 + GROUPBOX "Log window",IDC_STATIC,0,0,307,40 + CONTROL "Enable vertical scroll bar",IDC_VSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,22,289,14 END IDD_OPT_TEMPLATES DIALOGEX 0, 0, 307, 223 @@ -257,6 +257,7 @@ BEGIN END END + #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index f7225ef153..e851c0b768 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -242,7 +242,8 @@ struct NewstoryListData : public MZeroedObject scrollTopPixel = cachedMaxTopPixel; } - RecalcScrollBar(); + if (g_plugin.bOptVScroll) + RecalcScrollBar(); } int LayoutItem(int index) @@ -505,7 +506,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_CREATE: data = new NewstoryListData(hwnd); SetWindowLongPtr(hwnd, 0, (LONG_PTR)data); - data->RecalcScrollBar(); + if (!g_plugin.bOptVScroll) + SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VSCROLL); + else + data->RecalcScrollBar(); break; // History list control messages diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 4e1a540171..5f38b787a7 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -32,7 +32,8 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) + PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx), + bOptVScroll(MODULENAME, "VScroll", true) { } diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index f6c681bda2..12c0581688 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -5,13 +5,15 @@ class CGeneralOptsDlg : public CDlgBase { - CCtrlCheck chkGrouping; + CCtrlCheck chkGrouping, chkVScroll; public: CGeneralOptsDlg() : CDlgBase(g_plugin, IDD_OPT_ADVANCED), + chkVScroll(this, IDC_VSCROLL), chkGrouping(this, IDC_GROUPING) { + CreateLink(chkVScroll, g_plugin.bOptVScroll); CreateLink(chkGrouping, g_bOptGrouping); } diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h index e9dc7ace1d..8dc3868356 100644 --- a/plugins/NewStory/src/resource.h +++ b/plugins/NewStory/src/resource.h @@ -80,6 +80,7 @@ #define IDC_MONTHCALENDAR 1046 #define IDC_GROUPING 1047 #define IDC_TEMPLATES 1048 +#define IDC_VSCROLL 1048 #define IDC_EDITTEMPLATE 1049 #define IDC_PREVIEW 1050 #define IDC_GPREVIEW 1051 diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index 83ea563746..eb3adc1797 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -81,7 +81,8 @@ struct CMPlugin : public PLUGIN<CMPlugin> { HANDLE m_log; - bool bMsgGrouping; + CMOption<bool> bOptVScroll; + bool bMsgGrouping; // this option is a copy of static CMOption to keep performance high CMPlugin(); |