Merge pull request #1507 from lioncash/event

DolphinWX: Eliminate most usages of event tables in the debugger
This commit is contained in:
skidau 2014-11-08 12:26:52 +11:00
commit a2fa679b2e
24 changed files with 81 additions and 171 deletions

View File

@ -21,14 +21,12 @@
#include "DolphinWX/Debugger/BreakpointDlg.h" #include "DolphinWX/Debugger/BreakpointDlg.h"
#include "DolphinWX/Debugger/BreakpointWindow.h" #include "DolphinWX/Debugger/BreakpointWindow.h"
BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog)
EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK)
END_EVENT_TABLE()
BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent) BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent)
: wxDialog(_Parent, wxID_ANY, _("Add Breakpoint")) : wxDialog(_Parent, wxID_ANY, _("Add Breakpoint"))
, Parent(_Parent) , Parent(_Parent)
{ {
Bind(wxEVT_BUTTON, &BreakPointDlg::OnOK, this, wxID_OK);
m_pEditAddress = new wxTextCtrl(this, wxID_ANY, "80000000"); m_pEditAddress = new wxTextCtrl(this, wxID_ANY, "80000000");
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);

View File

@ -20,6 +20,4 @@ private:
wxTextCtrl *m_pEditAddress; wxTextCtrl *m_pEditAddress;
void OnOK(wxCommandEvent& event); void OnOK(wxCommandEvent& event);
DECLARE_EVENT_TABLE();
}; };

View File

@ -96,21 +96,19 @@ private:
wxBitmap m_Bitmaps[Num_Bitmaps]; wxBitmap m_Bitmaps[Num_Bitmaps];
}; };
BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_CLOSE(CBreakPointWindow::OnClose)
EVT_LIST_ITEM_SELECTED(wxID_ANY, CBreakPointWindow::OnSelectBP)
END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent, CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent,
wxWindowID id, const wxString& title, const wxPoint& position, wxWindowID id, const wxString& title, const wxPoint& position,
const wxSize& size, long style) const wxSize& size, long style)
: wxPanel(parent, id, position, size, style, title) : wxPanel(parent, id, position, size, style, title)
, m_pCodeWindow(_pCodeWindow) , m_pCodeWindow(_pCodeWindow)
{ {
Bind(wxEVT_CLOSE_WINDOW, &CBreakPointWindow::OnClose, this);
m_mgr.SetManagedWindow(this); m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
m_BreakPointListView = new CBreakPointView(this, wxID_ANY); m_BreakPointListView = new CBreakPointView(this, wxID_ANY);
m_BreakPointListView->Bind(wxEVT_LIST_ITEM_SELECTED, &CBreakPointWindow::OnSelectBP, this);
m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top(). m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top().
LeftDockable(true).RightDockable(true).BottomDockable(false).Floatable(false)); LeftDockable(true).RightDockable(true).BottomDockable(false).Floatable(false));

View File

@ -43,8 +43,6 @@ public:
void LoadAll(); void LoadAll();
private: private:
DECLARE_EVENT_TABLE();
wxAuiManager m_mgr; wxAuiManager m_mgr;
CBreakPointView* m_BreakPointListView; CBreakPointView* m_BreakPointListView;
CCodeWindow* m_pCodeWindow; CCodeWindow* m_pCodeWindow;

View File

