debugger: Use Bind instead of Connect for events

This commit is contained in:
Jonathan Li 2016-04-28 23:32:25 +01:00
parent 4227477fc4
commit 35e17127af
7 changed files with 33 additions and 33 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -17,16 +17,16 @@
#include <wx/wx.h>
#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);

View File

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

View File

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