diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index fa743583ba..6fe4a6d67d 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -163,7 +163,7 @@ END_EVENT_TABLE() // Class, input event handler and host message handler CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id) - : wxPanel(parent, id) + : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxNO_BORDER, wxT("Dolphin-Debugger")) /* Remember to initialize potential new controls with NULL there, otherwise m_dialog = true and things may crash */ @@ -749,7 +749,9 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event) break; } - UpdateButtonStates(); + UpdateButtonStates(); + // Update all toolbars in the aui manager + UpdateManager(); } @@ -883,7 +885,6 @@ void CCodeWindow::UpdateCallstack() void CCodeWindow::Update() { codeview->Refresh(); - UpdateCallstack(); UpdateButtonStates(); @@ -893,9 +894,6 @@ void CCodeWindow::Update() } - - - // Update GUI void CCodeWindow::UpdateButtonStates() @@ -903,36 +901,38 @@ void CCodeWindow::UpdateButtonStates() bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED); bool Running = (Core::GetState() == Core::CORE_RUN); bool Pause = (Core::GetState() == Core::CORE_PAUSE); - wxAuiToolBar* toolBar = GetToolBar(); + wxAuiToolBar* ToolBar = GetToolBar(); - if (!toolBar) return; + if (!ToolBar) return; if (Core::GetState() == Core::CORE_UNINITIALIZED) { - toolBar->EnableTool(IDM_DEBUG_GO, false); - toolBar->EnableTool(IDM_STEP, false); - toolBar->EnableTool(IDM_STEPOVER, false); - toolBar->EnableTool(IDM_SKIP, false); + ToolBar->EnableTool(IDM_DEBUG_GO, false); + ToolBar->EnableTool(IDM_STEP, false); + ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_SKIP, false); } else { if (!CCPU::IsStepping()) { - toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause")); - toolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_Pause]); - toolBar->EnableTool(IDM_DEBUG_GO, true); - toolBar->EnableTool(IDM_STEP, false); - toolBar->EnableTool(IDM_STEPOVER, false); - toolBar->EnableTool(IDM_SKIP, false); + ToolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause")); + ToolBar->SetToolLabel(IDM_DEBUG_GO, _("Pause")); + ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_Pause]); + ToolBar->EnableTool(IDM_DEBUG_GO, true); + ToolBar->EnableTool(IDM_STEP, false); + ToolBar->EnableTool(IDM_STEPOVER, false); + ToolBar->EnableTool(IDM_SKIP, false); } else { - toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Play")); - toolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugGo]); - toolBar->EnableTool(IDM_DEBUG_GO, true); - toolBar->EnableTool(IDM_STEP, true); - toolBar->EnableTool(IDM_STEPOVER, true); - toolBar->EnableTool(IDM_SKIP, true); + ToolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Play")); + ToolBar->SetToolLabel(IDM_DEBUG_GO, _("Play")); + ToolBar->SetToolBitmap(IDM_DEBUG_GO, m_Bitmaps[Toolbar_DebugGo]); + ToolBar->EnableTool(IDM_DEBUG_GO, true); + ToolBar->EnableTool(IDM_STEP, true); + ToolBar->EnableTool(IDM_STEPOVER, true); + ToolBar->EnableTool(IDM_SKIP, true); } } @@ -959,6 +959,15 @@ void CCodeWindow::UpdateButtonStates() symbols->SetFont(DebuggerFont); callers->SetFont(DebuggerFont); calls->SetFont(DebuggerFont); + + if (ToolBar) ToolBar->Realize(); +} +// Update manager +void CCodeWindow::UpdateManager() +{ + // Caution: This can cause an endless loop if this event comes back to this function + wxCommandEvent evnt(wxEVT_HOST_COMMAND, IDM_UPDATEGUI); + wxPostEvent(GetParentFrame(), evnt); } void CCodeWindow::RecreateToolbar(wxAuiToolBar * toolBar) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h index 97481dc90d..c22ab913a5 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.h +++ b/Source/Core/DebuggerWX/Src/CodeWindow.h @@ -86,6 +86,7 @@ class CCodeWindow void PopulateToolbar(wxAuiToolBar* toolBar); void CreateSymbolsMenu(); void UpdateButtonStates(); + void CCodeWindow::UpdateManager(); // Sub dialogs wxMenuBar* pMenuBar; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index faa98f41e1..603ac02906 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -473,7 +473,6 @@ CFrame::CFrame(bool showLogWindow, // Update controls UpdateGUI(); - if (UseDebugger) g_pCodeWindow->UpdateButtonStates(); // If we are rerecording create the status bar now instead of later when a game starts #ifdef RERECORDING @@ -501,7 +500,6 @@ void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event)) void CFrame::OnClose(wxCloseEvent& event) { - // Don't forget the skip or the window won't be destroyed event.Skip(); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 4e43fc3fe3..661fecea0c 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -261,7 +261,7 @@ void CFrame::PopulateToolbar(wxAuiToolBar* toolBar) toolBar->AddTool(wxID_REFRESH, _T("Refresh"), m_Bitmaps[Toolbar_Refresh], _T("Refresh")); toolBar->AddTool(IDM_BROWSE, _T("Browse"), m_Bitmaps[Toolbar_Browse], _T("Browse for an ISO directory...")); toolBar->AddSeparator(); - toolBar->AddTool(IDM_PLAY, _T("Play"), m_Bitmaps[Toolbar_Play], _T("Play")); + toolBar->AddTool(IDM_PLAY, wxT(""), m_Bitmaps[Toolbar_Play], _T("Play")); toolBar->AddTool(IDM_STOP, _T("Stop"), m_Bitmaps[Toolbar_Stop], _T("Stop")); #ifdef _WIN32 toolBar->AddTool(IDM_TOGGLE_FULLSCREEN, _T("Fullscr."), m_Bitmaps[Toolbar_FullScreen], _T("Toggle Fullscreen")); @@ -969,13 +969,11 @@ void CFrame::UpdateGUI() { m_ToolBar->SetToolBitmap(IDM_PLAY, m_Bitmaps[Toolbar_Play]); m_ToolBar->SetToolShortHelp(IDM_PLAY, _("Play")); - m_ToolBar->SetToolLabel(IDM_PLAY, _("Play")); + m_ToolBar->SetToolLabel(IDM_PLAY, wxT(" Play ")); } GetMenuBar()->FindItem(IDM_PLAY)->SetText(_("&Play\tF10")); } - // Commit changes to toolbar - if (m_ToolBar != NULL) m_ToolBar->Realize(); if (!initialized) { @@ -994,6 +992,12 @@ void CFrame::UpdateGUI() m_GameListCtrl->Hide(); } } + + // Commit changes to toolbar + if (m_ToolBar != NULL) m_ToolBar->Realize(); + if (UseDebugger) g_pCodeWindow->Update(); + // Commit changes to manager + m_Mgr->Update(); } void CFrame::GameListChanged(wxCommandEvent& event)