mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
improved debugger - some meaningful icons would be nice :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@79 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
dc631ab91f
commit
6c4573932b
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="8.00"
|
Version="8,00"
|
||||||
Name="DebuggerWX"
|
Name="DebuggerWX"
|
||||||
ProjectGUID="{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
|
ProjectGUID="{4D3CD4C5-412B-4B49-9B1B-A68A2A129C77}"
|
||||||
RootNamespace="DebuggerWX"
|
RootNamespace="DebuggerWX"
|
||||||
@ -446,6 +446,22 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resources"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\resources\toolbar_add_breakpoint.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\resources\toolbar_add_memorycheck.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\resources\toolbar_delete.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\BreakPointDlg.cpp"
|
RelativePath=".\src\BreakPointDlg.cpp"
|
||||||
>
|
>
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(CBreakPointView, wxListCtrl)
|
BEGIN_EVENT_TABLE(CBreakPointView, wxListCtrl)
|
||||||
|
|
||||||
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
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)
|
||||||
|
@ -35,14 +35,14 @@ enum
|
|||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(CCodeView, wxControl)
|
BEGIN_EVENT_TABLE(CCodeView, wxControl)
|
||||||
EVT_ERASE_BACKGROUND(CCodeView::OnErase)
|
EVT_ERASE_BACKGROUND(CCodeView::OnErase)
|
||||||
EVT_PAINT(CCodeView::OnPaint)
|
EVT_PAINT(CCodeView::OnPaint)
|
||||||
EVT_LEFT_DOWN(CCodeView::OnMouseDown)
|
EVT_LEFT_DOWN(CCodeView::OnMouseDown)
|
||||||
EVT_LEFT_UP(CCodeView::OnMouseUpL)
|
EVT_LEFT_UP(CCodeView::OnMouseUpL)
|
||||||
EVT_MOTION(CCodeView::OnMouseMove)
|
EVT_MOTION(CCodeView::OnMouseMove)
|
||||||
EVT_RIGHT_DOWN(CCodeView::OnMouseDown)
|
EVT_RIGHT_DOWN(CCodeView::OnMouseDown)
|
||||||
EVT_RIGHT_UP(CCodeView::OnMouseUpR)
|
EVT_RIGHT_UP(CCodeView::OnMouseUpR)
|
||||||
EVT_MENU(-1, CCodeView::OnPopupMenu)
|
EVT_MENU(-1, CCodeView::OnPopupMenu)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
CCodeView::CCodeView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
CCodeView::CCodeView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
||||||
|
@ -28,12 +28,15 @@
|
|||||||
#include "wx/listctrl.h"
|
#include "wx/listctrl.h"
|
||||||
#include "wx/thread.h"
|
#include "wx/thread.h"
|
||||||
#include "wx/listctrl.h"
|
#include "wx/listctrl.h"
|
||||||
|
#include "wx/mstream.h"
|
||||||
|
|
||||||
#include "CodeWindow.h"
|
#include "CodeWindow.h"
|
||||||
#include "CodeView.h"
|
#include "CodeView.h"
|
||||||
#include "HW/CPU.h"
|
#include "HW/CPU.h"
|
||||||
#include "PowerPC/PowerPC.h"
|
#include "PowerPC/PowerPC.h"
|
||||||
#include "Host.h"
|
#include "Host.h"
|
||||||
|
|
||||||
|
|
||||||
#include "Debugger/PPCDebugInterface.h"
|
#include "Debugger/PPCDebugInterface.h"
|
||||||
#include "Debugger/Debugger_SymbolMap.h"
|
#include "Debugger/Debugger_SymbolMap.h"
|
||||||
|
|
||||||
@ -43,42 +46,15 @@
|
|||||||
// ugly that this lib included code from the main
|
// ugly that this lib included code from the main
|
||||||
#include "../../DolphinWX/src/Globals.h"
|
#include "../../DolphinWX/src/Globals.h"
|
||||||
|
|
||||||
class SymbolList
|
extern "C" {
|
||||||
: public wxListCtrl
|
#include "../resources/toolbar_add_breakpoint.c"
|
||||||
{
|
#include "../resources/toolbar_add_memorycheck.c"
|
||||||
wxString OnGetItemText(long item, long column)
|
#include "../resources/toolbar_delete.c"
|
||||||
{
|
}
|
||||||
return(_T("hello"));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT;
|
||||||
{
|
|
||||||
IDM_DEBUG_GO = 350,
|
|
||||||
IDM_STEP,
|
|
||||||
IDM_STEPOVER,
|
|
||||||
IDM_SKIP,
|
|
||||||
IDM_SETPC,
|
|
||||||
IDM_GOTOPC,
|
|
||||||
IDM_ADDRBOX,
|
|
||||||
IDM_CALLSTACKLIST,
|
|
||||||
IDM_SYMBOLLIST,
|
|
||||||
IDM_INTERPRETER,
|
|
||||||
IDM_DUALCORE,
|
|
||||||
IDM_LOGWINDOW,
|
|
||||||
IDM_REGISTERWINDOW,
|
|
||||||
IDM_BREAKPOINTWINDOW,
|
|
||||||
IDM_MEMORYWINDOW,
|
|
||||||
};
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
|
BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
|
||||||
EVT_BUTTON(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_BUTTON(IDM_STEP, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_BUTTON(IDM_STEPOVER, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_BUTTON(IDM_SKIP, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_BUTTON(IDM_SETPC, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_BUTTON(IDM_GOTOPC, CCodeWindow::OnCodeStep)
|
|
||||||
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
|
|
||||||
EVT_LISTBOX(IDM_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
|
EVT_LISTBOX(IDM_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
|
||||||
EVT_LISTBOX(IDM_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
|
EVT_LISTBOX(IDM_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
|
||||||
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
|
EVT_HOST_COMMAND(wxID_ANY, CCodeWindow::OnHostMessage)
|
||||||
@ -86,8 +62,23 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
|
|||||||
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
|
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
|
||||||
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
|
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
|
||||||
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow)
|
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow)
|
||||||
|
// toolbar
|
||||||
|
EVT_MENU(IDM_DEBUG_GO, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
|
||||||
|
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
#define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name))
|
||||||
|
inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
|
||||||
|
{
|
||||||
|
wxMemoryInputStream is(data, length);
|
||||||
|
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id,
|
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id,
|
||||||
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
|
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
|
||||||
@ -95,57 +86,16 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
|||||||
, m_RegisterWindow(NULL)
|
, m_RegisterWindow(NULL)
|
||||||
, m_logwindow(NULL)
|
, m_logwindow(NULL)
|
||||||
{
|
{
|
||||||
CreateMenu(_LocalCoreStartupParameter);
|
InitBitmaps();
|
||||||
|
|
||||||
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
CreateGUIControls(_LocalCoreStartupParameter);
|
||||||
wxBoxSizer* sizerRight = new wxBoxSizer(wxVERTICAL);
|
|
||||||
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
|
||||||
|
|
||||||
DebugInterface* di = new PPCDebugInterface();
|
// Create the toolbar
|
||||||
|
RecreateToolbar();
|
||||||
sizerLeft->Add(callstack = new wxListBox(this, IDM_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
|
|
||||||
sizerLeft->Add(symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
|
|
||||||
codeview = new CCodeView(di, this, wxID_ANY);
|
|
||||||
sizerBig->Add(sizerLeft, 2, wxEXPAND);
|
|
||||||
sizerBig->Add(codeview, 5, wxEXPAND);
|
|
||||||
sizerBig->Add(sizerRight, 0, wxEXPAND | wxALL, 3);
|
|
||||||
sizerRight->Add(buttonGo = new wxButton(this, IDM_DEBUG_GO, _T("&Go")));
|
|
||||||
sizerRight->Add(buttonStep = new wxButton(this, IDM_STEP, _T("&Step")));
|
|
||||||
sizerRight->Add(buttonStepOver = new wxButton(this, IDM_STEPOVER, _T("Step &Over")));
|
|
||||||
sizerRight->Add(buttonSkip = new wxButton(this, IDM_SKIP, _T("Ski&p")));
|
|
||||||
sizerRight->Add(buttonGotoPC = new wxButton(this, IDM_GOTOPC, _T("G&oto PC")));
|
|
||||||
sizerRight->Add(addrbox = new wxTextCtrl(this, IDM_ADDRBOX, _T("")));
|
|
||||||
sizerRight->Add(new wxButton(this, IDM_SETPC, _T("S&et PC")));
|
|
||||||
|
|
||||||
SetSizer(sizerBig);
|
|
||||||
|
|
||||||
sizerLeft->SetSizeHints(this);
|
|
||||||
sizerLeft->Fit(this);
|
|
||||||
sizerRight->SetSizeHints(this);
|
|
||||||
sizerRight->Fit(this);
|
|
||||||
sizerBig->SetSizeHints(this);
|
|
||||||
sizerBig->Fit(this);
|
|
||||||
|
|
||||||
sync_event.Init();
|
|
||||||
|
|
||||||
// additional dialogs
|
|
||||||
if (IsLoggingActivated())
|
|
||||||
{
|
|
||||||
m_logwindow = new CLogWindow(this);
|
|
||||||
m_logwindow->Show(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_RegisterWindow = new CRegisterWindow(this);
|
|
||||||
m_RegisterWindow->Show(true);
|
|
||||||
|
|
||||||
m_BreakpointWindow = new CBreakPointWindow(this, this);
|
|
||||||
m_BreakpointWindow->Show(true);
|
|
||||||
|
|
||||||
m_MemoryWindow = new CMemoryWindow(this);
|
|
||||||
m_MemoryWindow->Show(true);
|
|
||||||
|
|
||||||
UpdateButtonStates();
|
UpdateButtonStates();
|
||||||
|
|
||||||
|
// load ini...
|
||||||
int x,y,w,h;
|
int x,y,w,h;
|
||||||
|
|
||||||
IniFile file;
|
IniFile file;
|
||||||
@ -192,6 +142,48 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
|
||||||
|
{
|
||||||
|
CreateMenu(_LocalCoreStartupParameter);
|
||||||
|
|
||||||
|
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
|
DebugInterface* di = new PPCDebugInterface();
|
||||||
|
|
||||||
|
sizerLeft->Add(callstack = new wxListBox(this, IDM_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
|
||||||
|
sizerLeft->Add(symbols = new wxListBox(this, IDM_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
|
||||||
|
codeview = new CCodeView(di, this, wxID_ANY);
|
||||||
|
sizerBig->Add(sizerLeft, 2, wxEXPAND);
|
||||||
|
sizerBig->Add(codeview, 5, wxEXPAND);
|
||||||
|
|
||||||
|
SetSizer(sizerBig);
|
||||||
|
|
||||||
|
sizerLeft->SetSizeHints(this);
|
||||||
|
sizerLeft->Fit(this);
|
||||||
|
sizerBig->SetSizeHints(this);
|
||||||
|
sizerBig->Fit(this);
|
||||||
|
|
||||||
|
sync_event.Init();
|
||||||
|
|
||||||
|
// additional dialogs
|
||||||
|
if (IsLoggingActivated())
|
||||||
|
{
|
||||||
|
m_logwindow = new CLogWindow(this);
|
||||||
|
m_logwindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_RegisterWindow = new CRegisterWindow(this);
|
||||||
|
m_RegisterWindow->Show(true);
|
||||||
|
|
||||||
|
m_BreakpointWindow = new CBreakPointWindow(this, this);
|
||||||
|
m_BreakpointWindow->Show(true);
|
||||||
|
|
||||||
|
m_MemoryWindow = new CMemoryWindow(this);
|
||||||
|
m_MemoryWindow->Show(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CCodeWindow::~CCodeWindow()
|
CCodeWindow::~CCodeWindow()
|
||||||
{
|
{
|
||||||
IniFile file;
|
IniFile file;
|
||||||
@ -352,7 +344,8 @@ void CCodeWindow::OnCodeStep(wxCommandEvent& event)
|
|||||||
|
|
||||||
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
|
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxString txt = addrbox->GetValue();
|
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);
|
||||||
|
wxString txt = pAddrCtrl->GetValue();
|
||||||
|
|
||||||
if (txt.size() == 8)
|
if (txt.size() == 8)
|
||||||
{
|
{
|
||||||
@ -417,30 +410,31 @@ void CCodeWindow::NotifyMapLoaded()
|
|||||||
|
|
||||||
void CCodeWindow::UpdateButtonStates()
|
void CCodeWindow::UpdateButtonStates()
|
||||||
{
|
{
|
||||||
|
wxToolBarBase* toolBar = GetToolBar();
|
||||||
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
||||||
{
|
{
|
||||||
buttonGo->Enable(false);
|
toolBar->EnableTool(IDM_DEBUG_GO, false);
|
||||||
buttonStep->Enable(false);
|
toolBar->EnableTool(IDM_STEP, false);
|
||||||
buttonStepOver->Enable(false);
|
toolBar->EnableTool(IDM_STEPOVER, false);
|
||||||
buttonSkip->Enable(false);
|
toolBar->EnableTool(IDM_SKIP, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!CCPU::IsStepping())
|
if (!CCPU::IsStepping())
|
||||||
{
|
{
|
||||||
buttonGo->SetLabel(_T("&Pause"));
|
toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Pause"));
|
||||||
buttonGo->Enable(true);
|
toolBar->EnableTool(IDM_DEBUG_GO, true);
|
||||||
buttonStep->Enable(false);
|
toolBar->EnableTool(IDM_STEP, false);
|
||||||
buttonStepOver->Enable(false);
|
toolBar->EnableTool(IDM_STEPOVER, false);
|
||||||
buttonSkip->Enable(false);
|
toolBar->EnableTool(IDM_SKIP, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buttonGo->SetLabel(_T("&Go"));
|
toolBar->SetToolShortHelp(IDM_DEBUG_GO, _T("&Go"));
|
||||||
buttonGo->Enable(true);
|
toolBar->EnableTool(IDM_DEBUG_GO, true);
|
||||||
buttonStep->Enable(true);
|
toolBar->EnableTool(IDM_STEP, true);
|
||||||
buttonStepOver->Enable(true);
|
toolBar->EnableTool(IDM_STEPOVER, true);
|
||||||
buttonSkip->Enable(true);
|
toolBar->EnableTool(IDM_SKIP, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -624,4 +618,58 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
|
||||||
|
{
|
||||||
|
int w = m_Bitmaps[Toolbar_DebugGo].GetWidth(),
|
||||||
|
h = m_Bitmaps[Toolbar_DebugGo].GetHeight();
|
||||||
|
|
||||||
|
toolBar->SetToolBitmapSize(wxSize(w, h));
|
||||||
|
toolBar->AddTool(IDM_DEBUG_GO, _T("Go"), m_Bitmaps[Toolbar_DebugGo], _T("Delete the selected BreakPoint or MemoryCheck"));
|
||||||
|
toolBar->AddTool(IDM_STEP, _T("Step"), m_Bitmaps[Toolbar_Step], _T("Add BreakPoint..."));
|
||||||
|
toolBar->AddTool(IDM_STEPOVER, _T("Step Over"), m_Bitmaps[Toolbar_StepOver], _T("Add BreakPoint..."));
|
||||||
|
toolBar->AddTool(IDM_SKIP, _T("Skip"), m_Bitmaps[Toolbar_Skip], _T("Add BreakPoint..."));
|
||||||
|
toolBar->AddSeparator();
|
||||||
|
toolBar->AddTool(IDM_GOTOPC, _T("Goto PC"), m_Bitmaps[Toolbar_GotoPC], _T("Add BreakPoint..."));
|
||||||
|
toolBar->AddTool(IDM_SETPC, _T("Set PC"), m_Bitmaps[Toolbar_SetPC], _T("Add BreakPoint..."));
|
||||||
|
toolBar->AddSeparator();
|
||||||
|
toolBar->AddControl(new wxTextCtrl(toolBar, IDM_ADDRBOX, _T("")));
|
||||||
|
|
||||||
|
// after adding the buttons to the toolbar, must call Realize() to reflect
|
||||||
|
// the changes
|
||||||
|
toolBar->Realize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CCodeWindow::RecreateToolbar()
|
||||||
|
{
|
||||||
|
// delete and recreate the toolbar
|
||||||
|
wxToolBarBase* toolBar = GetToolBar();
|
||||||
|
delete toolBar;
|
||||||
|
SetToolBar(NULL);
|
||||||
|
|
||||||
|
long style = TOOLBAR_STYLE;
|
||||||
|
style &= ~(wxTB_HORIZONTAL | wxTB_VERTICAL | wxTB_BOTTOM | wxTB_RIGHT | wxTB_HORZ_LAYOUT | wxTB_TOP);
|
||||||
|
wxToolBar* theToolBar = CreateToolBar(style, ID_TOOLBAR);
|
||||||
|
|
||||||
|
PopulateToolbar(theToolBar);
|
||||||
|
SetToolBar(theToolBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CCodeWindow::InitBitmaps()
|
||||||
|
{
|
||||||
|
// load original size 48x48
|
||||||
|
m_Bitmaps[Toolbar_DebugGo] = wxGetBitmapFromMemory(toolbar_delete_png);
|
||||||
|
m_Bitmaps[Toolbar_Step] = wxGetBitmapFromMemory(toolbar_add_breakpoint_png);
|
||||||
|
m_Bitmaps[Toolbar_StepOver] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
||||||
|
m_Bitmaps[Toolbar_Skip] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
||||||
|
m_Bitmaps[Toolbar_GotoPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
||||||
|
m_Bitmaps[Toolbar_SetPC] = wxGetBitmapFromMemory(toolbar_add_memcheck_png);
|
||||||
|
|
||||||
|
|
||||||
|
// scale to 16x16 for toolbar
|
||||||
|
for (size_t n = Toolbar_DebugGo; n < Bitmaps_max; n++)
|
||||||
|
{
|
||||||
|
m_Bitmaps[n] = wxBitmap(m_Bitmaps[n].ConvertToImage().Scale(16, 16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -56,6 +56,37 @@ class CCodeWindow
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ID_TOOLBAR = 500,
|
||||||
|
IDM_DEBUG_GO,
|
||||||
|
IDM_STEP,
|
||||||
|
IDM_STEPOVER,
|
||||||
|
IDM_SKIP,
|
||||||
|
IDM_SETPC,
|
||||||
|
IDM_GOTOPC,
|
||||||
|
IDM_ADDRBOX,
|
||||||
|
IDM_CALLSTACKLIST,
|
||||||
|
IDM_SYMBOLLIST,
|
||||||
|
IDM_INTERPRETER,
|
||||||
|
IDM_DUALCORE,
|
||||||
|
IDM_LOGWINDOW,
|
||||||
|
IDM_REGISTERWINDOW,
|
||||||
|
IDM_BREAKPOINTWINDOW,
|
||||||
|
IDM_MEMORYWINDOW,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
Toolbar_DebugGo,
|
||||||
|
Toolbar_Step,
|
||||||
|
Toolbar_StepOver,
|
||||||
|
Toolbar_Skip,
|
||||||
|
Toolbar_GotoPC,
|
||||||
|
Toolbar_SetPC,
|
||||||
|
Bitmaps_max
|
||||||
|
};
|
||||||
|
|
||||||
// sub dialogs
|
// sub dialogs
|
||||||
CLogWindow* m_logwindow;
|
CLogWindow* m_logwindow;
|
||||||
CRegisterWindow* m_RegisterWindow;
|
CRegisterWindow* m_RegisterWindow;
|
||||||
@ -67,13 +98,8 @@ class CCodeWindow
|
|||||||
wxListBox* symbols;
|
wxListBox* symbols;
|
||||||
Common::Event sync_event;
|
Common::Event sync_event;
|
||||||
|
|
||||||
wxButton* buttonGo;
|
wxBitmap m_Bitmaps[Bitmaps_max];
|
||||||
wxButton* buttonStep;
|
|
||||||
wxButton* buttonStepOver;
|
|
||||||
wxButton* buttonSkip;
|
|
||||||
wxButton* buttonGotoPC;
|
|
||||||
|
|
||||||
wxTextCtrl* addrbox;
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
void OnSymbolListChange(wxCommandEvent& event);
|
void OnSymbolListChange(wxCommandEvent& event);
|
||||||
@ -90,6 +116,11 @@ class CCodeWindow
|
|||||||
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter);
|
void CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter);
|
||||||
|
|
||||||
void UpdateButtonStates();
|
void UpdateButtonStates();
|
||||||
|
|
||||||
|
void RecreateToolbar();
|
||||||
|
void PopulateToolbar(wxToolBar* toolBar);
|
||||||
|
void InitBitmaps();
|
||||||
|
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*CODEWINDOW_*/
|
#endif /*CODEWINDOW_*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user