diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-03 13:28:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-03 13:28:25 +0300 |
commit | 50691aaecfc2e3206271825403d1a0d3338c6b4d (patch) | |
tree | f998515a4f35551def9584e6f09ed5402984247b /plugins | |
parent | fa0e1943d5a6eeb5502b0c68f0170f05d76d6a95 (diff) |
fixes #3778 (NewStory: в предпросмотре шаблонов заработал цвет текста, но не фона)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ExternalAPI/m_text.h | 5 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/plugins/ExternalAPI/m_text.h b/plugins/ExternalAPI/m_text.h index d2165802ac..9bb349d8a8 100644 --- a/plugins/ExternalAPI/m_text.h +++ b/plugins/ExternalAPI/m_text.h @@ -12,6 +12,11 @@ // lParam = (void*)text
#define MTM_UPDATEEX (WM_USER+2)
+// sets background color for a control
+// wParam = (COLORREF)clBack
+// lParam = 0 (ignored)
+#define MTM_SETBKCOLOR (WM_USER+3)
+
typedef struct TextObject *HText;
#ifdef MTEXTCONTROL_EXPORTS
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index cf73b767e2..98cb365020 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -78,6 +78,16 @@ class CTemplateOptsDlg : public CBaseOptsDlg CCtrlMButton btnDiscard, bthVarHelp, btnReset; CCtrlTreeView m_tree; + UI_MESSAGE_MAP(CTemplateOptsDlg, CBaseOptsDlg); + UI_MESSAGE(UM_REDRAWLISTH, OnColorChanged); + UI_MESSAGE_MAP_END(); + + LRESULT OnColorChanged(UINT, WPARAM, LPARAM) + { + gpreview.SendMsg(MTM_SETBKCOLOR, g_colorTable[COLOR_BACK].cl, 0); + return 0; + } + public: CTemplateOptsDlg() : CBaseOptsDlg(IDD_OPT_TEMPLATES), @@ -148,6 +158,9 @@ public: m_tree.SelectItem(hFirst); m_tree.EnsureVisible(hFirst); + + WindowList_Add(g_hNewstoryWindows, m_hwnd); + OnColorChanged(0, 0, 0); return true; } @@ -170,6 +183,8 @@ public: void OnDestroy() override { + WindowList_Remove(g_hNewstoryWindows, m_hwnd); + for (auto &it : templates) replaceStrW(it.tmpValue, nullptr); } |