From c25020765c2c04c0e60c232a40128ad0232538b9 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Sat, 8 Mar 2014 13:04:39 +0100 Subject: [PATCH] Display memory view page when setting its position --- pcsx2/gui/Debugger/DebuggerLists.cpp | 2 +- pcsx2/gui/Debugger/DisassemblyDialog.cpp | 16 ++++++++++++++++ pcsx2/gui/Debugger/DisassemblyDialog.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/Debugger/DebuggerLists.cpp b/pcsx2/gui/Debugger/DebuggerLists.cpp index 8e0c1c9855..ec044076b6 100644 --- a/pcsx2/gui/Debugger/DebuggerLists.cpp +++ b/pcsx2/gui/Debugger/DebuggerLists.cpp @@ -47,7 +47,7 @@ GenericListViewColumn breakpointColumns[BPL_COLUMNCOUNT] = { }; BreakpointList::BreakpointList(wxWindow* parent, DebugInterface* _cpu, CtrlDisassemblyView* _disassembly) - : wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL), cpu(_cpu), disasm(_disassembly) + : wxListView(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxLC_VIRTUAL|wxLC_REPORT|wxLC_SINGLE_SEL|wxNO_BORDER), cpu(_cpu), disasm(_disassembly) { insertListViewColumns(this,breakpointColumns,BPL_COLUMNCOUNT); } diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.cpp b/pcsx2/gui/Debugger/DisassemblyDialog.cpp index 2c9f31c505..27842dcc9f 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.cpp +++ b/pcsx2/gui/Debugger/DisassemblyDialog.cpp @@ -83,6 +83,18 @@ CpuTabPage::CpuTabPage(wxWindow* parent, DebugInterface* _cpu) mainSizer->Layout(); } +void CpuTabPage::setBottomTabPage(wxWindow* win) +{ + for (size_t i = 0; i < bottomTabs->GetPageCount(); i++) + { + if (bottomTabs->GetPage(i) == win) + { + bottomTabs->SetSelection(i); + break; + } + } +} + void CpuTabPage::update() { breakpointList->reloadBreakpoints(); @@ -335,7 +347,11 @@ void DisassemblyDialog::onDebuggerEvent(wxCommandEvent& evt) } else if (type == debEVT_GOTOINMEMORYVIEW) { if (currentCpu != NULL) + { + currentCpu->showMemoryView(); currentCpu->getMemoryView()->gotoAddress(evt.GetInt()); + currentCpu->getDisassembly()->SetFocus(); + } } else if (type == debEVT_RUNTOPOS) { // todo: breakpoints for iop diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.h b/pcsx2/gui/Debugger/DisassemblyDialog.h index 84fe86e16a..6b0bfa48cf 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.h +++ b/pcsx2/gui/Debugger/DisassemblyDialog.h @@ -25,7 +25,9 @@ public: CtrlMemView* getMemoryView() { return memory; }; wxNotebook* getBottomTabs() { return bottomTabs; }; void update(); + void showMemoryView() { setBottomTabPage(memory); }; private: + void setBottomTabPage(wxWindow* win); DebugInterface* cpu; CtrlDisassemblyView* disassembly; CtrlRegisterList* registerList;