diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-05 19:30:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-05 19:30:12 +0300 |
commit | 63c39e478f065ef664c7023e67391372ac859538 (patch) | |
tree | f28c1c5b9de2832dbc4a6abe02eb8aff321b71b0 | |
parent | 01e2e633ef9c613464b84d8065d103d1112d4156 (diff) |
another option for drawing window edge
-rw-r--r-- | plugins/NewStory/res/resource.rc | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 7 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 5 | ||||
-rw-r--r-- | plugins/NewStory/src/resource.h | 5 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 6 |
6 files changed, 17 insertions, 12 deletions
diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc index 4dd4a167ca..3630cfcb40 100644 --- a/plugins/NewStory/res/resource.rc +++ b/plugins/NewStory/res/resource.rc @@ -143,8 +143,9 @@ 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,40 + GROUPBOX "Log window",IDC_STATIC,0,0,307,52 CONTROL "Enable vertical scroll bar",IDC_VSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,22,289,14 + CONTROL "Draw window edge",IDC_DRAWEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,35,289,14 END IDD_OPT_TEMPLATES DIALOGEX 0, 0, 307, 223 diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index e851c0b768..f19f4565db 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -741,7 +741,6 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HDC hdc = CreateCompatibleDC(hdcWindow); HBITMAP hbmSave = (HBITMAP)SelectObject(hdc, CreateCompatibleBitmap(hdcWindow, rc.right - rc.left, rc.bottom - rc.top)); - GetClientRect(hwnd, &rc); int height = rc.bottom - rc.top; int width = rc.right - rc.left; int top = data->scrollTopPixel; @@ -759,10 +758,8 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM DeleteObject(hbr); } - GetWindowRect(hwnd, &rc); - rc.right -= rc.left; rc.left = 0; - rc.bottom -= rc.top; rc.top = 0; - DrawEdge(hdc, &rc, BDR_SUNKENOUTER, BF_RECT); + if (g_plugin.bDrawEdge) + DrawEdge(hdc, &rc, BDR_SUNKENOUTER, BF_RECT); BitBlt(hdcWindow, 0, 0, rc.right, rc.bottom, hdc, 0, 0, SRCCOPY); DeleteObject(SelectObject(hdc, hbmSave)); diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 5f38b787a7..c2dc1000ae 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -14,6 +14,7 @@ CMPlugin g_plugin; CMOption<bool> g_bOptGrouping(MODULENAME, "MessageGrouping", false); +CMOption<bool> g_bOptDrawEdge(MODULENAME, "DrawEdge", true); ///////////////////////////////////////////////////////////////////////////////////////// @@ -106,6 +107,8 @@ static int evtPreShutdown(WPARAM, LPARAM) int CMPlugin::Load() { registerIcon(MODULETITLE, icons); + + bDrawEdge = g_bOptDrawEdge; bMsgGrouping = g_bOptGrouping; m_log = RegisterSrmmLog(MODULETITLE, _T(MODULENAME), NewStory_Stub); diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index 12c0581688..30b4c314ad 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -5,20 +5,23 @@ class CGeneralOptsDlg : public CDlgBase { - CCtrlCheck chkGrouping, chkVScroll; + CCtrlCheck chkGrouping, chkVScroll, chkDrawEdge; public: CGeneralOptsDlg() : CDlgBase(g_plugin, IDD_OPT_ADVANCED), chkVScroll(this, IDC_VSCROLL), + chkDrawEdge(this, IDC_DRAWEDGE), chkGrouping(this, IDC_GROUPING) { CreateLink(chkVScroll, g_plugin.bOptVScroll); CreateLink(chkGrouping, g_bOptGrouping); + CreateLink(chkDrawEdge, g_bOptDrawEdge); } bool OnApply() override { + g_plugin.bDrawEdge = g_bOptDrawEdge; g_plugin.bMsgGrouping = g_bOptGrouping; return true; } diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h index 8dc3868356..a8ec88878a 100644 --- a/plugins/NewStory/src/resource.h +++ b/plugins/NewStory/src/resource.h @@ -80,7 +80,6 @@ #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 @@ -88,6 +87,8 @@ #define IDC_DISCARD 1053 #define IDC_UPDATEPREVIEW 1054 #define IDC_VARHELP 1055 +#define IDC_VSCROLL 1056 +#define IDC_DRAWEDGE 1057 #define ID_FILTER_SHOWALLEVENTS 40001 #define ID_FILTER_SHOWINCOMINGEVENTSONLY 40002 #define ID_FILTER_SHOWOUTGOINGEVENTSONLY 40003 @@ -113,7 +114,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 130 #define _APS_NEXT_COMMAND_VALUE 40019 -#define _APS_NEXT_CONTROL_VALUE 1056 +#define _APS_NEXT_CONTROL_VALUE 1058 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index eb3adc1797..c4a5065c99 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -82,7 +82,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> HANDLE m_log; CMOption<bool> bOptVScroll; - bool bMsgGrouping; // this option is a copy of static CMOption to keep performance high + bool bMsgGrouping, bDrawEdge; // thesw options are a copy of static CMOption to keep performance high CMPlugin(); @@ -90,5 +90,5 @@ struct CMPlugin : public PLUGIN<CMPlugin> int Unload() override; }; -extern CMOption<bool> g_bOptGrouping; -extern wchar_t* months[12];
\ No newline at end of file +extern CMOption<bool> g_bOptGrouping, g_bOptDrawEdge; +extern wchar_t* months[12]; |