From de1f3d0df716f1aa3b28d73dfcf3b314149f4d61 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Mon, 28 Dec 2015 17:41:19 +0100 Subject: [PATCH] Remember size of debugger window --- pcsx2/Config.h | 5 ++++- pcsx2/Pcsx2Config.cpp | 4 ++++ pcsx2/gui/Debugger/DisassemblyDialog.cpp | 17 +++++++++++++++++ pcsx2/gui/Debugger/DisassemblyDialog.h | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pcsx2/Config.h b/pcsx2/Config.h index c5307a0657..a767b0ef27 100644 --- a/pcsx2/Config.h +++ b/pcsx2/Config.h @@ -414,13 +414,16 @@ struct Pcsx2Config u8 FontWidth; u8 FontHeight; + u32 WindowWidth; + u32 WindowHeight; DebugOptions(); void LoadSave( IniInterface& conf ); bool operator ==( const DebugOptions& right ) const { - return OpEqu( bitset ) && OpEqu( FontWidth ) && OpEqu( FontHeight ); + return OpEqu( bitset ) && OpEqu( FontWidth ) && OpEqu( FontHeight ) + && OpEqu( WindowWidth ) && OpEqu( WindowHeight ); } bool operator !=( const DebugOptions& right ) const diff --git a/pcsx2/Pcsx2Config.cpp b/pcsx2/Pcsx2Config.cpp index a70cab4ca8..c70a636cab 100644 --- a/pcsx2/Pcsx2Config.cpp +++ b/pcsx2/Pcsx2Config.cpp @@ -379,6 +379,8 @@ Pcsx2Config::DebugOptions::DebugOptions() ShowDebuggerOnStart = false; FontWidth = 8; FontHeight = 12; + WindowWidth = 0; + WindowHeight = 0; } void Pcsx2Config::DebugOptions::LoadSave( IniInterface& ini ) @@ -388,6 +390,8 @@ void Pcsx2Config::DebugOptions::LoadSave( IniInterface& ini ) IniBitBool( ShowDebuggerOnStart ); IniBitfield(FontWidth); IniBitfield(FontHeight); + IniBitfield(WindowWidth); + IniBitfield(WindowHeight); } diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.cpp b/pcsx2/gui/Debugger/DisassemblyDialog.cpp index 1f642918e2..4e870cffb3 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.cpp +++ b/pcsx2/gui/Debugger/DisassemblyDialog.cpp @@ -39,6 +39,7 @@ BEGIN_EVENT_TABLE(DisassemblyDialog, wxFrame) EVT_COMMAND( wxID_ANY, debEVT_UPDATE, DisassemblyDialog::onDebuggerEvent ) EVT_COMMAND( wxID_ANY, debEVT_BREAKPOINTWINDOW, DisassemblyDialog::onDebuggerEvent ) EVT_COMMAND( wxID_ANY, debEVT_MAPLOADED, DisassemblyDialog::onDebuggerEvent ) + EVT_SIZE(DisassemblyDialog::onSizeEvent) EVT_CLOSE( DisassemblyDialog::onClose ) END_EVENT_TABLE() @@ -217,6 +218,8 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent): wxFrame( parent, wxID_ANY, L"Debugger", wxDefaultPosition,wxDefaultSize,wxRESIZE_BORDER|wxCLOSE_BOX|wxCAPTION|wxSYSTEM_MENU ), currentCpu(NULL) { + int width = g_Conf->EmuOptions.Debugger.WindowWidth; + int height = g_Conf->EmuOptions.Debugger.WindowHeight; topSizer = new wxBoxSizer( wxVERTICAL ); wxPanel *panel = new wxPanel(this, wxID_ANY, @@ -267,9 +270,23 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent): SetMinSize(wxSize(1000,600)); panel->GetSizer()->Fit(this); + if (width != 0 && height != 0) + SetSize(width,height); + setDebugMode(true,true); } +void DisassemblyDialog::onSizeEvent(wxSizeEvent& event) +{ + if (event.GetEventType() == wxEVT_SIZE) + { + g_Conf->EmuOptions.Debugger.WindowWidth = event.GetSize().x; + g_Conf->EmuOptions.Debugger.WindowHeight = event.GetSize().y; + } + + event.Skip(); +} + #ifdef WIN32 WXLRESULT DisassemblyDialog::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) { diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.h b/pcsx2/gui/Debugger/DisassemblyDialog.h index 0406934184..77f3bbb385 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.h +++ b/pcsx2/gui/Debugger/DisassemblyDialog.h @@ -102,6 +102,7 @@ protected: void onDebuggerEvent(wxCommandEvent& evt); void onPageChanging(wxCommandEvent& evt); void onBreakpointClick(wxCommandEvent& evt); + void onSizeEvent(wxSizeEvent& event); void onClose(wxCloseEvent& evt); void stepOver(); void stepInto();