Make the break point window toolbar a real toolbar, and general debugger gui cleanup.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7263 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2011-02-27 23:03:08 +00:00
parent e926b28480
commit 50c2f61d24
8 changed files with 191 additions and 255 deletions

View File

@ -15,57 +15,47 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <wx/wx.h>
#include "Common.h"
#include "Host.h"
#include "BreakpointDlg.h"
//#include "Host.h"
#include "StringUtil.h"
#include "PowerPC/PowerPC.h"
#include "BreakpointWindow.h"
#include "BreakpointDlg.h"
BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog)
EVT_CLOSE(BreakPointDlg::OnClose)
EVT_BUTTON(ID_OK, BreakPointDlg::OnOK)
EVT_BUTTON(ID_CANCEL, BreakPointDlg::OnCancel)
EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK)
EVT_BUTTON(wxID_CANCEL, BreakPointDlg::OnCancel)
END_EVENT_TABLE()
class CBreakPointWindow;
BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
BreakPointDlg::BreakPointDlg(CBreakPointWindow *_Parent)
: wxDialog(_Parent, wxID_ANY, wxT("BreakPoint"), wxDefaultPosition, wxDefaultSize)
, Parent(_Parent)
{
CreateGUIControls();
m_pEditAddress = new wxTextCtrl(this, wxID_ANY, wxT("80000000"));
wxButton *m_pButtonOK = new wxButton(this, wxID_OK, wxT("OK"));
wxButton *m_pButtonCancel = new wxButton(this, wxID_CANCEL, wxT("Cancel"));
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->AddStretchSpacer();
sButtons->Add(m_pButtonCancel, 0);
sButtons->Add(m_pButtonOK, 0);
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
sMainSizer->Add(m_pEditAddress, 0, wxEXPAND | wxALL, 5);
sMainSizer->Add(sButtons, 0, wxALL, 5);
SetSizer(sMainSizer);
Layout();
Fit();
}
BreakPointDlg::~BreakPointDlg()
{
}
void BreakPointDlg::CreateGUIControls()
{
SetIcon(wxNullIcon);
SetSize(8,8,279,121);
Center();
m_pButtonOK = new wxButton(this, ID_OK, wxT("OK"), wxPoint(192,64), wxSize(73,25), 0, wxDefaultValidator, wxT("OK"));
m_pButtonCancel = new wxButton(this, ID_CANCEL, _("Cancel"), wxPoint(112,64), wxSize(73,25), 0, wxDefaultValidator, _("Cancel"));
m_pEditAddress = new wxTextCtrl(this, ID_ADDRESS, wxT("80000000"), wxPoint(56,24), wxSize(197,20), 0, wxDefaultValidator, wxT("WxEdit1"));
}
void BreakPointDlg::OnClose(wxCloseEvent& /*event*/)
void BreakPointDlg::OnClose(wxCloseEvent& WXUNUSED(event))
{
EndModal(wxID_CLOSE);
Destroy();
}
void BreakPointDlg::OnOK(wxCommandEvent& /*event*/)
void BreakPointDlg::OnOK(wxCommandEvent& WXUNUSED(event))
{
wxString AddressString = m_pEditAddress->GetLineText(0);
u32 Address = 0;
@ -76,9 +66,11 @@ void BreakPointDlg::OnOK(wxCommandEvent& /*event*/)
//Host_UpdateBreakPointView();
Close();
}
else
PanicAlert("The address %s is invalid.", (const char *)AddressString.ToUTF8());
}
void BreakPointDlg::OnCancel(wxCommandEvent& /*event*/)
void BreakPointDlg::OnCancel(wxCommandEvent& WXUNUSED(event))
{
Close();
}

View File