@ -58,19 +58,6 @@ enum
IDM_ADDFUNCTION, IDM_ADDFUNCTION,
}; };
BEGIN_EVENT_TABLE(CCodeView, wxControl)
EVT_ERASE_BACKGROUND(CCodeView::OnErase)
EVT_PAINT(CCodeView::OnPaint)
EVT_MOUSEWHEEL(CCodeView::OnScrollWheel)
EVT_LEFT_DOWN(CCodeView::OnMouseDown)
EVT_LEFT_UP(CCodeView::OnMouseUpL)
EVT_MOTION(CCodeView::OnMouseMove)
EVT_RIGHT_DOWN(CCodeView::OnMouseDown)
EVT_RIGHT_UP(CCodeView::OnMouseUpR)
EVT_MENU(-1, CCodeView::OnPopupMenu)
EVT_SIZE(CCodeView::OnResize)
END_EVENT_TABLE()
CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb, CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
wxWindow* parent, wxWindowID Id) wxWindow* parent, wxWindowID Id)
: wxControl(parent, Id), : wxControl(parent, Id),
@ -86,6 +73,16 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
m_lx(-1), m_lx(-1),
m_ly(-1) m_ly(-1)
{ {
Bind(wxEVT_ERASE_BACKGROUND, &CCodeView::OnErase, this);
Bind(wxEVT_PAINT, &CCodeView::OnPaint, this);
Bind(wxEVT_MOUSEWHEEL, &CCodeView::OnScrollWheel, this);
Bind(wxEVT_LEFT_DOWN, &CCodeView::OnMouseDown, this);
Bind(wxEVT_LEFT_UP, &CCodeView::OnMouseUpL, this);
Bind(wxEVT_MOTION, &CCodeView::OnMouseMove, this);
Bind(wxEVT_RIGHT_DOWN, &CCodeView::OnMouseDown, this);
Bind(wxEVT_RIGHT_UP, &CCodeView::OnMouseUpR, this);
Bind(wxEVT_MENU, &CCodeView::OnPopupMenu, this);
Bind(wxEVT_SIZE, &CCodeView::OnResize, this);
} }
int CCodeView::YToAddress(int y) int CCodeView::YToAddress(int y)

View File

@ -95,6 +95,4 @@ private:
bool m_selecting; bool m_selecting;
int m_lx, m_ly; int m_lx, m_ly;
DECLARE_EVENT_TABLE()
}; };

View File

@ -60,35 +60,6 @@ extern "C" // Bitmaps
#include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT #include "DolphinWX/resources/toolbar_add_breakpoint.c" // NOLINT
} }
class DebugInterface;
// -------
// Main
BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
// Menu bar
EVT_MENU_RANGE(IDM_INTERPRETER, IDM_JITSROFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU_RANGE(IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU_RANGE(IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU_RANGE(IDM_PROFILEBLOCKS, IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
// Toolbar
EVT_MENU_RANGE(IDM_STEP, IDM_GOTOPC, CCodeWindow::OnCodeStep)
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
// Other
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
EVT_LISTBOX(ID_CALLERSLIST, CCodeWindow::OnCallersListChange)
EVT_LISTBOX(ID_CALLSLIST, CCodeWindow::OnCallsListChange)
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
END_EVENT_TABLE()
// Class
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent,
wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name)
: wxPanel(parent, id, position, size, style, name) : wxPanel(parent, id, position, size, style, name)
@ -109,23 +80,40 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
DebugInterface* di = &PowerPC::debug_interface; DebugInterface* di = &PowerPC::debug_interface;
codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW); codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY);
sizerBig->Add(sizerLeft, 2, wxEXPAND); sizerBig->Add(sizerLeft, 2, wxEXPAND);
sizerBig->Add(codeview, 5, wxEXPAND); sizerBig->Add(codeview, 5, wxEXPAND);
sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, sizerLeft->Add(callstack = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this);
sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST,
wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND); sizerLeft->Add(symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 1, wxEXPAND);
sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this);
wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND);
sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, sizerLeft->Add(calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND);
wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND); calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this);
sizerLeft->Add(callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(90, 100), 0, nullptr, wxLB_SORT), 0, wxEXPAND);
callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this);
SetSizer(sizerBig); SetSizer(sizerBig);
sizerLeft->Fit(this); sizerLeft->Fit(this);
sizerBig->Fit(this); sizerBig->Fit(this);
// Menu
Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JITSROFF);
Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONTPICKER);
Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION);
Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEARSYMBOLS, IDM_PATCHHLEFUNCTIONS);
Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILEBLOCKS, IDM_WRITEPROFILE);
// Toolbar
Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC);
Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this, IDM_ADDRBOX);
// Other
Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this);
} }
wxMenuBar *CCodeWindow::GetMenuBar() wxMenuBar *CCodeWindow::GetMenuBar()

View File

