summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-04-03 14:50:35 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-04-03 14:50:35 +0300
commit18738a3452bc980a943734aad8fa1c23366342ce (patch)
tree5d24a652b9a152d5dc039d3554f1d4203662b39e
parent4d051e1f4afd92b8dbc0e9129c903af377ad7f76 (diff)
files #4837 (Weather: не работает кнопка "Ещё переменные")
-rw-r--r--protocols/Weather/res/resource.rc1
-rw-r--r--protocols/Weather/src/resource.h1
-rw-r--r--protocols/Weather/src/weather_opt.cpp16
-rw-r--r--protocols/Weather/src/weather_update.cpp7
4 files changed, 22 insertions, 3 deletions
diff --git a/protocols/Weather/res/resource.rc b/protocols/Weather/res/resource.rc
index b03db42abc..60e4d4848d 100644
--- a/protocols/Weather/res/resource.rc
+++ b/protocols/Weather/res/resource.rc
@@ -183,6 +183,7 @@ BEGIN
EDITTEXT IDC_HTEXT,80,219,183,12,ES_AUTOHSCROLL
GROUPBOX "Variable List",IDC_STATIC,207,14,99,191
LTEXT "",IDC_VARLIST,213,25,86,157
+ CONTROL "More Variables",IDC_MORE,"MButtonClass",WS_TABSTOP,216,187,81,15,WS_EX_WINDOWEDGE | WS_EX_NOACTIVATE | 0x10000000L
CONTROL "Reset",IDC_RESET,"MButtonClass",WS_TABSTOP,266,208,40,21,WS_EX_WINDOWEDGE | WS_EX_NOACTIVATE | 0x10000000L
EDITTEXT IDC_BTITLE2,80,28,125,12,ES_AUTOHSCROLL
CONTROL "Status Message",IDC_TM8,"MButtonClass",WS_TABSTOP | 0x100,2,29,77,9,WS_EX_WINDOWEDGE | WS_EX_NOACTIVATE | 0x10000000L
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);
+ }
}
/////////////////////////////////////////////////////////////////////////////////////////