diff options
author | George Hazan <george.hazan@gmail.com> | 2025-04-03 14:50:35 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-04-03 14:50:35 +0300 |
commit | 18738a3452bc980a943734aad8fa1c23366342ce (patch) | |
tree | 5d24a652b9a152d5dc039d3554f1d4203662b39e /protocols/Weather/src | |
parent | 4d051e1f4afd92b8dbc0e9129c903af377ad7f76 (diff) |
files #4837 (Weather: не работает кнопка "Ещё переменные")
Diffstat (limited to 'protocols/Weather/src')
-rw-r--r-- | protocols/Weather/src/resource.h | 1 | ||||
-rw-r--r-- | protocols/Weather/src/weather_opt.cpp | 16 | ||||
-rw-r--r-- | protocols/Weather/src/weather_update.cpp | 7 |
3 files changed, 21 insertions, 3 deletions
diff --git a/protocols/Weather/src/resource.h b/protocols/Weather/src/resource.h index e53877d0ee..809c94857b 100644 --- a/protocols/Weather/src/resource.h +++ b/protocols/Weather/src/resource.h @@ -109,6 +109,7 @@ #define IDC_INFO10 2091 #define IDC_INFO12 2092 #define IDC_INFO13 2093 +#define IDC_MORE 2094 #define IDC_MOREDETAIL 2095 #define IDC_DATALIST 2096 #define IDC_MUPDATE 2097 diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index c5323919be..7c0829b006 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -341,11 +341,12 @@ static variables[] = class COptionsTextDlg : public CWeatherDlgBase { - CCtrlMButton btnReset, tm1, tm2, tm3, tm4, tm5, tm6, tm7, tm8; + CCtrlMButton btnMore, btnReset, tm1, tm2, tm3, tm4, tm5, tm6, tm7, tm8; public: COptionsTextDlg(CWeatherProto *ppro) : CWeatherDlgBase(ppro, IDD_TEXTOPT), + btnMore(this, IDC_MORE), btnReset(this, IDC_RESET), tm1(this, IDC_TM1), tm2(this, IDC_TM2), @@ -356,6 +357,7 @@ public: tm7(this, IDC_TM7), tm8(this, IDC_TM8) { + btnMore.OnClick = Callback(this, &COptionsTextDlg::onClick_More); btnReset.OnClick = Callback(this, &COptionsTextDlg::onClick_Reset); tm1.OnClick = tm2.OnClick = tm3.OnClick = tm4.OnClick = tm5.OnClick = tm6.OnClick = tm7.OnClick = tm8.OnClick = @@ -389,6 +391,7 @@ public: tm6.MakeFlat(); tm7.MakeFlat(); tm8.MakeFlat(); + btnMore.MakeFlat(); btnReset.MakeFlat(); return true; } @@ -410,6 +413,17 @@ public: return true; } + void onClick_More(CCtrlButton *) + { + // heading + CMStringW str(TranslateT("Here is a list of custom variables that are currently available")); + str += L"\n\n"; + GetVarsDescr(str); + + // display the list in a message box + MessageBox(nullptr, str, TranslateT("More Variables"), MB_OK | MB_ICONINFORMATION | MB_TOPMOST); + } + void onClick_TM(CCtrlButton *pButton) { // display the menu diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index fc3d49afd9..3082d8d2c1 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -470,8 +470,11 @@ int CWeatherProto::GetWeatherData(MCONTACT hContact) void GetVarsDescr(CMStringW &str) { - for (int i=1; i <= 7; i++) - str.AppendFormat(L"a%d\t%s %d\r\n", i, TranslateT("Forecast Day"), i); + for (int i = 1; i <= 7; i++) { + if (i != 1) + str.Append(L", "); + str.AppendFormat(L"%%[Forecast Day %d]", i); + } } ///////////////////////////////////////////////////////////////////////////////////////// |