@ -108,16 +108,6 @@ public:
int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1]; int iNbAffiliation[IDM_CODEWINDOW - IDM_LOGWINDOW + 1];
private: private:
enum
{
// Debugger GUI Objects
ID_CODEVIEW,
ID_CALLSTACKLIST,
ID_CALLERSLIST,
ID_CALLSLIST,
ID_SYMBOLLIST
};
void OnSymbolListChange(wxCommandEvent& event); void OnSymbolListChange(wxCommandEvent& event);
void OnSymbolListContextMenu(wxContextMenuEvent& event); void OnSymbolListContextMenu(wxContextMenuEvent& event);
void OnCallstackListChange(wxCommandEvent& event); void OnCallstackListChange(wxCommandEvent& event);
@ -143,6 +133,4 @@ private:
wxListBox* callers; wxListBox* callers;
wxListBox* calls; wxListBox* calls;
Common::Event sync_event; Common::Event sync_event;
DECLARE_EVENT_TABLE()
}; };

View File

@ -33,23 +33,16 @@
#include "DolphinWX/Debugger/DSPRegisterView.h" #include "DolphinWX/Debugger/DSPRegisterView.h"
#include "DolphinWX/Debugger/MemoryView.h" #include "DolphinWX/Debugger/MemoryView.h"
class wxWindow;
static DSPDebuggerLLE* m_DebuggerFrame = nullptr; static DSPDebuggerLLE* m_DebuggerFrame = nullptr;
BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel)
EVT_CLOSE(DSPDebuggerLLE::OnClose)
EVT_MENU_RANGE(ID_RUNTOOL, ID_SHOWPCTOOL, DSPDebuggerLLE::OnChangeState)
EVT_TEXT_ENTER(ID_ADDRBOX, DSPDebuggerLLE::OnAddrBoxChange)
EVT_LISTBOX(ID_SYMBOLLIST, DSPDebuggerLLE::OnSymbolListChange)
END_EVENT_TABLE()
DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize,
wxTAB_TRAVERSAL, _("DSP LLE Debugger")) wxTAB_TRAVERSAL, _("DSP LLE Debugger"))
, m_CachedStepCounter(-1) , m_CachedStepCounter(-1)
{ {
Bind(wxEVT_CLOSE_WINDOW, &DSPDebuggerLLE::OnClose, this);
Bind(wxEVT_MENU, &DSPDebuggerLLE::OnChangeState, this, ID_RUNTOOL, ID_SHOWPCTOOL);
m_DebuggerFrame = this; m_DebuggerFrame = this;
// notify wxAUI which frame to use // notify wxAUI which frame to use
@ -65,12 +58,16 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
m_Toolbar->AddTool(ID_SHOWPCTOOL, _("Show PC"), m_Toolbar->AddTool(ID_SHOWPCTOOL, _("Show PC"),
wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10))); wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_OTHER, wxSize(10,10)));
m_Toolbar->AddSeparator(); m_Toolbar->AddSeparator();
m_Toolbar->AddControl(new wxTextCtrl(m_Toolbar, ID_ADDRBOX, wxEmptyString,
wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER)); m_addr_txtctrl = new wxTextCtrl(m_Toolbar, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
m_addr_txtctrl->Bind(wxEVT_TEXT_ENTER, &DSPDebuggerLLE::OnAddrBoxChange, this);
m_Toolbar->AddControl(m_addr_txtctrl);
m_Toolbar->Realize(); m_Toolbar->Realize();
m_SymbolList = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, m_SymbolList = new wxListBox(this, wxID_ANY, wxDefaultPosition,
wxSize(140, 100), 0, nullptr, wxLB_SORT); wxSize(140, 100), 0, nullptr, wxLB_SORT);
m_SymbolList->Bind(wxEVT_LISTBOX, &DSPDebuggerLLE::OnSymbolListChange, this);
m_MainNotebook = new wxAuiNotebook(this, wxID_ANY, m_MainNotebook = new wxAuiNotebook(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
@ -253,8 +250,7 @@ void DSPDebuggerLLE::UpdateRegisterFlags()
void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event) void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event)
{ {
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX); wxString txt = m_addr_txtctrl->GetValue();
wxString txt = pAddrCtrl->GetValue();
auto text = StripSpaces(WxStrToStr(txt)); auto text = StripSpaces(WxStrToStr(txt));
if (text.size()) if (text.size())
@ -262,9 +258,9 @@ void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event)
u32 addr; u32 addr;
sscanf(text.c_str(), "%04x", &addr); sscanf(text.c_str(), "%04x", &addr);
if (JumpToAddress(addr)) if (JumpToAddress(addr))
pAddrCtrl->SetBackgroundColour(*wxWHITE); m_addr_txtctrl->SetBackgroundColour(*wxWHITE);
else else
pAddrCtrl->SetBackgroundColour(*wxRED); m_addr_txtctrl->SetBackgroundColour(*wxRED);
} }
event.Skip(); event.Skip();
} }

