From a89cede20d7712dc36cfcaa0a23f8a1b56496e49 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 Nov 2023 13:40:55 +0300 Subject: =?UTF-8?q?fixes=20#3834=20(CurrencyRates:=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82=20=D1=82=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D1=82=20=D0=B2=D1=81=D0=BF=D0=BB=D1=8B=D0=B2=D0=B0=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D1=85=20=D0=BE=D0=BA=D0=BE=D0=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/CurrencyRates/src/SettingsDlg.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'protocols/CurrencyRates/src/SettingsDlg.cpp') diff --git a/protocols/CurrencyRates/src/SettingsDlg.cpp b/protocols/CurrencyRates/src/SettingsDlg.cpp index f3134e29be..e22a12c3a5 100644 --- a/protocols/CurrencyRates/src/SettingsDlg.cpp +++ b/protocols/CurrencyRates/src/SettingsDlg.cpp @@ -73,7 +73,7 @@ static LPCTSTR pszFilterParts[] = { LPGENW("Log Files (*.txt,*.log)"), L"*.txt;* void select_log_file(HWND hDlg) { wchar_t pszFile[MAX_PATH]; - + CMStringW pszFilter; for (auto &it : pszFilterParts) { pszFilter += it; @@ -120,15 +120,16 @@ void update_popup_controls_settings(HWND hDlg) bool bIsDelayEnabled = 1 == IsDlgButtonChecked(hDlg, IDC_DELAYCUSTOM); ::EnableWindow(::GetDlgItem(hDlg, IDC_DELAY), bIsDelayEnabled); - } INT_PTR CALLBACK EditPopupSettingsDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { + auto *pSettings = (CPopupSettings *)(GetWindowLongPtr(hWnd, GWLP_USERDATA)); + switch (msg) { case WM_INITDIALOG: { - CPopupSettings *pSettings = reinterpret_cast(lp); + pSettings = (CPopupSettings *)lp; TranslateDialogDefault(hWnd); ::SendDlgItemMessage(hWnd, IDC_BGCOLOR, CPM_SETCOLOUR, 0, pSettings->GetColourBk()); ::SendDlgItemMessage(hWnd, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, pSettings->GetColourText()); @@ -138,8 +139,6 @@ INT_PTR CALLBACK EditPopupSettingsDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM ::CheckRadioButton(hWnd, IDC_RADIO_DEFAULT_COLOURS, IDC_RADIO_USER_DEFINED_COLOURS, (CPopupSettings::colourDefault == pSettings->GetColourMode()) ? IDC_RADIO_DEFAULT_COLOURS : IDC_RADIO_USER_DEFINED_COLOURS); UINT n; switch (pSettings->GetDelayMode()) { - default: - assert(!"Unknown delay mode. Please, fix it"); case CPopupSettings::delayFromPopup: n = IDC_DELAYFROMPU; break; @@ -149,6 +148,8 @@ INT_PTR CALLBACK EditPopupSettingsDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM case CPopupSettings::delayPermanent: n = IDC_DELAYPERMANENT; break; + default: + assert(!"Unknown delay mode. Please, fix it"); } ::CheckRadioButton(hWnd, IDC_DELAYFROMPU, IDC_DELAYPERMANENT, n); @@ -162,6 +163,10 @@ INT_PTR CALLBACK EditPopupSettingsDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM case WM_COMMAND: switch (LOWORD(wp)) { + case IDC_PREV: + show_popup(0, 0, 1, L"", *pSettings); + break; + case IDC_RADIO_DEFAULT_COLOURS: case IDC_RADIO_USER_DEFINED_COLOURS: case IDC_DELAYFROMPU: @@ -176,8 +181,6 @@ INT_PTR CALLBACK EditPopupSettingsDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM case IDOK: { - CPopupSettings *pSettings = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); - bool bError = false; BOOL bOk = FALSE; UINT nDelay = ::GetDlgItemInt(hWnd, IDC_DELAY, &bOk, FALSE); -- cgit v1.2.3