From 35e17127afa92c4bb2d05cd15e296db210dd82fa Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Thu, 28 Apr 2016 23:32:25 +0100 Subject: [PATCH] debugger: Use Bind instead of Connect for events --- pcsx2/gui/Debugger/CtrlDisassemblyView.cpp | 2 +- pcsx2/gui/Debugger/CtrlMemView.cpp | 2 +- pcsx2/gui/Debugger/CtrlRegisterList.cpp | 2 +- pcsx2/gui/Debugger/DebugEvents.cpp | 22 +++++++++++----------- pcsx2/gui/Debugger/DebugEvents.h | 22 +++++++++++----------- pcsx2/gui/Debugger/DebuggerLists.cpp | 4 ++-- pcsx2/gui/Debugger/DisassemblyDialog.cpp | 12 ++++++------ 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp index 31f5fdf2cd..287ac51fb6 100644 --- a/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp +++ b/pcsx2/gui/Debugger/CtrlDisassemblyView.cpp @@ -173,7 +173,7 @@ CtrlDisassemblyView::CtrlDisassemblyView(wxWindow* parent, DebugInterface* _cpu) menu.Append(ID_DISASM_ADDFUNCTION, L"Add Function Here"); menu.Append(ID_DISASM_RENAMEFUNCTION, L"Rename Function"); menu.Append(ID_DISASM_REMOVEFUNCTION, L"Remove Function"); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&CtrlDisassemblyView::onPopupClick, NULL, this); + menu.Bind(wxEVT_MENU, &CtrlDisassemblyView::onPopupClick, this); SetScrollbar(wxVERTICAL,100,1,201,true); SetDoubleBuffered(true); diff --git a/pcsx2/gui/Debugger/CtrlMemView.cpp b/pcsx2/gui/Debugger/CtrlMemView.cpp index 0e6afffc55..4845fa7ea4 100644 --- a/pcsx2/gui/Debugger/CtrlMemView.cpp +++ b/pcsx2/gui/Debugger/CtrlMemView.cpp @@ -89,7 +89,7 @@ CtrlMemView::CtrlMemView(wxWindow* parent, DebugInterface* _cpu) menu.Append(ID_MEMVIEW_COPYVALUE_128, L"Copy Value (128 bit)"); menu.Append(ID_MEMVIEW_DUMP, L"Dump..."); menu.Enable(ID_MEMVIEW_DUMP,false); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&CtrlMemView::onPopupClick, NULL, this); + menu.Bind(wxEVT_MENU, &CtrlMemView::onPopupClick, this); SetScrollbar(wxVERTICAL,100,1,201,true); SetDoubleBuffered(true); diff --git a/pcsx2/gui/Debugger/CtrlRegisterList.cpp b/pcsx2/gui/Debugger/CtrlRegisterList.cpp index ee3aa46a00..e9f63f33f5 100644 --- a/pcsx2/gui/Debugger/CtrlRegisterList.cpp +++ b/pcsx2/gui/Debugger/CtrlRegisterList.cpp @@ -518,7 +518,7 @@ void CtrlRegisterList::mouseEvent(wxMouseEvent& evt) break; } - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&CtrlRegisterList::onPopupClick, NULL, this); + menu.Bind(wxEVT_MENU, &CtrlRegisterList::onPopupClick, this); PopupMenu(&menu,evt.GetPosition()); return; } diff --git a/pcsx2/gui/Debugger/DebugEvents.cpp b/pcsx2/gui/Debugger/DebugEvents.cpp index eabb3c0e3f..0b2a0b1f1e 100644 --- a/pcsx2/gui/Debugger/DebugEvents.cpp +++ b/pcsx2/gui/Debugger/DebugEvents.cpp @@ -16,17 +16,17 @@ #include "PrecompiledHeader.h" #include "DebugEvents.h" -DEFINE_LOCAL_EVENT_TYPE( debEVT_SETSTATUSBARTEXT ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_UPDATELAYOUT ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_GOTOINMEMORYVIEW ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_GOTOINDISASM ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_RUNTOPOS ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_MAPLOADED ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_STEPOVER ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_STEPINTO ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_STEPOUT ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_UPDATE ) -DEFINE_LOCAL_EVENT_TYPE( debEVT_BREAKPOINTWINDOW ) +wxDEFINE_EVENT(debEVT_SETSTATUSBARTEXT, wxCommandEvent); +wxDEFINE_EVENT(debEVT_UPDATELAYOUT, wxCommandEvent); +wxDEFINE_EVENT(debEVT_GOTOINMEMORYVIEW, wxCommandEvent); +wxDEFINE_EVENT(debEVT_GOTOINDISASM, wxCommandEvent); +wxDEFINE_EVENT(debEVT_RUNTOPOS, wxCommandEvent); +wxDEFINE_EVENT(debEVT_MAPLOADED, wxCommandEvent); +wxDEFINE_EVENT(debEVT_STEPOVER, wxCommandEvent); +wxDEFINE_EVENT(debEVT_STEPINTO, wxCommandEvent); +wxDEFINE_EVENT(debEVT_STEPOUT, wxCommandEvent); +wxDEFINE_EVENT(debEVT_UPDATE, wxCommandEvent); +wxDEFINE_EVENT(debEVT_BREAKPOINTWINDOW, wxCommandEvent); bool parseExpression(const char* exp, DebugInterface* cpu, u64& dest) { diff --git a/pcsx2/gui/Debugger/DebugEvents.h b/pcsx2/gui/Debugger/DebugEvents.h index 876836c519..59283f266c 100644 --- a/pcsx2/gui/Debugger/DebugEvents.h +++ b/pcsx2/gui/Debugger/DebugEvents.h @@ -17,16 +17,16 @@ #include #include "DebugTools/DebugInterface.h" -DECLARE_LOCAL_EVENT_TYPE( debEVT_SETSTATUSBARTEXT, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_UPDATELAYOUT, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_GOTOINMEMORYVIEW, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_GOTOINDISASM, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_RUNTOPOS, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_MAPLOADED, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_STEPOVER, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_STEPINTO, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_STEPOUT, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_UPDATE, wxNewEventType() ) -DECLARE_LOCAL_EVENT_TYPE( debEVT_BREAKPOINTWINDOW, wxNewEventType() ) +wxDECLARE_EVENT(debEVT_SETSTATUSBARTEXT, wxCommandEvent); +wxDECLARE_EVENT(debEVT_UPDATELAYOUT, wxCommandEvent); +wxDECLARE_EVENT(debEVT_GOTOINMEMORYVIEW, wxCommandEvent); +wxDECLARE_EVENT(debEVT_GOTOINDISASM, wxCommandEvent); +wxDECLARE_EVENT(debEVT_RUNTOPOS, wxCommandEvent); +wxDECLARE_EVENT(debEVT_MAPLOADED, wxCommandEvent); +wxDECLARE_EVENT(debEVT_STEPOVER, wxCommandEvent); +wxDECLARE_EVENT(debEVT_STEPINTO, wxCommandEvent); +wxDECLARE_EVENT(debEVT_STEPOUT, wxCommandEvent); +wxDECLARE_EVENT(debEVT_UPDATE, wxCommandEvent); +wxDECLARE_EVENT(debEVT_BREAKPOINTWINDOW, wxCommandEvent); bool executeExpressionWindow(wxWindow* parent, DebugInterface* cpu, u64& dest, const wxString& defaultValue = wxEmptyString); diff --git a/pcsx2/gui/Debugger/DebuggerLists.cpp b/pcsx2/gui/Debugger/DebuggerLists.cpp index cd80d55876..1af111b9c9 100644 --- a/pcsx2/gui/Debugger/DebuggerLists.cpp +++ b/pcsx2/gui/Debugger/DebuggerLists.cpp @@ -461,7 +461,7 @@ void BreakpointList::showMenu(const wxPoint& pos) menu.AppendCheckItem(ID_BREAKPOINTLIST_ENABLE, L"Enable"); menu.Append(ID_BREAKPOINTLIST_EDIT, L"Edit"); menu.AppendSeparator(); - + // check if the breakpoint is enabled bool enabled; if (isMemory) @@ -474,7 +474,7 @@ void BreakpointList::showMenu(const wxPoint& pos) menu.Append(ID_BREAKPOINTLIST_ADDNEW, L"Add new"); - menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&BreakpointList::onPopupClick, NULL, this); + menu.Bind(wxEVT_MENU, &BreakpointList::onPopupClick, this); PopupMenu(&menu,pos); } diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.cpp b/pcsx2/gui/Debugger/DisassemblyDialog.cpp index c1c5d0030f..e0ffeee7d7 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.cpp +++ b/pcsx2/gui/Debugger/DisassemblyDialog.cpp @@ -230,26 +230,26 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent): wxBoxSizer* topRowSizer = new wxBoxSizer(wxHORIZONTAL); breakRunButton = new wxButton(panel, wxID_ANY, L"Run"); - Connect(breakRunButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisassemblyDialog::onBreakRunClicked)); + Bind(wxEVT_BUTTON, &DisassemblyDialog::onBreakRunClicked, this, breakRunButton->GetId()); topRowSizer->Add(breakRunButton,0,wxRIGHT,8); stepIntoButton = new wxButton( panel, wxID_ANY, L"Step Into" ); stepIntoButton->Enable(false); - Connect( stepIntoButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DisassemblyDialog::onStepIntoClicked ) ); + Bind(wxEVT_BUTTON, &DisassemblyDialog::onStepIntoClicked, this, stepIntoButton->GetId()); topRowSizer->Add(stepIntoButton,0,wxBOTTOM,2); stepOverButton = new wxButton( panel, wxID_ANY, L"Step Over" ); stepOverButton->Enable(false); - Connect( stepOverButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DisassemblyDialog::onStepOverClicked ) ); + Bind(wxEVT_BUTTON, &DisassemblyDialog::onStepOverClicked, this, stepOverButton->GetId()); topRowSizer->Add(stepOverButton); stepOutButton = new wxButton( panel, wxID_ANY, L"Step Out" ); stepOutButton->Enable(false); - Connect( stepOutButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DisassemblyDialog::onStepOutClicked ) ); + Bind(wxEVT_BUTTON, &DisassemblyDialog::onStepOutClicked, this, stepOutButton->GetId()); topRowSizer->Add(stepOutButton,0,wxRIGHT,8); breakpointButton = new wxButton( panel, wxID_ANY, L"Breakpoint" ); - Connect( breakpointButton->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DisassemblyDialog::onBreakpointClick ) ); + Bind(wxEVT_BUTTON, &DisassemblyDialog::onBreakpointClick, this, breakpointButton->GetId()); topRowSizer->Add(breakpointButton); topSizer->Add(topRowSizer,0,wxLEFT|wxRIGHT|wxTOP,3); @@ -261,7 +261,7 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent): iopTab = new CpuTabPage(middleBook,&r3000Debug); middleBook->AddPage(eeTab,L"R5900"); middleBook->AddPage(iopTab,L"R3000"); - Connect(middleBook->GetId(),wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,wxCommandEventHandler( DisassemblyDialog::onPageChanging)); + Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &DisassemblyDialog::onPageChanging, this, middleBook->GetId()); topSizer->Add(middleBook,3,wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM,3); currentCpu = eeTab;