View File

@ -30,16 +30,12 @@ public:
void Update() override; void Update() override;
private: private:
DECLARE_EVENT_TABLE();
enum enum
{ {
ID_TOOLBAR = 1000, ID_TOOLBAR = 1000,
ID_RUNTOOL, ID_RUNTOOL,
ID_STEPTOOL, ID_STEPTOOL,
ID_SHOWPCTOOL, ID_SHOWPCTOOL,
ID_ADDRBOX,
ID_SYMBOLLIST,
ID_DSP_REGS ID_DSP_REGS
}; };
@ -59,6 +55,7 @@ private:
CMemoryView* m_MemView; CMemoryView* m_MemView;
DSPRegisterView* m_Regs; DSPRegisterView* m_Regs;
wxListBox* m_SymbolList; wxListBox* m_SymbolList;
wxTextCtrl* m_addr_txtctrl;
wxAuiNotebook* m_MainNotebook; wxAuiNotebook* m_MainNotebook;
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);

View File

@ -170,43 +170,24 @@ std::string HostDisassemblerX86::DisassembleHostBlock(const u8* code_start, cons
return x86_disasm.str(); return x86_disasm.str();
} }
enum
{
IDM_REFRESH_LIST = 23350,
IDM_PPC_BOX,
IDM_X86_BOX,
IDM_NEXT,
IDM_PREV,
IDM_BLOCKLIST,
};
BEGIN_EVENT_TABLE(CJitWindow, wxPanel)
//EVT_TEXT(IDM_ADDRBOX, CJitWindow::OnAddrBoxChange)
//EVT_LISTBOX(IDM_SYMBOLLIST, CJitWindow::OnSymbolListChange)
//EVT_HOST_COMMAND(wxID_ANY, CJitWindow::OnHostMessage)
EVT_BUTTON(IDM_REFRESH_LIST, CJitWindow::OnRefresh)
END_EVENT_TABLE()
CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos, CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style, const wxString& name) const wxSize& size, long style, const wxString& name)
: wxPanel(parent, id, pos, size, style, name) : wxPanel(parent, id, pos, size, style, name)
{ {
wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizerBig = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sizerSplit = new wxBoxSizer(wxHORIZONTAL);
sizerSplit->Add(ppc_box = new wxTextCtrl(this, IDM_PPC_BOX, "(ppc)", sizerSplit->Add(ppc_box = new wxTextCtrl(this, wxID_ANY, "(ppc)",
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND); wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerSplit->Add(x86_box = new wxTextCtrl(this, IDM_X86_BOX, "(x86)", sizerSplit->Add(x86_box = new wxTextCtrl(this, wxID_ANY, "(x86)",
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND); wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE), 1, wxEXPAND);
sizerBig->Add(block_list = new JitBlockList(this, IDM_BLOCKLIST, sizerBig->Add(block_list = new JitBlockList(this, wxID_ANY,
wxDefaultPosition, wxSize(100, 140), wxDefaultPosition, wxSize(100, 140),
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING), wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING),
0, wxEXPAND); 0, wxEXPAND);
sizerBig->Add(sizerSplit, 2, wxEXPAND); sizerBig->Add(sizerSplit, 2, wxEXPAND);
// sizerBig->Add(memview, 5, wxEXPAND);
// sizerBig->Add(sizerRight, 0, wxEXPAND | wxALL, 3); sizerBig->Add(button_refresh = new wxButton(this, wxID_ANY, _("&Refresh")));
sizerBig->Add(button_refresh = new wxButton(this, IDM_REFRESH_LIST, _("&Refresh"))); button_refresh->Bind(wxEVT_BUTTON, &CJitWindow::OnRefresh, this);
// sizerRight->Add(addrbox = new wxTextCtrl(this, IDM_ADDRBOX, ""));
// sizerRight->Add(new wxButton(this, IDM_SETPC, _("S&et PC")));
SetSizer(sizerBig); SetSizer(sizerBig);

View File

@ -77,8 +77,6 @@ private:
wxTextCtrl* x86_box; wxTextCtrl* x86_box;
wxListBox* top_instructions; wxListBox* top_instructions;
DECLARE_EVENT_TABLE()
void OnSymbolListChange(wxCommandEvent& event); void OnSymbolListChange(wxCommandEvent& event);
void OnCallstackListChange(wxCommandEvent& event); void OnCallstackListChange(wxCommandEvent& event);
void OnAddrBoxChange(wxCommandEvent& event); void OnAddrBoxChange(wxCommandEvent& event);

View File

@ -25,14 +25,12 @@
#define TEXT_BOX(text) new wxStaticText(this, wxID_ANY, _(text)) #define TEXT_BOX(text) new wxStaticText(this, wxID_ANY, _(text))
BEGIN_EVENT_TABLE(MemoryCheckDlg, wxDialog)
EVT_BUTTON(wxID_OK, MemoryCheckDlg::OnOK)
END_EVENT_TABLE()
MemoryCheckDlg::MemoryCheckDlg(CBreakPointWindow *parent) MemoryCheckDlg::MemoryCheckDlg(CBreakPointWindow *parent)
: wxDialog(parent, wxID_ANY, _("Memory Check")) : wxDialog(parent, wxID_ANY, _("Memory Check"))
, m_parent(parent) , m_parent(parent)
{ {
Bind(wxEVT_BUTTON, &MemoryCheckDlg::OnOK, this);
m_pEditStartAddress = new wxTextCtrl(this, wxID_ANY, ""); m_pEditStartAddress = new wxTextCtrl(this, wxID_ANY, "");
m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY, ""); m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY, "");
m_pWriteFlag = new wxCheckBox(this, wxID_ANY, _("Write")); m_pWriteFlag = new wxCheckBox(this, wxID_ANY, _("Write"));

View File

@ -26,6 +26,4 @@ private:
wxTextCtrl* m_pEditStartAddress; wxTextCtrl* m_pEditStartAddress;
void OnOK(wxCommandEvent& event); void OnOK(wxCommandEvent& event);
DECLARE_EVENT_TABLE();
}; };

View File

@ -48,17 +48,6 @@ enum
IDM_VIEWASHEX, IDM_VIEWASHEX,
}; };
BEGIN_EVENT_TABLE(CMemoryView, wxControl)
EVT_PAINT(CMemoryView::OnPaint)
EVT_LEFT_DOWN(CMemoryView::OnMouseDownL)
EVT_LEFT_UP(CMemoryView::OnMouseUpL)
EVT_MOTION(CMemoryView::OnMouseMove)
EVT_RIGHT_DOWN(CMemoryView::OnMouseDownR)
EVT_MOUSEWHEEL(CMemoryView::OnScrollWheel)
EVT_MENU(-1, CMemoryView::OnPopupMenu)
EVT_SIZE(CMemoryView::OnResize)
END_EVENT_TABLE()
CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent) CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
: wxControl(parent, wxID_ANY) : wxControl(parent, wxID_ANY)
, curAddress(debuginterface->GetPC()) , curAddress(debuginterface->GetPC())
@ -71,6 +60,14 @@ CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent)
, memory(0) , memory(0)
, viewAsType(VIEWAS_FP) , viewAsType(VIEWAS_FP)
{ {
Bind(wxEVT_PAINT, &CMemoryView::OnPaint, this);
Bind(wxEVT_LEFT_DOWN, &CMemoryView::OnMouseDownL, this);
Bind(wxEVT_LEFT_UP, &CMemoryView::OnMouseUpL, this);
Bind(wxEVT_MOTION, &CMemoryView::OnMouseMove, this);
Bind(wxEVT_RIGHT_DOWN, &CMemoryView::OnMouseDownR, this);
Bind(wxEVT_MOUSEWHEEL, &CMemoryView::OnScrollWheel, this);
Bind(wxEVT_MENU, &CMemoryView::OnPopupMenu, this);
Bind(wxEVT_SIZE, &CMemoryView::OnResize, this);
} }
int CMemoryView::YToAddress(int y) int CMemoryView::YToAddress(int y)

