diff options
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/Weather/res/resource.rc | 2 | ||||
| -rw-r--r-- | protocols/Weather/src/stdafx.h | 1 | ||||
| -rw-r--r-- | protocols/Weather/src/weather_opt.cpp | 35 | ||||
| -rw-r--r-- | protocols/Weather/src/weather_update.cpp | 6 |
4 files changed, 40 insertions, 4 deletions
diff --git a/protocols/Weather/res/resource.rc b/protocols/Weather/res/resource.rc index 29c85adfae..b03db42abc 100644 --- a/protocols/Weather/res/resource.rc +++ b/protocols/Weather/res/resource.rc @@ -182,7 +182,7 @@ BEGIN CONTROL "History Log",IDC_TM7,"MButtonClass",WS_TABSTOP,2,221,77,9,WS_EX_WINDOWEDGE | WS_EX_NOACTIVATE | 0x10000000L EDITTEXT IDC_HTEXT,80,219,183,12,ES_AUTOHSCROLL GROUPBOX "Variable List",IDC_STATIC,207,14,99,191 - LTEXT "",IDC_VARLIST,213,25,86,172 + LTEXT "",IDC_VARLIST,213,25,86,157 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/stdafx.h b/protocols/Weather/src/stdafx.h index cf1f3240a3..70c602ed22 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -147,6 +147,7 @@ void ConvertBackslashes(char *str); char *GetSearchStr(char *dis);
CMStringW GetDisplay(WEATHERINFO *w, const wchar_t *dis);
+void GetVarsDescr(CMStringW &str);
wchar_t *GetError(int code);
diff --git a/protocols/Weather/src/weather_opt.cpp b/protocols/Weather/src/weather_opt.cpp index 015fda2c6c..c5323919be 100644 --- a/protocols/Weather/src/weather_opt.cpp +++ b/protocols/Weather/src/weather_opt.cpp @@ -295,8 +295,6 @@ public: ///////////////////////////////////////////////////////////////////////////////////////// // text option dialog -#define VAR_LIST_OPT TranslateT("%c\tcurrent condition\n%d\tcurrent date\n%e\tdewpoint\n%f\tfeel-like temp\n%h\ttoday's high\n%i\twind direction\n%l\ttoday's low\n%m\thumidity\n%n\tstation name\n%p\tpressure\n%r\tsunrise time\n%s\tstation ID\n%t\ttemperature\n%u\tupdate time\n%v\tvisibility\n%w\twind speed\n%y\tsun set\n----------\n\\n\tnew line") - struct { wchar_t c; @@ -315,6 +313,32 @@ static controls[] = { 'S', IDC_BTITLE2, "StatusText" }, }; +struct +{ + wchar_t symbol; + const wchar_t *pwszText; +} +static variables[] = +{ + { 'c', LPGENW("Current condition") }, + { 'd', LPGENW("Current date") }, + { 'e', LPGENW("Dewpoint") }, + { 'f', LPGENW("Feel-like temp") }, + { 'h', LPGENW("Today's high") }, + { 'i', LPGENW("Wind direction") }, + { 'l', LPGENW("Today's low") }, + { 'm', LPGENW("Humidity") }, + { 'n', LPGENW("Station name") }, + { 'p', LPGENW("Pressure") }, + { 'r', LPGENW("Sunrise") }, + { 's', LPGENW("Station ID") }, + { 't', LPGENW("Temperature") }, + { 'u', LPGENW("Update time") }, + { 'v', LPGENW("Visibility") }, + { 'w', LPGENW("Wind speed") }, + { 'y', LPGENW("Sunset") }, +}; + class COptionsTextDlg : public CWeatherDlgBase { CCtrlMButton btnReset, tm1, tm2, tm3, tm4, tm5, tm6, tm7, tm8; @@ -346,7 +370,12 @@ public: SetWindowPos(m_hwnd, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE); // generate the display text for variable list - SetDlgItemTextW(m_hwnd, IDC_VARLIST, VAR_LIST_OPT); + CMStringW str; + for (auto &it : variables) + str.AppendFormat(L"%c\t%s\r\n", it.symbol, TranslateW(it.pwszText)); + str.Append(L"----------\r\n"); + str.AppendFormat(L"\\n\t%s\r\n", TranslateT("new line")); + SetDlgItemTextW(m_hwnd, IDC_VARLIST, str); for (auto &it : controls) SetDlgItemTextW(m_hwnd, it.id, m_proto->GetTextValue(it.c)); diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index 3f189274e5..fc3d49afd9 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -468,6 +468,12 @@ int CWeatherProto::GetWeatherData(MCONTACT hContact) return 0; } +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); +} + ///////////////////////////////////////////////////////////////////////////////////////// // main auto-update timer |
