diff options
Diffstat (limited to 'c')
-rw-r--r-- | c/main.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -348,7 +348,7 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, const WORD group = ID_GROUP(command); const wchar_t* tip = {0}; if (group) { - const wchar_t** const vTip = group==IDG_MENU? vTipMenu: vTipCtx; + const wchar_t** const vTip = group == IDG_MENU? vTipMenu: vTipCtx; tip = vTip[ID_INDEX(command)]; } SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(0,0), reinterpret_cast<LPARAM>(tip)); @@ -490,7 +490,7 @@ void HandleContextMenu(const HWND, WORD command) void WaitFor(const char* mod, const char* pred) { static atom_t aThread; - static int bActive; + static bool bActive; static int iTimer; static WcharPtr activePred; @@ -502,7 +502,7 @@ void WaitFor(const char* mod, const char* pred) if (EBMessageBox(msg, L"Error", MB_YESNO|MB_ICONWARNING) != IDYES) return; KillTimer(nullptr, iTimer); - bActive = 0; + bActive = false; g_elv->Update(); } @@ -512,15 +512,16 @@ void WaitFor(const char* mod, const char* pred) static auto proc = [](HWND, UINT, UINT_PTR, DWORD) -> void { static int i = 0; + static const wchar_t* text[] = {L".", L"..", L"...", L""}; if (Pl("episode_data","thread_running",aThread)) { - i = (i+1)%4; + i = (i+1)%(sizeof(text)/sizeof(*text)); SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), - reinterpret_cast<LPARAM>(i==0? L".": i==1? L"..": i==2? L"...": L"")); + reinterpret_cast<LPARAM>(text[i])); } else { KillTimer(nullptr, iTimer); i = 0; - bActive = 0; + bActive = false; g_elv->Update(); } }; @@ -529,7 +530,7 @@ void WaitFor(const char* mod, const char* pred) SendMessage(g_hWndStatus, SB_SETTEXT, MAKEWPARAM(1,0), reinterpret_cast<LPARAM>(L".")); if (Prefer(iTimer = SetTimer(nullptr, -1, 500, proc))) { activePred = WcharPtr::FromNarrow(pred); - bActive = 1; + bActive = true; } } |