(svn r8717) [cpp_gui] -Codechange: changed the functions about closing all windows into methods
--- a/src/genworld.cpp Tue Feb 13 22:47:05 2007 +0000
+++ b/src/genworld.cpp Tue Feb 13 22:58:31 2007 +0000
@@ -142,7 +142,7 @@
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
/* Show all vital windows again, because we have hidden them */
- if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
+ if (_gw.threaded && _game_mode != GM_MENU) Window::ShowVitalWindows();
_gw.active = false;
_gw.thread = NULL;
_gw.proc = NULL;
@@ -215,7 +215,7 @@
if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
/* Show all vital windows again, because we have hidden them */
- if (_gw.threaded && _game_mode != GM_MENU) ShowVitalWindows();
+ if (_gw.threaded && _game_mode != GM_MENU) Window::ShowVitalWindows();
_gw.active = false;
_gw.thread = NULL;
_gw.proc = NULL;
@@ -278,9 +278,9 @@
}
/* Remove any open window */
- DeleteAllNonVitalWindows();
+ Window::DeleteAllNonVitalWindows();
/* Hide vital windows, because we don't allow to use them */
- HideVitalWindows();
+ Window::HideVitalWindows();
/* Don't show the dialog if we don't have a thread */
ShowGenerateWorldProgress();
--- a/src/genworld_gui.cpp Tue Feb 13 22:47:05 2007 +0000
+++ b/src/genworld_gui.cpp Tue Feb 13 22:58:31 2007 +0000
@@ -180,7 +180,7 @@
void StartGeneratingLandscape(glwp_modes mode)
{
- DeleteAllNonVitalWindows();
+ Window::DeleteAllNonVitalWindows();
/* Copy all XXX_newgame to XXX when coming from outside the editor */
UpdatePatches();
--- a/src/main_gui.cpp Tue Feb 13 22:47:05 2007 +0000
+++ b/src/main_gui.cpp Tue Feb 13 22:58:31 2007 +0000
@@ -2306,8 +2306,8 @@
}
case WKC_ESC: ResetObjectToPlace(); break;
- case WKC_DELETE: DeleteNonVitalWindows(); break;
- case WKC_DELETE | WKC_SHIFT: DeleteAllNonVitalWindows(); break;
+ case WKC_DELETE: Window::DeleteNonVitalWindows(); break;
+ case WKC_DELETE | WKC_SHIFT: Window::DeleteAllNonVitalWindows(); break;
case 'R' | WKC_CTRL: MarkWholeScreenDirty(); break;
#if defined(_DEBUG)
@@ -2427,12 +2427,12 @@
case GM_NORMAL:
case GM_EDITOR:
- ShowVitalWindows();
+ Window::ShowVitalWindows();
break;
}
}
-void ShowVitalWindows(void)
+void Window::ShowVitalWindows(void)
{
Window *w;
--- a/src/player_gui.cpp Tue Feb 13 22:47:05 2007 +0000
+++ b/src/player_gui.cpp Tue Feb 13 22:58:31 2007 +0000
@@ -1039,7 +1039,7 @@
break;
case WE_DESTROY: /* Get back all the hidden windows */
- if (_game_mode != GM_MENU) ShowVitalWindows();
+ if (_game_mode != GM_MENU) Window::ShowVitalWindows();
if (!_networking) DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // unpause
break;
@@ -1078,7 +1078,7 @@
if (!_networking) DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
/* Close all always on-top windows to get a clean screen */
- if (_game_mode != GM_MENU) HideVitalWindows();
+ if (_game_mode != GM_MENU) Window::HideVitalWindows();
DeleteWindowByClass(WC_HIGHSCORE);
w = AllocateWindowDesc(&_highscore_desc);
@@ -1102,7 +1102,7 @@
/* Pause in single-player to have a look at the highscore at your own leisure */
if (!_networking) DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
- HideVitalWindows();
+ Window::HideVitalWindows();
DeleteWindowByClass(WC_ENDSCREEN);
w = AllocateWindowDesc(&_endgame_desc);
--- a/src/window.cpp Tue Feb 13 22:47:05 2007 +0000
+++ b/src/window.cpp Tue Feb 13 22:58:31 2007 +0000
@@ -1919,7 +1919,7 @@
}
}
-void DeleteNonVitalWindows(void)
+void Window::DeleteNonVitalWindows(void)
{
restart_search:
@@ -1947,7 +1947,7 @@
* with this function. It closes all windows calling the standard function,
* then, does a little hacked loop of closing all stickied windows. Note
* that standard windows (status bar, etc.) are not stickied, so these aren't affected */
-void DeleteAllNonVitalWindows(void)
+void Window::DeleteAllNonVitalWindows(void)
{
/* Delete every window except for stickied ones, then sticky ones as well */
DeleteNonVitalWindows();
@@ -1966,7 +1966,7 @@
}
/* Delete all always on-top windows to get an empty screen */
-void HideVitalWindows(void)
+void Window::HideVitalWindows(void)
{
DeleteWindowById(WC_TOOLBAR_MENU, 0);
DeleteWindowById(WC_MAIN_TOOLBAR, 0);
--- a/src/window.h Tue Feb 13 22:47:05 2007 +0000
+++ b/src/window.h Tue Feb 13 22:58:31 2007 +0000
@@ -424,6 +424,11 @@
void InvalidateData();
void InvalidateWidget(byte widget_index) const;
+ static void DeleteNonVitalWindows(void);
+ static void DeleteAllNonVitalWindows(void);
+ static void ShowVitalWindows(void);
+ static void HideVitalWindows(void);
+
/* viewport.cpp */
void DrawViewport() const;
@@ -944,10 +949,6 @@
//void HandleButtonClick(Window *w, byte widget);
Window *GetCallbackWnd(void);
-void DeleteNonVitalWindows(void);
-void DeleteAllNonVitalWindows(void);
-void HideVitalWindows(void);
-void ShowVitalWindows(void);
//WindowList::Iterator FindWindowZPosition(const Window *w);
/* window.c */