View File

@ -58,6 +58,4 @@ private:
}; };
EViewAsType viewAsType; EViewAsType viewAsType;
DECLARE_EVENT_TABLE()
}; };

View File

@ -255,6 +255,9 @@ CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id)
SetColLabelSize(0); SetColLabelSize(0);
DisableDragRowSize(); DisableDragRowSize();
Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CRegisterView::OnMouseDownR, this);
Bind(wxEVT_MENU, &CRegisterView::OnPopupMenu, this);
AutoSizeColumns(); AutoSizeColumns();
} }

View File

@ -15,14 +15,6 @@
#include "DolphinWX/Debugger/RegisterView.h" #include "DolphinWX/Debugger/RegisterView.h"
#include "DolphinWX/Debugger/RegisterWindow.h" #include "DolphinWX/Debugger/RegisterWindow.h"
class wxWindow;
BEGIN_EVENT_TABLE(CRegisterWindow, wxPanel)
EVT_GRID_CELL_RIGHT_CLICK(CRegisterView::OnMouseDownR)
EVT_MENU(-1, CRegisterView::OnPopupMenu)
END_EVENT_TABLE()
CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id, CRegisterWindow::CRegisterWindow(wxWindow* parent, wxWindowID id,
const wxPoint& position, const wxSize& size, const wxPoint& position, const wxSize& size,
long style, const wxString& name) long style, const wxString& name)

