diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 41eff0953f..94bec7af5c 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -189,9 +189,6 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(CCodeWindow::OnKeyDown), (wxObject*)0, this); - - // Load settings for selectable windows, but only if they have been created - //this->Load(); } CCodeWindow::~CCodeWindow() @@ -643,9 +640,6 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event) } - - - // Events diff --git a/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp b/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp index 2d2fb5d293..aef19b8ddf 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp @@ -329,11 +329,11 @@ wxWindow * CCodeWindow::GetNootebookPage(wxString Name) { if (!m_NB0 || !m_NB1) return NULL; - for(int i = 0; i <= m_NB0->GetPageCount(); i++) + for(u32 i = 0; i <= m_NB0->GetPageCount(); i++) { if (m_NB0->GetPageText(i).IsSameAs(Name)) return m_NB0->GetPage(i); } - for(int i = 0; i <= m_NB1->GetPageCount(); i++) + for(u32 i = 0; i <= m_NB1->GetPageCount(); i++) { if (m_NB1->GetPageText(i).IsSameAs(Name)) return m_NB1->GetPage(i); } @@ -372,7 +372,6 @@ void CCodeWindow::OpenPages() if (bBreakpointWindow) OnToggleBreakPointWindow(true, m_NB1); if (bMemoryWindow) OnToggleMemoryWindow(true, m_NB0); if (bJitWindow) OnToggleJitWindow(true, m_NB0); - // Todo, potentially add a safety check here since it will crash if ScanForPlugins() is not run yet if (bSoundWindow) OnToggleSoundWindow(true, m_NB1); if (bVideoWindow) OnToggleVideoWindow(true, m_NB1); } @@ -394,8 +393,6 @@ void CCodeWindow::DoToggleWindow(int Id, bool Show) } void CCodeWindow::OnToggleRegisterWindow(bool Show, wxAuiNotebook * _NB) { - if(!_NB) return; - if (Show) { if (m_RegisterWindow && _NB->GetPageIndex(m_RegisterWindow) != wxNOT_FOUND) return; @@ -412,7 +409,10 @@ void CCodeWindow::OnToggleRegisterWindow(bool Show, wxAuiNotebook * _NB) //if (m_RegisterWindow) m_RegisterWindow->Hide(); if (m_RegisterWindow) { - _NB->RemovePage(_NB->GetPageIndex(m_RegisterWindow)); + if (m_NB0->GetPageIndex(m_RegisterWindow) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(m_RegisterWindow)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(m_RegisterWindow)); m_RegisterWindow->Hide(); } } @@ -437,7 +437,10 @@ void CCodeWindow::OnToggleBreakPointWindow(bool Show, wxAuiNotebook * _NB) if (m_BreakpointWindow) { - _NB->RemovePage(_NB->GetPageIndex(m_BreakpointWindow)); + if (m_NB0->GetPageIndex(m_BreakpointWindow) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(m_BreakpointWindow)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(m_BreakpointWindow)); m_BreakpointWindow->Hide(); } } @@ -461,7 +464,10 @@ void CCodeWindow::OnToggleJitWindow(bool Show, wxAuiNotebook * _NB) if (m_JitWindow) { - _NB->RemovePage(_NB->GetPageIndex(m_JitWindow)); + if (m_NB0->GetPageIndex(m_JitWindow) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(m_JitWindow)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(m_JitWindow)); m_JitWindow->Hide(); } } @@ -486,7 +492,10 @@ void CCodeWindow::OnToggleMemoryWindow(bool Show, wxAuiNotebook * _NB) if (m_MemoryWindow) { - _NB->RemovePage(_NB->GetPageIndex(m_MemoryWindow)); + if (m_NB0->GetPageIndex(m_MemoryWindow) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(m_MemoryWindow)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(m_MemoryWindow)); m_MemoryWindow->Hide(); } } @@ -527,7 +536,13 @@ void CCodeWindow::OnToggleSoundWindow(bool Show, wxAuiNotebook * _NB) { #ifdef _WIN32 wxWindow *Win = GetWxWindow(wxT("Sound")); - if (Win) _NB->RemovePage(_NB->GetPageIndex(Win)); + if (Win) + { + if (m_NB0->GetPageIndex(Win) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(Win)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(Win)); + } #endif // Close the sound dll that has an open debugger CPluginManager::GetInstance().OpenDebug( @@ -568,7 +583,13 @@ void CCodeWindow::OnToggleVideoWindow(bool Show, wxAuiNotebook * _NB) { #ifdef _WIN32 wxWindow *Win = GetWxWindow(wxT("Video")); - if (Win) _NB->RemovePage(_NB->GetPageIndex(Win)); + if (Win) + { + if (m_NB0->GetPageIndex(Win) != wxNOT_FOUND) + m_NB0->RemovePage(m_NB0->GetPageIndex(Win)); + else + m_NB1->RemovePage(m_NB1->GetPageIndex(Win)); + } #endif // Close the video dll that has an open debugger CPluginManager::GetInstance().OpenDebug( diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index fa6e460a60..a209e1ae0a 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -369,7 +369,9 @@ CFrame::CFrame(bool showLogWindow, { wxBitmap aNormalFile = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16)); - static int Style = wxAUI_NB_TOP | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER; + static int Style = + wxAUI_NB_TOP | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TAB_SPLIT | + wxAUI_NB_CLOSE_ON_ACTIVE_TAB | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER; m_NB1 = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(430,200), Style); m_NB0 = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(430,200), Style); m_NB0->AddPage(g_pCodeWindow, wxT("Code"), false, aNormalFile ); @@ -421,8 +423,7 @@ CFrame::CFrame(bool showLogWindow, // Create toolbar RecreateToolbar(); - if (!SConfig::GetInstance().m_InterfaceToolbar) - { m_Mgr->GetPane(wxT("TBMain")).Hide(); if (UseDebugger) m_Mgr->GetPane(wxT("TBDebug")).Hide(); } + AuiMode1 = m_Mgr->SavePerspective(); if (UseDebugger) g_pCodeWindow->UpdateToolbar(m_ToolBar2); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 661fecea0c..1b8447d971 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -285,13 +285,15 @@ void CFrame::PopulateToolbar(wxAuiToolBar* toolBar) // Delete and recreate the toolbar void CFrame::RecreateToolbar() { + if (m_ToolBar) { + m_Mgr->DetachPane(m_ToolBar); + delete m_ToolBar; } + m_ToolBar = new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT); PopulateToolbar(m_ToolBar); - UpdateGUI(); - m_Mgr->AddPane(m_ToolBar, wxAuiPaneInfo(). Name(wxT("TBMain")).Caption(wxT("TBMain")). ToolbarPane().Top(). @@ -299,6 +301,10 @@ void CFrame::RecreateToolbar() if (UseDebugger) { + if (m_ToolBar2) { + m_Mgr->DetachPane(m_ToolBar2); + delete m_ToolBar2; } + m_ToolBar2 = new wxAuiToolBar(this, ID_TOOLBAR2, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_OVERFLOW | wxAUI_TB_TEXT); @@ -310,19 +316,11 @@ void CFrame::RecreateToolbar() LeftDockable(false).RightDockable(false).Floatable(false)); } - /* - wxToolBarBase* toolBar = GetToolBar(); - long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE; - delete toolBar; - SetToolBar(NULL); + // Hide toolbars if disabled + if (!SConfig::GetInstance().m_InterfaceToolbar) + { m_Mgr->GetPane(wxT("TBMain")).Hide(); if (UseDebugger) m_Mgr->GetPane(wxT("TBDebug")).Hide(); } - style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP); - m_ToolBar = CreateToolBar(style, ID_TOOLBAR); - - PopulateToolbar(m_ToolBar); - SetToolBar(m_ToolBar); UpdateGUI(); - */ } void CFrame::InitBitmaps() @@ -422,7 +420,7 @@ void CFrame::InitBitmaps() } // Update in case the bitmap has been updated - if (GetToolBar() != NULL) + if (m_ToolBar != NULL) RecreateToolbar(); } /////////////////////////////////////////////////////////////////////////////////////////////////////////