change how the "toolbar" of bp window is handled -> works correctly in release build.

code is still ugly, so if you feel like writing a shiny debugger...

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7249 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2011-02-25 23:15:53 +00:00
parent 992f8be5b0
commit 19524a8bb7
5 changed files with 83 additions and 120 deletions

View File

@ -26,14 +26,8 @@
#include "PowerPC/PowerPC.h"
#include "HW/Memmap.h"
extern "C" {
#include "../../resources/toolbar_add_breakpoint.c"
#include "../../resources/toolbar_add_memorycheck.c"
#include "../../resources/toolbar_debugger_delete.c"
}
CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl(parent, id, pos, size, style)
{
SetFont(DebuggerFont);
@ -41,7 +35,6 @@ CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id, const wx
Refresh();
}
void CBreakPointView::Update()
{
ClearAll();
@ -129,45 +122,3 @@ void CBreakPointView::DeleteCurrentSelection()
Update();
}
}
CBreakPointBar::CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
: wxListCtrl((wxWindow*)parent, id, pos, size, style)
{
BPWindow = parent;
SetBackgroundColour(wxColour(0x555555));
SetForegroundColour(wxColour(0xffffff));
// 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]);
SetImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL);
PopulateBar();
}
void CBreakPointBar::PopulateBar()
{
InsertItem(IDM_DELETE, _("Delete"), 0);
InsertItem(IDM_CLEAR, _("Clear"), 0);
InsertItem(IDM_ADD_BREAKPOINT, _("+BP"), 1);
// just add memory breakpoints if you can use them
if (Memory::AreMemoryBreakpointsActivated())
InsertItem(IDM_ADD_MEMORYCHECK, _("+MC"), 2);
InsertItem(IDM_SAVEALL, _("Load"));
InsertItem(IDM_SAVEALL, _("Save"));
}