@ -20,47 +20,24 @@
#include <wx/wx.h>
#include <wx/dialog.h>
#include <wx/stattext.h>
#include <wx/button.h>
#include <wx/textctrl.h>
#include <wx/statbox.h>
class CBreakPointWindow;
class BreakPointDlg : public wxDialog
{
private:
DECLARE_EVENT_TABLE();
public:
BreakPointDlg(CBreakPointWindow *, wxWindow *parent, wxWindowID id = 1, const wxString &title = _("BreakPoint"),
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX);
virtual ~BreakPointDlg();
BreakPointDlg(CBreakPointWindow *_Parent);
private:
CBreakPointWindow *Parent;
wxButton *m_pButtonOK;
wxButton *m_pButtonCancel;
wxTextCtrl *m_pEditAddress;
private:
void OnClose(wxCloseEvent& WXUNUSED(event));
void OnCancel(wxCommandEvent& WXUNUSED(event));
void OnOK(wxCommandEvent& WXUNUSED(event));
enum
{
ID_WXSTATICTEXT1 = 1006,
ID_OK = 1005,
ID_CANCEL = 1004,
ID_ADDRESS = 1003,
ID_WXSTATICBOX1 = 1001,
};
private:
void CreateGUIControls();
void OnClose(wxCloseEvent& event);
void OnCancel(wxCommandEvent& event);
void OnOK(wxCommandEvent& event);
DECLARE_EVENT_TABLE();
};
#endif

View File

@ -16,8 +16,6 @@
// http://code.google.com/p/dolphin-emu/
#include <wx/wx.h>
#include <wx/mstream.h>
#include <wx/imaglist.h>
#include "BreakpointView.h"
#include "DebuggerUIUtil.h"
@ -26,12 +24,11 @@
#include "PowerPC/PowerPC.h"
#include "HW/Memmap.h"
CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style)
CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id)
: wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING)
{
SetFont(DebuggerFont);
Refresh();
}
@ -39,11 +36,11 @@ void CBreakPointView::Update()
{
ClearAll();
InsertColumn(0, _("Active"), wxLIST_FORMAT_LEFT, 50);
InsertColumn(1, _("Type"), wxLIST_FORMAT_LEFT, 50);
InsertColumn(2, _("Function"), wxLIST_FORMAT_CENTER, 200);
InsertColumn(3, _("Address"), wxLIST_FORMAT_LEFT, 100);
InsertColumn(4, _("Flags"), wxLIST_FORMAT_CENTER, 100);
InsertColumn(0, wxT("Active"));
InsertColumn(1, wxT("Type"));
InsertColumn(2, wxT("Function"));
InsertColumn(3, wxT("Address"));
InsertColumn(4, wxT("Flags"));
char szBuffer[64];
const BreakPoints::TBreakPoints& rBreakPoints = PowerPC::breakpoints.GetBreakPoints();
@ -105,9 +102,6 @@ void CBreakPointView::Update()
SetItemData(Item, rMemCheck.StartAddress);
}
SetColumnWidth(2, -1);
SetColumnWidth(3, -1);
Refresh();
}

View File

