From c628c26c38cc876ffc1eb36b6892954174d96278 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 16 Apr 2017 22:13:05 +0300 Subject: [PATCH] Show [Paused] in window title when pause mode. --- od-win32/resources/resource.h | 1 + od-win32/resources/winuae.rc | 1 + od-win32/win32.cpp | 88 ++++++++++++++++++----------------- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index caafa550..9e9382f9 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -402,6 +402,7 @@ #define IDS_SCREEN_ADAPTIVE_SYNC 409 #define IDS_NUMSG_NOMEMORY 410 #define IDS_EXPANSION_CATEGORY 411 +#define IDS_WINUAETITLE_PAUSED 412 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index cd5e3e03..8ddb62da 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -2091,6 +2091,7 @@ BEGIN IDS_SCREEN_ADAPTIVE_SYNC "Variable Sync" IDS_NUMSG_NOMEMORY "Out of memory or too much Z3 autoconfig space configured.\nIf 64-bit, make sure RTG board is first in board list." IDS_EXPANSION_CATEGORY "Built-in expansions\nSCSI controllers\nIDE controllers\nSASI controllers\nCustom controllers\nPCI bridgeboards\nx86 bridgeboards\nGraphics boards\nSound cards\nNetwork adapters\nDisk controllers" + IDS_WINUAETITLE_PAUSED "[Paused]" END #endif // English resources diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 5abe90a2..ab9a3943 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -424,6 +424,50 @@ static void setcursor (int oldx, int oldy) SetCursorPos (cx, cy); } +static int showcursor; + +extern TCHAR config_filename[256]; + +static void setmaintitle (HWND hwnd) +{ + TCHAR txt[1000], txt2[500]; + +#ifdef RETROPLATFORM + if (rp_isactive ()) + return; +#endif + txt[0] = 0; + inprec_getstatus (txt); + if (currprefs.config_window_title[0]) { + _tcscat (txt, currprefs.config_window_title); + _tcscat (txt, _T(" - ")); + } else if (config_filename[0]) { + _tcscat (txt, _T("[")); + _tcscat (txt, config_filename); + _tcscat (txt, _T("] - ")); + } + _tcscat (txt, _T("WinUAE")); + txt2[0] = 0; + if (pause_emulation) { + WIN32GUI_LoadUIString (IDS_WINUAETITLE_PAUSED, txt2, sizeof (txt2) / sizeof (TCHAR)); + } else if (mouseactive > 0) { + WIN32GUI_LoadUIString ((currprefs.input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON) ? IDS_WINUAETITLE_MMB : IDS_WINUAETITLE_NORMAL, + txt2, sizeof (txt2) / sizeof (TCHAR)); + } + if (_tcslen (WINUAEBETA) > 0) { + _tcscat (txt, BetaStr); + if (_tcslen (WINUAEEXTRA) > 0) { + _tcscat (txt, _T(" ")); + _tcscat (txt, WINUAEEXTRA); + } + } + if (txt2[0]) { + _tcscat (txt, _T(" - ")); + _tcscat (txt, txt2); + } + SetWindowText (hwnd, txt); +} + static int pausemouseactive; void resumesoundpaused (void) { @@ -456,6 +500,7 @@ bool resumepaused (int priority) } pause_emulation = 0; setsystime (); + setmaintitle(hMainWnd); return true; } bool setpaused (int priority) @@ -472,6 +517,7 @@ bool setpaused (int priority) pausemouseactive = mouseactive; setmouseactive (0); } + setmaintitle(hMainWnd); return true; } @@ -489,48 +535,6 @@ void unsetminimized (void) clear_inhibit_frame (IHF_WINDOWHIDDEN); } -static int showcursor; - -extern TCHAR config_filename[256]; - -static void setmaintitle (HWND hwnd) -{ - TCHAR txt[1000], txt2[500]; - -#ifdef RETROPLATFORM - if (rp_isactive ()) - return; -#endif - txt[0] = 0; - inprec_getstatus (txt); - if (currprefs.config_window_title[0]) { - _tcscat (txt, currprefs.config_window_title); - _tcscat (txt, _T(" - ")); - } else if (config_filename[0]) { - _tcscat (txt, _T("[")); - _tcscat (txt, config_filename); - _tcscat (txt, _T("] - ")); - } - _tcscat (txt, _T("WinUAE")); - txt2[0] = 0; - if (mouseactive > 0) { - WIN32GUI_LoadUIString ((currprefs.input_mouse_untrap & MOUSEUNTRAP_MIDDLEBUTTON) ? IDS_WINUAETITLE_MMB : IDS_WINUAETITLE_NORMAL, - txt2, sizeof (txt2) / sizeof (TCHAR)); - } - if (_tcslen (WINUAEBETA) > 0) { - _tcscat (txt, BetaStr); - if (_tcslen (WINUAEEXTRA) > 0) { - _tcscat (txt, _T(" ")); - _tcscat (txt, WINUAEEXTRA); - } - } - if (txt2[0]) { - _tcscat (txt, _T(" - ")); - _tcscat (txt, txt2); - } - SetWindowText (hwnd, txt); -} - void refreshtitle (void) { if (isfullscreen () == 0) -- 2.47.3