Remember size of debugger window

This commit is contained in:
Kingcom 2015-12-28 17:41:19 +01:00
parent be0ad9be2f
commit de1f3d0df7
4 changed files with 26 additions and 1 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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();