diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-13 11:58:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-13 11:58:24 +0300 |
commit | b832f0db06aa2798d676337932b7f88770d79933 (patch) | |
tree | d59720314d4645ea6eccfbea4e1e4874304933a8 /src | |
parent | 899da432c9d78b631dffa73314b8e1cdf3870fa8 (diff) |
more field types to be auto-created
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/CDlgBase.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index eaa9954261..e6a4d6f08b 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -123,18 +123,31 @@ int CDlgBase::Resizer(UTILRESIZECONTROL*) BOOL CALLBACK CDlgBase::GlobalFieldEnum(HWND hwnd, LPARAM lParam) { CDlgBase *pDlg = (CDlgBase*)lParam; - int id = GetWindowLongPtr(hwnd, GWLP_ID); + int id = GetWindowLongPtrW(hwnd, GWLP_ID); if (id <= 0) return TRUE; + // already declared inside the class? skipping CCtrlBase *ctrl = pDlg->FindControl(id); if (ctrl != nullptr) return TRUE; wchar_t wszClass[100]; - GetClassName(hwnd, wszClass, _countof(wszClass)); - if (!wcsicmp(wszClass, L"EDIT")) + GetClassNameW(hwnd, wszClass, _countof(wszClass)); + if (!wcsicmp(wszClass, L"Edit")) new CCtrlEdit(pDlg, id); + else if (!wcsicmp(wszClass, L"ComboBox")) + new CCtrlCombo(pDlg, id); + else if (!wcsicmp(wszClass, L"Button")) { + if (GetWindowLongW(hwnd, GWL_STYLE) & (BS_CHECKBOX | BS_RADIOBUTTON)) + new CCtrlCheck(pDlg, id); + else + new CCtrlButton(pDlg, id); + } + else if (!wcsicmp(wszClass, L"RichEdit50W")) + new CCtrlRichEdit(pDlg, id); + else if (!wcsicmp(wszClass, L"msctls_updown32")) + new CCtrlSpin(pDlg, id); return TRUE; } |