From 18738a3452bc980a943734aad8fa1c23366342ce Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 3 Apr 2025 14:50:35 +0300 Subject: =?UTF-8?q?files=20#4837=20(Weather:=20=D0=BD=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BA=D0=B0=20"=D0=95=D1=89=D1=91=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B=D0=B5")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Weather/src/resource.h | 1 + protocols/Weather/src/weather_opt.cpp | 16 +++++++++++++++- protocols/Weather/src/weather_update.cpp | 7 +++++-- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'protocols/Weather/src') 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); + } } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3