From ec45ce6bb282dab2b5bf40fc130b3d67730c4869 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 23 Nov 2016 22:58:53 +0300 Subject: minus WM_TIMER --- src/mir_app/src/options.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 9d4d497954..1c0505ea21 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1090,22 +1090,15 @@ public: } break; - case WM_TIMER: - if (wParam == FILTER_TIMEOUT_TIMER) { - SaveOptionsTreeState(); - RebuildPageTree(); - - KillTimer(m_hwnd, FILTER_TIMEOUT_TIMER); - } - break; - case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_KEYWORD_FILTER: // add a timer - when the timer elapses filter the option pages - if ((HIWORD(wParam) == CBN_SELCHANGE) || (HIWORD(wParam) == CBN_EDITCHANGE)) - if (!SetTimer(m_hwnd, FILTER_TIMEOUT_TIMER, 400, NULL)) - MessageBeep(MB_ICONSTOP); + if ((HIWORD(wParam) == CBN_SELCHANGE) || (HIWORD(wParam) == CBN_EDITCHANGE)) { + CTimer *pTimer = new CTimer(this, FILTER_TIMEOUT_TIMER); + pTimer->OnEvent = Callback(this, &COptionsDlg::OnTimer); + pTimer->Start(400); + } break; case IDC_MODERN: @@ -1121,6 +1114,13 @@ public: return CDlgBase::DlgProc(msg, wParam, lParam); } + void OnTimer(CTimer *pTimer) + { + pTimer->Stop(); + SaveOptionsTreeState(); + RebuildPageTree(); + } + void Locate(const wchar_t *pszGroup, const wchar_t *pszPage, int _hLang) { Show(SW_RESTORE); -- cgit v1.2.3