From b5428785aab6fd5dc4fa7037b843d1bbc6f9926a Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Mon, 8 Mar 2021 09:04:16 +0000 Subject: [PATCH] Small code cleanup. --- bochs/gui/wx.cc | 3 +++ bochs/gui/wxmain.cc | 7 +++---- bochs/gui/wxmain.h | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bochs/gui/wx.cc b/bochs/gui/wx.cc index 139052640..3e08647af 100644 --- a/bochs/gui/wx.cc +++ b/bochs/gui/wx.cc @@ -100,6 +100,9 @@ public: #endif }; +// this variable uses the bx_wx_gui_c object to access MyPanel +static MyPanel *thePanel = NULL; + // declare one instance of the gui object and call macro to insert the // plugin code static bx_wx_gui_c *theGui = NULL; diff --git a/bochs/gui/wxmain.cc b/bochs/gui/wxmain.cc index 1c01ca394..d0d2928f3 100644 --- a/bochs/gui/wxmain.cc +++ b/bochs/gui/wxmain.cc @@ -96,10 +96,9 @@ #include "icon_bochs.xpm" #endif -// FIXME: ugly global variables that the bx_gui_c object in wx.cc can use -// to access the MyFrame and the MyPanel. +// FIXME: ugly global variable that the bx_gui_c object in wx.cc can use +// to access the MyFrame. MyFrame *theFrame = NULL; -MyPanel *thePanel = NULL; // The wxBochsClosing flag is used to keep track of when the wxWidgets GUI is // shutting down. Shutting down can be somewhat complicated because the @@ -1294,7 +1293,7 @@ void MyFrame::OnToolbarClick(wxCommandEvent& event) case ID_Toolbar_Copy: which = BX_TOOLBAR_COPY; break; case ID_Toolbar_Paste: which = BX_TOOLBAR_PASTE; break; case ID_Toolbar_Snapshot: which = BX_TOOLBAR_SNAPSHOT; break; - case ID_Toolbar_Mouse_en: thePanel->ToggleMouse(true); break; + case ID_Toolbar_Mouse_en: panel->ToggleMouse(true); break; case ID_Toolbar_User: which = BX_TOOLBAR_USER; break; default: wxLogError(wxT("unknown toolbar id %d"), id); diff --git a/bochs/gui/wxmain.h b/bochs/gui/wxmain.h index e3cc6f06f..fb4796c97 100644 --- a/bochs/gui/wxmain.h +++ b/bochs/gui/wxmain.h @@ -33,7 +33,6 @@ class LogViewDialog; //hack alert; yuck; FIXME extern MyFrame *theFrame; -extern MyPanel *thePanel; // wxBochsClosing flag, see comments in wxmain.h extern bool wxBochsClosing;