View File

@ -15,8 +15,7 @@
class CRegisterView; class CRegisterView;
class wxWindow; class wxWindow;
class CRegisterWindow class CRegisterWindow : public wxPanel
: public wxPanel
{ {
public: public:
CRegisterWindow(wxWindow* parent, CRegisterWindow(wxWindow* parent,
@ -28,10 +27,7 @@ public:
void NotifyUpdate(); void NotifyUpdate();
private: private:
DECLARE_EVENT_TABLE();
enum enum
{ {
ID_GPR = 1002 ID_GPR = 1002

View File

@ -221,6 +221,9 @@ CWatchView::CWatchView(wxWindow* parent, wxWindowID id)
SetRowLabelSize(0); SetRowLabelSize(0);
SetColLabelSize(0); SetColLabelSize(0);
DisableDragRowSize(); DisableDragRowSize();
Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CWatchView::OnMouseDownR, this);
Bind(wxEVT_MENU, &CWatchView::OnPopupMenu, this);
} }
void CWatchView::Update() void CWatchView::Update()

View File

@ -26,13 +26,6 @@ extern "C" {
#include "DolphinWX/resources/toolbar_debugger_delete.c" #include "DolphinWX/resources/toolbar_debugger_delete.c"
} }
class wxWindow;
BEGIN_EVENT_TABLE(CWatchWindow, wxPanel)
EVT_GRID_CELL_RIGHT_CLICK(CWatchView::OnMouseDownR)
EVT_MENU(-1, CWatchView::OnPopupMenu)
END_EVENT_TABLE()
class CWatchToolbar : public wxAuiToolBar class CWatchToolbar : public wxAuiToolBar
{ {
public: public:

View File

@ -16,8 +16,7 @@
class CWatchView; class CWatchView;
class wxWindow; class wxWindow;
class CWatchWindow class CWatchWindow : public wxPanel
: public wxPanel
{ {
public: public:
CWatchWindow(wxWindow* parent, CWatchWindow(wxWindow* parent,
@ -35,8 +34,6 @@ public:
void LoadAll(); void LoadAll();
private: private:
DECLARE_EVENT_TABLE();
wxAuiManager m_mgr; wxAuiManager m_mgr;
enum enum

View File

@ -229,7 +229,7 @@ bool CRenderFrame::ShowFullScreen(bool show, long style)
// Notice that wxID_HELP will be processed for the 'About' menu and the toolbar // Notice that wxID_HELP will be processed for the 'About' menu and the toolbar
// help button. // help button.
const wxEventType wxEVT_HOST_COMMAND = wxNewEventType(); wxDEFINE_EVENT(wxEVT_HOST_COMMAND, wxCommandEvent);
BEGIN_EVENT_TABLE(CFrame, CRenderFrame) BEGIN_EVENT_TABLE(CFrame, CRenderFrame)

View File

@ -292,4 +292,4 @@ enum
(wxObject*) nullptr \ (wxObject*) nullptr \
), ),
extern const wxEventType wxEVT_HOST_COMMAND; wxDECLARE_EVENT(wxEVT_HOST_COMMAND, wxCommandEvent);