From fd11f8fd290fbbfe23cf2e8de07e0a7ecbc094c5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Feb 2015 10:56:01 -0500 Subject: [PATCH] DolphinWX: Use AUI in the code window. Allows for resizing of the callstack, function call/callers windows etc. First step in slightly improving the code window. --- Source/Core/DolphinWX/Debugger/CodeWindow.cpp | 31 ++++++++++--------- Source/Core/DolphinWX/Debugger/CodeWindow.h | 4 +++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp index aa7e65c3b6..2b23f85ef9 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -75,31 +74,30 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter { InitBitmaps(); - wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL); - DebugInterface* di = &PowerPC::debug_interface; codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY); - sizerBig->Add(sizerLeft, 2, wxEXPAND); - sizerBig->Add(codeview, 5, wxEXPAND); - sizerLeft->Add(callstack = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); + callstack = new wxListBox(this, wxID_ANY); callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this); - sizerLeft->Add(symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); + symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this); - sizerLeft->Add(calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this); - sizerLeft->Add(callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); + callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); - SetSizer(sizerBig); - - sizerLeft->Fit(this); - sizerBig->Fit(this); + m_aui_manager.SetManagedWindow(this); + m_aui_manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + m_aui_manager.AddPane(callstack, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Callstack"))); + m_aui_manager.AddPane(symbols, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Symbols"))); + m_aui_manager.AddPane(calls, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function calls"))); + m_aui_manager.AddPane(callers, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function callers"))); + m_aui_manager.AddPane(codeview, wxAuiPaneInfo().CenterPane().CloseButton(false).Floatable(false)); + m_aui_manager.Update(); // Menu Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JIT_SR_OFF); @@ -116,6 +114,11 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); } +CCodeWindow::~CCodeWindow() +{ + m_aui_manager.UnInit(); +} + wxMenuBar *CCodeWindow::GetMenuBar() { return Parent->GetMenuBar(); diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.h b/Source/Core/DolphinWX/Debugger/CodeWindow.h index bbb501fec4..cda981adb1 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.h +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "Common/CommonTypes.h" #include "Common/Event.h" @@ -43,6 +44,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxBORDER_NONE, const wxString& name = _("Code")); + ~CCodeWindow(); void Load(); void Save(); @@ -133,4 +135,6 @@ private: wxListBox* callers; wxListBox* calls; Common::Event sync_event; + + wxAuiManager m_aui_manager; };