summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-12 16:30:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-12 16:30:56 +0300
commitc25fef4436c2149b22420b1b5f0848c7ef3d2080 (patch)
treec766a91e8d972a046186eea9e9f7af659e5bdb92
parent1a9bad022f94966f07bcfe00e81d61433639e047 (diff)
fixes #1147 (TabSRMM: numerical options cannot be changed)
-rw-r--r--include/m_gui.h1
-rw-r--r--src/mir_core/src/CDlgBase.cpp21
2 files changed, 22 insertions, 0 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index 14b302fac6..27f91b99e7 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -468,6 +468,7 @@ private:
CTimer* FindTimer(int idEvent);
+ static BOOL CALLBACK GlobalFieldEnum(HWND hwnd, LPARAM lParam);
static INT_PTR CALLBACK GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static int GlobalDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc);
};
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp
index f975f38f8b..eaa9954261 100644
--- a/src/mir_core/src/CDlgBase.cpp
+++ b/src/mir_core/src/CDlgBase.cpp
@@ -120,6 +120,25 @@ int CDlgBase::Resizer(UTILRESIZECONTROL*)
return RD_ANCHORX_LEFT | RD_ANCHORY_TOP;
}
+BOOL CALLBACK CDlgBase::GlobalFieldEnum(HWND hwnd, LPARAM lParam)
+{
+ CDlgBase *pDlg = (CDlgBase*)lParam;
+ int id = GetWindowLongPtr(hwnd, GWLP_ID);
+ if (id <= 0)
+ return TRUE;
+
+ CCtrlBase *ctrl = pDlg->FindControl(id);
+ if (ctrl != nullptr)
+ return TRUE;
+
+ wchar_t wszClass[100];
+ GetClassName(hwnd, wszClass, _countof(wszClass));
+ if (!wcsicmp(wszClass, L"EDIT"))
+ new CCtrlEdit(pDlg, id);
+
+ return TRUE;
+}
+
INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -127,6 +146,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_initialized = false;
TranslateDialog_LP(m_hwnd, GetPluginLangByInstance(m_hInst));
+ ::EnumChildWindows(m_hwnd, &GlobalFieldEnum, LPARAM(this));
+
NotifyControls(&CCtrlBase::OnInit);
OnInitDialog();