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.
This commit is contained in:
Lioncash 2015-02-24 10:56:01 -05:00
parent 7d5a558f31
commit fd11f8fd29
2 changed files with 21 additions and 14 deletions

View File

@ -15,7 +15,6 @@
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/textdlg.h>
@ -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();

View File

@ -12,6 +12,7 @@
#include <wx/string.h>
#include <wx/translation.h>
#include <wx/windowid.h>
#include <wx/aui/framemanager.h>
#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;
};