diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-03 18:08:16 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-03 18:08:16 +0300 |
commit | 1be16f1566b862629878a2d1a46063afeae78c38 (patch) | |
tree | 3717a30de15c1f3ae5e9326f80e799840db77c29 /src/mir_app | |
parent | f4f859003e2d17ab6d457e552ccdde775899b328 (diff) |
fix for the shitty idea of all pre-created button objects' manual initialization
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/srmm_toolbar.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index 26523fbe01..b94c175ef0 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -320,6 +320,8 @@ MIR_APP_DLL(void) Srmm_CreateToolbarIcons(HWND hwndDlg, int flags) { HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hwndDlg, GWLP_HINSTANCE); + CDlgBase *pDlg = CDlgBase::Find(hwndDlg); + for (int i = 0; i < arButtonsList.getCount(); i++) { CustomButtonData *cbd = arButtonsList[i]; if (cbd->m_bSeparator) @@ -331,6 +333,13 @@ MIR_APP_DLL(void) Srmm_CreateToolbarIcons(HWND hwndDlg, int flags) hwndButton = CreateWindowEx(0, L"MButtonClass", L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, cbd->m_iButtonWidth, DPISCALEX_S(22), hwndDlg, (HMENU)cbd->m_dwButtonCID, hInstance, NULL); if (hwndButton == NULL) // smth went wrong continue; + + // if there's a pre-created button control in a class, initialize it + if (pDlg != nullptr) { + CCtrlBase *pControl = (*pDlg)[cbd->m_dwButtonCID]; + if (pControl) + pControl->OnInit(); + } } SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0); if (cbd->m_pwszText) |