From 9004eaac8c454cafcf4d54e29173c32db33a07ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 27 Jul 2022 19:57:28 +0200 Subject: Fix status bar help message. The string arrays are static. --- c/main.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'c/main.cpp') diff --git a/c/main.cpp b/c/main.cpp index a9625c3..8a8e198 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -320,14 +320,9 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, /*IDM_FILE_FETCH_DATA*/L"Fetch episode data from the web (may take a few seconds).", /*IDM_FILE_FETCH_SCREENWRITERS*/L"Fetch screenwriters from the web (may take a minute).", /*IDM_FILE_ABOUT*/L"Show information about Episode Browser.", - /*IDM_VIEW_WATCHED*/(g_bViewWatched? L"Click to hide watched episodes.": - L"Click to show watched episodes."), - /*IDM_VIEW_TV_ORIGINAL*/(g_bViewTVOriginal? - L"Click to hide TV original episodes.": - L"Click to show TV original episodes."), - /*IDM_VIEW_OTHERS*/(g_szLimitScreenwriter? - L"Click to hide episodes by other screenwriters.": - L"Click to show episodes by other screenwriters.") + /*IDM_VIEW_WATCHED*/L"Show/hide watched episodes.", + /*IDM_VIEW_TV_ORIGINAL*/L"Show/hide TV original episodes.", + /*IDM_VIEW_OTHERS*/L"Show/hide episodes by other screenwriters." }; static const wchar_t* aWszCtx[] = { /*IDM_WATCH_LOCALLY*/L"Open local copy of episode, if available.", @@ -351,9 +346,12 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const unsigned short wCommand = LOWORD(wParam); const unsigned short wGroup = ID_GROUP(wCommand); - if (!wGroup) break; - const wchar_t** aWsz = wGroup==IDG_MENU? aWszMenu: aWszCtx; - SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(0,0), (LPARAM)aWsz[ID_INDEX(wCommand)]); + const wchar_t* wsz = {0}; + if (wGroup) { + const wchar_t** aWsz = wGroup==IDG_MENU? aWszMenu: aWszCtx; + wsz = aWsz[ID_INDEX(wCommand)]; + } + SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(0,0), (LPARAM)wsz); break; } default: -- cgit v1.2.3