@ -25,8 +25,7 @@
class CBreakPointView : public wxListCtrl
{
public:
CBreakPointView(wxWindow* parent, const wxWindowID id, const wxPoint& pos,
const wxSize& size, long style);
CBreakPointView(wxWindow* parent, const wxWindowID id);
void Update();
void DeleteCurrentSelection();

View File

@ -15,7 +15,6 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <wx/wx.h>
#include <wx/imaglist.h>
#include "BreakpointView.h"
@ -33,115 +32,116 @@ extern "C" {
#include "../../resources/toolbar_debugger_delete.c"
}
#include <map>
typedef void (CBreakPointWindow::*toolbar_func)();
typedef std::map<long, toolbar_func> toolbar_m;
typedef std::pair<long, toolbar_func> toolbar_p;
toolbar_m toolbar_map;
#define _connect_macro_(id, handler) \
Connect(id, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(handler), (wxObject*)0, (wxEvtHandler*)parent)
class CBreakPointBar : public wxListCtrl
class CBreakPointBar : public wxAuiToolBar
{
public:
CBreakPointBar(wxWindow* parent, const wxWindowID id)
: wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
{
SetToolBitmapSize(wxSize(24, 24));
m_Bitmaps[Toolbar_Delete] =
wxBitmap(wxGetBitmapFromMemory(toolbar_delete_png).ConvertToImage().Rescale(24, 24));
m_Bitmaps[Toolbar_Add_BP] =
wxBitmap(wxGetBitmapFromMemory(toolbar_add_breakpoint_png).ConvertToImage().Rescale(24, 24));
m_Bitmaps[Toolbar_Add_MC] =
wxBitmap(wxGetBitmapFromMemory(toolbar_add_memcheck_png).ConvertToImage().Rescale(24, 24));
AddTool(ID_DELETE, wxT("Delete"), m_Bitmaps[Toolbar_Delete]);
_connect_macro_(ID_DELETE, CBreakPointWindow::OnDelete);
AddTool(ID_CLEAR, wxT("Clear"), m_Bitmaps[Toolbar_Delete]);
_connect_macro_(ID_CLEAR, CBreakPointWindow::OnClear);
AddTool(ID_ADDBP, wxT("+BP"), m_Bitmaps[Toolbar_Add_BP]);
_connect_macro_(ID_ADDBP, CBreakPointWindow::OnAddBreakPoint);
// Add memory breakpoints if you can use them
if (Memory::AreMemoryBreakpointsActivated())
{
AddTool(ID_ADDMC, wxT("+MC"), m_Bitmaps[Toolbar_Add_MC]);
_connect_macro_(ID_ADDMC, CBreakPointWindow::OnAddMemoryCheck);
}
AddTool(ID_LOAD, wxT("Load"), m_Bitmaps[Toolbar_Delete]);
_connect_macro_(ID_LOAD, CBreakPointWindow::LoadAll);
AddTool(ID_SAVE, wxT("Save"), m_Bitmaps[Toolbar_Delete]);
_connect_macro_(ID_SAVE, CBreakPointWindow::Event_SaveAll);
}
private:
enum
{
Toolbar_Delete,
Toolbar_Add_BP,
Toolbar_Add_MC,
Bitmaps_max
Num_Bitmaps
};
wxBitmap m_Bitmaps[Bitmaps_max];
public:
CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl((wxWindow*)parent, id, pos, size, style)
enum
{
SetBackgroundColour(wxColour(0x555555));
SetForegroundColour(wxColour(0xffffff));
ID_DELETE = 2000,
ID_CLEAR,
ID_ADDBP,
ID_ADDMC,
ID_LOAD,
ID_SAVE
};
// load original size 48x48
wxMemoryInputStream st1(toolbar_delete_png, sizeof(toolbar_delete_png));
wxMemoryInputStream st2(toolbar_add_breakpoint_png, sizeof(toolbar_add_breakpoint_png));
wxMemoryInputStream st3(toolbar_add_memcheck_png, sizeof(toolbar_add_memcheck_png));
m_Bitmaps[Toolbar_Delete] = wxBitmap(wxImage(st1, wxBITMAP_TYPE_ANY, -1).Rescale(24,24), -1);
m_Bitmaps[Toolbar_Add_BP] = wxBitmap(wxImage(st2, wxBITMAP_TYPE_ANY, -1).Rescale(24,24), -1);
m_Bitmaps[Toolbar_Add_MC] = wxBitmap(wxImage(st3, wxBITMAP_TYPE_ANY, -1).Rescale(24,24), -1);
m_imageListNormal = new wxImageList(24, 24);
m_imageListNormal->Add(m_Bitmaps[Toolbar_Delete]);
m_imageListNormal->Add(m_Bitmaps[Toolbar_Add_BP]);
m_imageListNormal->Add(m_Bitmaps[Toolbar_Add_MC]);
AssignImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL);
toolbar_map.insert(toolbar_p(InsertItem(0, _("Delete"), 0), &CBreakPointWindow::OnDelete));
toolbar_map.insert(toolbar_p(InsertItem(1, _("Clear"), 0), &CBreakPointWindow::OnClear));
toolbar_map.insert(toolbar_p(InsertItem(2, _("+BP"), 1), &CBreakPointWindow::OnAddBreakPoint));
// just add memory breakpoints if you can use them
if (Memory::AreMemoryBreakpointsActivated())
{
toolbar_map.insert(toolbar_p(InsertItem(3, _("+MC"), 2), &CBreakPointWindow::OnAddMemoryCheck));
toolbar_map.insert(toolbar_p(InsertItem(4, _("Load"), 0), &CBreakPointWindow::LoadAll));
toolbar_map.insert(toolbar_p(InsertItem(5, _("Save"), 0), &CBreakPointWindow::SaveAll));
}
else
{
toolbar_map.insert(toolbar_p(InsertItem(3, _("Load"), 0), &CBreakPointWindow::LoadAll));
toolbar_map.insert(toolbar_p(InsertItem(4, _("Save"), 0), &CBreakPointWindow::SaveAll));
}
}
wxBitmap m_Bitmaps[Num_Bitmaps];
};
BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_CLOSE(CBreakPointWindow::OnClose)
EVT_LIST_ITEM_SELECTED(ID_BPS, CBreakPointWindow::OnSelectBP)
EVT_LIST_ITEM_RIGHT_CLICK(ID_BPS, CBreakPointWindow::OnRightClick)
EVT_LIST_ITEM_SELECTED(ID_TOOLBAR, CBreakPointWindow::OnSelectToolbar)
END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent,
wxWindowID id, const wxString& title, const wxPoint& position,
const wxSize& size, long style)
: wxPanel(parent, id, position, size, style, title)
, m_BreakPointListView(NULL)
, m_pCodeWindow(_pCodeWindow)
{
CreateGUIControls();
}
void CBreakPointWindow::OnClose(wxCloseEvent& WXUNUSED(event))
CBreakPointWindow::~CBreakPointWindow()
{
m_mgr.UnInit();
}
void CBreakPointWindow::OnClose(wxCloseEvent& event)
{
SaveAll();
event.Skip();
}
void CBreakPointWindow::CreateGUIControls()
{
m_BreakPointBar = new CBreakPointBar(this, ID_TOOLBAR, wxDefaultPosition, wxSize(0, 55),
wxLC_ICON | wxSUNKEN_BORDER | wxLC_SINGLE_SEL);
m_BreakPointListView = new CBreakPointView(this, ID_BPS, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING);
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
wxBoxSizer* sizerH = new wxBoxSizer(wxVERTICAL);
sizerH->Add(m_BreakPointBar, 0, wxALL | wxEXPAND);
sizerH->Add(m_BreakPointListView, 1, wxEXPAND);
m_BreakPointListView = new CBreakPointView(this, ID_BPS);
SetSizer(sizerH);
}
void CBreakPointWindow::OnSelectToolbar(wxListEvent& event)
{
(this->*toolbar_map[event.GetItem().GetId()])();
m_BreakPointBar->SetItemState(event.GetItem().GetId(), 0, wxLIST_STATE_SELECTED);
m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top().
LeftDockable(false).RightDockable(false).BottomDockable(false).Floatable(false));
m_mgr.AddPane(m_BreakPointListView, wxAuiPaneInfo().CenterPane());
m_mgr.Update();
}
void CBreakPointWindow::NotifyUpdate()
{
if (m_BreakPointListView)
m_BreakPointListView->Update();
}
void CBreakPointWindow::OnDelete()
void CBreakPointWindow::OnDelete(wxCommandEvent& WXUNUSED(event))
{
if (m_BreakPointListView)
m_BreakPointListView->DeleteCurrentSelection();
}
@ -157,31 +157,31 @@ void CBreakPointWindow::OnSelectBP(wxListEvent& event)
}
}
// modify
void CBreakPointWindow::OnRightClick(wxListEvent& event)
{
}
// Clear all breakpoints and memchecks
void CBreakPointWindow::OnClear()
void CBreakPointWindow::OnClear(wxCommandEvent& WXUNUSED(event))
{
PowerPC::breakpoints.Clear();
PowerPC::memchecks.Clear();
NotifyUpdate();
}
void CBreakPointWindow::OnAddBreakPoint()
void CBreakPointWindow::OnAddBreakPoint(wxCommandEvent& WXUNUSED(event))
{
BreakPointDlg bpDlg(this, this);
BreakPointDlg bpDlg(this);
bpDlg.ShowModal();
}
void CBreakPointWindow::OnAddMemoryCheck()
void CBreakPointWindow::OnAddMemoryCheck(wxCommandEvent& WXUNUSED(event))
{
MemoryCheckDlg memDlg(this);
memDlg.ShowModal();
}
void CBreakPointWindow::Event_SaveAll(wxCommandEvent& WXUNUSED(event))
{
SaveAll();
}
void CBreakPointWindow::SaveAll()
{
// simply dump all to bp/mc files in a way we can read again
@ -194,7 +194,7 @@ void CBreakPointWindow::SaveAll()
}
}
void CBreakPointWindow::LoadAll()
void CBreakPointWindow::LoadAll(wxCommandEvent& WXUNUSED(event))
{
IniFile ini;
BreakPoints::TBreakPointsStr newbps;

View File

@ -18,51 +18,52 @@
#ifndef __BREAKPOINTWINDOW_h__
#define __BREAKPOINTWINDOW_h__
#include <wx/wx.h>
#include <wx/aui/aui.h>
class CBreakPointView;
class CBreakPointBar;
class CCodeWindow;
class wxListEvent;
class IniFile;
class CBreakPointWindow
: public wxPanel
class CBreakPointWindow : public wxPanel
{
public:
CBreakPointWindow(CCodeWindow* _pCodeWindow,
wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxString& title = _("Breakpoints"),
const wxString& title = wxT("Breakpoints"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxBORDER_NONE);
~CBreakPointWindow();
void NotifyUpdate();
void OnDelete();
void OnClear();
void OnAddBreakPoint();
void OnAddMemoryCheck();
void OnDelete(wxCommandEvent& WXUNUSED(event));
void OnClear(wxCommandEvent& WXUNUSED(event));
void OnAddBreakPoint(wxCommandEvent& WXUNUSED(event));
void OnAddMemoryCheck(wxCommandEvent& WXUNUSED(event));
void Event_SaveAll(wxCommandEvent& WXUNUSED(event));
void SaveAll();
void LoadAll();
void LoadAll(wxCommandEvent& WXUNUSED(event));
private:
DECLARE_EVENT_TABLE();
enum
{
ID_TOOLBAR = 501,
ID_BPS = 1002,
};
CBreakPointBar* m_BreakPointBar;
wxAuiManager m_mgr;
CBreakPointView* m_BreakPointListView;
CCodeWindow* m_pCodeWindow;
void OnClose(wxCloseEvent& event);
void OnSelectToolbar(wxListEvent& event);
void OnSelectBP(wxListEvent& event);
void OnRightClick(wxListEvent& event);
void CreateGUIControls();
};

View File

@ -21,60 +21,67 @@
#include "Host.h"
#include "PowerPC/PowerPC.h"
#define TEXT_BOX(text) new wxStaticText(this, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize)
BEGIN_EVENT_TABLE(MemoryCheckDlg,wxDialog)
EVT_CLOSE(MemoryCheckDlg::OnClose)
EVT_BUTTON(ID_OK, MemoryCheckDlg::OnOK)
EVT_BUTTON(ID_CANCEL, MemoryCheckDlg::OnCancel)
EVT_BUTTON(wxID_OK, MemoryCheckDlg::OnOK)
EVT_BUTTON(wxID_CANCEL, MemoryCheckDlg::OnCancel)
END_EVENT_TABLE()
MemoryCheckDlg::MemoryCheckDlg(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
MemoryCheckDlg::MemoryCheckDlg(wxWindow *parent)
: wxDialog(parent, wxID_ANY, _("Memory Check"), wxDefaultPosition, wxDefaultSize)
{
CreateGUIControls();
}
MemoryCheckDlg::~MemoryCheckDlg()
{
}
void MemoryCheckDlg::CreateGUIControls()
{
SetIcon(wxNullIcon);
SetSize(8,8,470,122);
Center();
m_pButtonCancel = new wxButton(this, ID_CANCEL, _("Cancel"), wxPoint(248,64), wxSize(73,25), 0, wxDefaultValidator, _("Cancel"));
m_pButtonOK = new wxButton(this, ID_OK, wxT("OK"), wxPoint(328,64), wxSize(73,25), 0, wxDefaultValidator, wxT("OK"));
m_pReadFlag = new wxCheckBox(this, ID_READ_FLAG, _("Read"), wxPoint(336,33), wxSize(57,15), 0, wxDefaultValidator, _("Read"));
m_pWriteFlag = new wxCheckBox(this, ID_WRITE_FLAG, _("Write"), wxPoint(336,16), wxSize(57,17), 0, wxDefaultValidator, wxT("WxCheckBox1"));
m_pEditStartAddress = new wxTextCtrl(this, wxID_ANY, wxT(""));
m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY, wxT(""));
m_pWriteFlag = new wxCheckBox(this, wxID_ANY, _("Write"));
m_pWriteFlag->SetValue(true);
m_log_flag = new wxCheckBox(this, ID_LOG_FLAG, _("Log"), wxPoint(420,16), wxSize(57,17), 0, wxDefaultValidator, wxT("WxCheckBox2"));
m_pReadFlag = new wxCheckBox(this, wxID_ANY, _("Read"));
m_log_flag = new wxCheckBox(this, wxID_ANY, _("Log"));
m_log_flag->SetValue(true);
m_break_flag = new wxCheckBox(this, ID_BREAK_FLAG, _("Break"), wxPoint(420,33), wxSize(57,15), 0, wxDefaultValidator, wxT("WxCheckBox2"));
m_break_flag = new wxCheckBox(this, wxID_ANY, _("Break"));
new wxStaticBox(this, ID_WXSTATICBOX2, _("Action"), wxPoint(328,0), wxSize(73,57));
wxStaticBoxSizer *sAddressRangeBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("Address Range"));
sAddressRangeBox->Add(TEXT_BOX("Start"), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sAddressRangeBox->Add(m_pEditStartAddress, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, 10);
sAddressRangeBox->Add(TEXT_BOX("End"), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
sAddressRangeBox->Add(m_pEditEndAddress, 1, wxALIGN_CENTER_VERTICAL);
new wxStaticText(this, ID_WXSTATICTEXT2, _("End"), wxPoint(168,24), wxDefaultSize, 0, wxT("WxStaticText2"));
wxStaticBoxSizer *sActionBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Action"));
sActionBox->Add(m_pWriteFlag);
sActionBox->Add(m_pReadFlag);
new wxStaticText(this, ID_WXSTATICTEXT1, _("Start"), wxPoint(8,24), wxDefaultSize, 0, wxT("WxStaticText1"));
wxBoxSizer* sFlags = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Flags"));
sFlags->Add(m_log_flag);
sFlags->Add(m_break_flag);
m_pEditStartAddress = new wxTextCtrl(this, ID_EDIT_START_ADDR, wxT(""), wxPoint(40,24), wxSize(109,20), 0, wxDefaultValidator, wxT("WxEdit1"));
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->AddStretchSpacer();
sButtons->Add(new wxButton(this, wxID_CANCEL, _("Cancel")));
sButtons->Add(new wxButton(this, wxID_OK, wxT("OK")));
m_pEditEndAddress = new wxTextCtrl(this, ID_EDIT_END_ADDRESS, wxT(""), wxPoint(200,24), wxSize(109,20), 0, wxDefaultValidator, wxT("WxEdit2"));
wxBoxSizer *sControls = new wxBoxSizer(wxHORIZONTAL);
sControls->Add(sAddressRangeBox, 0, wxEXPAND);
sControls->Add(sActionBox, 0, wxEXPAND);
sControls->Add(sFlags, 0, wxEXPAND);
new wxStaticBox(this, ID_WXSTATICBOX1, _("Address Range"), wxPoint(0,0), wxSize(321,57));
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
sMainSizer->Add(sControls, 0, wxEXPAND | wxALL, 5);
sMainSizer->Add(sButtons, 0, wxEXPAND | wxALL, 5);
SetSizer(sMainSizer);
Layout();
Fit();
}
void MemoryCheckDlg::OnClose(wxCloseEvent& /*event*/)
void MemoryCheckDlg::OnClose(wxCloseEvent& WXUNUSED(event))
{
EndModal(wxID_CLOSE);
Destroy();
}
void MemoryCheckDlg::OnOK(wxCommandEvent& /*event*/)
void MemoryCheckDlg::OnOK(wxCommandEvent& WXUNUSED(event))
{
wxString StartAddressString = m_pEditStartAddress->GetLineText(0);
wxString EndAddressString = m_pEditEndAddress->GetLineText(0);
@ -109,7 +116,7 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& /*event*/)
}
}
void MemoryCheckDlg::OnCancel(wxCommandEvent& /*event*/)
void MemoryCheckDlg::OnCancel(wxCommandEvent& WXUNUSED(event))
{
Close();
}

View File

@ -19,29 +19,13 @@
#define __MEMORYCHECKDLG_h__
#include <wx/wx.h>
#include <wx/dialog.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/statbox.h>
#undef MemoryCheckDlg_STYLE
#define MemoryCheckDlg_STYLE wxCAPTION | wxSYSTEM_MENU | wxSTAY_ON_TOP | wxDIALOG_NO_PARENT | wxCLOSE_BOX
class MemoryCheckDlg : public wxDialog
{
private:
DECLARE_EVENT_TABLE();
public:
MemoryCheckDlg(wxWindow *parent, wxWindowID id = 1, const wxString &title = _("Memory Check"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = MemoryCheckDlg_STYLE);
virtual ~MemoryCheckDlg();
MemoryCheckDlg(wxWindow *parent);
private:
wxButton* m_pButtonCancel;
wxButton* m_pButtonOK;
wxCheckBox* m_pReadFlag;
wxCheckBox* m_pWriteFlag;
wxCheckBox* m_log_flag;
@ -49,29 +33,11 @@ class MemoryCheckDlg : public wxDialog
wxTextCtrl* m_pEditEndAddress;
wxTextCtrl* m_pEditStartAddress;
private:
void OnClose(wxCloseEvent& WXUNUSED(event));
void OnOK(wxCommandEvent& WXUNUSED(event));
void OnCancel(wxCommandEvent& WXUNUSED(event));
enum
{
ID_BREAK_FLAG = 1018,
ID_LOG_FLAG = 1017,
ID_CANCEL = 1016,
ID_OK = 1015,
ID_READ_FLAG = 1014,
ID_WRITE_FLAG = 1013,
ID_WXSTATICBOX2 = 1012,
ID_EDIT_END_ADDRESS = 1011,
ID_WXSTATICTEXT2 = 1010,
ID_WXSTATICTEXT1 = 1009,
ID_EDIT_START_ADDR = 1008,
ID_WXSTATICBOX1 = 1007,
};
private:
void OnClose(wxCloseEvent& event);
void OnOK(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event);
void CreateGUIControls();
DECLARE_EVENT_TABLE();
};
#endif