Merge pull request #6633 from aldelaro5/wx-debugger-icons
Wx: debugger icons
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
@ -35,20 +35,12 @@ public:
|
|||||||
: DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
|
: DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
|
||||||
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
|
||||||
{
|
{
|
||||||
wxSize bitmap_size = FromDIP(wxSize(24, 24));
|
InitializeThemedBitmaps();
|
||||||
SetToolBitmapSize(bitmap_size);
|
|
||||||
|
|
||||||
static const std::array<const char* const, Num_Bitmaps> image_names{
|
|
||||||
{"toolbar_debugger_delete", "toolbar_add_breakpoint", "toolbar_add_memorycheck"}};
|
|
||||||
for (std::size_t i = 0; i < image_names.size(); ++i)
|
|
||||||
m_Bitmaps[i] =
|
|
||||||
WxUtils::LoadScaledResourceBitmap(image_names[i], this, bitmap_size, wxDefaultSize,
|
|
||||||
WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);
|
|
||||||
|
|
||||||
AddTool(ID_DELETE, _("Delete"), m_Bitmaps[Toolbar_Delete]);
|
AddTool(ID_DELETE, _("Delete"), m_Bitmaps[Toolbar_Delete]);
|
||||||
Bind(wxEVT_TOOL, &CBreakPointWindow::OnDelete, parent, ID_DELETE);
|
Bind(wxEVT_TOOL, &CBreakPointWindow::OnDelete, parent, ID_DELETE);
|
||||||
|
|
||||||
AddTool(ID_CLEAR, _("Clear"), m_Bitmaps[Toolbar_Delete]);
|
AddTool(ID_CLEAR, _("Clear"), m_Bitmaps[Toolbar_Clear]);
|
||||||
Bind(wxEVT_TOOL, &CBreakPointWindow::OnClear, parent, ID_CLEAR);
|
Bind(wxEVT_TOOL, &CBreakPointWindow::OnClear, parent, ID_CLEAR);
|
||||||
|
|
||||||
AddTool(ID_ADDBP, "+BP", m_Bitmaps[Toolbar_Add_BP]);
|
AddTool(ID_ADDBP, "+BP", m_Bitmaps[Toolbar_Add_BP]);
|
||||||
@ -57,32 +49,64 @@ public:
|
|||||||
AddTool(ID_ADDMC, "+MBP", m_Bitmaps[Toolbar_Add_MC]);
|
AddTool(ID_ADDMC, "+MBP", m_Bitmaps[Toolbar_Add_MC]);
|
||||||
Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC);
|
Bind(wxEVT_TOOL, &CBreakPointWindow::OnAddMemoryCheck, parent, ID_ADDMC);
|
||||||
|
|
||||||
AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_Delete]);
|
AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_Load]);
|
||||||
Bind(wxEVT_TOOL, &CBreakPointWindow::Event_LoadAll, parent, ID_LOAD);
|
Bind(wxEVT_TOOL, &CBreakPointWindow::Event_LoadAll, parent, ID_LOAD);
|
||||||
|
|
||||||
AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_Delete]);
|
AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_Save]);
|
||||||
Bind(wxEVT_TOOL, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE);
|
Bind(wxEVT_TOOL, &CBreakPointWindow::Event_SaveAll, parent, ID_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReloadBitmaps()
|
||||||
|
{
|
||||||
|
Freeze();
|
||||||
|
|
||||||
|
InitializeThemedBitmaps();
|
||||||
|
for (int i = 0; i < ID_NUM; ++i)
|
||||||
|
SetToolBitmap(i, m_Bitmaps[i]);
|
||||||
|
|
||||||
|
Thaw();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
Toolbar_Delete,
|
Toolbar_Delete = 0,
|
||||||
|
Toolbar_Clear,
|
||||||
Toolbar_Add_BP,
|
Toolbar_Add_BP,
|
||||||
Toolbar_Add_MC,
|
Toolbar_Add_MC,
|
||||||
|
Toolbar_Load,
|
||||||
|
Toolbar_Save,
|
||||||
Num_Bitmaps
|
Num_Bitmaps
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ID_DELETE = 2000,
|
ID_DELETE = 0,
|
||||||
ID_CLEAR,
|
ID_CLEAR,
|
||||||
ID_ADDBP,
|
ID_ADDBP,
|
||||||
ID_ADDMC,
|
ID_ADDMC,
|
||||||
ID_LOAD,
|
ID_LOAD,
|
||||||
ID_SAVE
|
ID_SAVE,
|
||||||
|
ID_NUM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void InitializeThemedBitmaps()
|
||||||
|
{
|
||||||
|
wxSize bitmap_size = FromDIP(wxSize(24, 24));
|
||||||
|
SetToolBitmapSize(bitmap_size);
|
||||||
|
|
||||||
|
static const std::array<const char* const, Num_Bitmaps> m_image_names{
|
||||||
|
{"debugger_delete", "debugger_clear", "debugger_add_breakpoint", "debugger_add_memorycheck",
|
||||||
|
"debugger_load", "debugger_save"}};
|
||||||
|
|
||||||
|
for (std::size_t i = 0; i < m_image_names.size(); ++i)
|
||||||
|
{
|
||||||
|
m_Bitmaps[i] =
|
||||||
|
WxUtils::LoadScaledThemeBitmap(m_image_names[i], this, bitmap_size, wxDefaultSize,
|
||||||
|
WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxBitmap m_Bitmaps[Num_Bitmaps];
|
wxBitmap m_Bitmaps[Num_Bitmaps];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -97,13 +121,15 @@ CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent
|
|||||||
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_BreakPointListView->Bind(wxEVT_LIST_ITEM_SELECTED, &CBreakPointWindow::OnSelectBP, this);
|
||||||
|
|
||||||
m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo()
|
m_breakpointBar = new CBreakPointBar(this, wxID_ANY);
|
||||||
.ToolbarPane()
|
|
||||||
.Top()
|
m_mgr.AddPane(m_breakpointBar, wxAuiPaneInfo()
|
||||||
.LeftDockable(true)
|
.ToolbarPane()
|
||||||
.RightDockable(true)
|
.Top()
|
||||||
.BottomDockable(false)
|
.LeftDockable(true)
|
||||||
.Floatable(false));
|
.RightDockable(true)
|
||||||
|
.BottomDockable(false)
|
||||||
|
.Floatable(false));
|
||||||
m_mgr.AddPane(m_BreakPointListView, wxAuiPaneInfo().CenterPane());
|
m_mgr.AddPane(m_BreakPointListView, wxAuiPaneInfo().CenterPane());
|
||||||
m_mgr.Update();
|
m_mgr.Update();
|
||||||
}
|
}
|
||||||
@ -118,6 +144,11 @@ void CBreakPointWindow::NotifyUpdate()
|
|||||||
m_BreakPointListView->Repopulate();
|
m_BreakPointListView->Repopulate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBreakPointWindow::ReloadBitmaps()
|
||||||
|
{
|
||||||
|
m_breakpointBar->ReloadBitmaps();
|
||||||
|
}
|
||||||
|
|
||||||
void CBreakPointWindow::OnDelete(wxCommandEvent& WXUNUSED(event))
|
void CBreakPointWindow::OnDelete(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_BreakPointListView->DeleteCurrentSelection();
|
m_BreakPointListView->DeleteCurrentSelection();
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
class CBreakPointView;
|
class CBreakPointView;
|
||||||
class CCodeWindow;
|
class CCodeWindow;
|
||||||
class wxListEvent;
|
class wxListEvent;
|
||||||
|
class CBreakPointBar;
|
||||||
|
|
||||||
class CBreakPointWindow : public wxPanel
|
class CBreakPointWindow : public wxPanel
|
||||||
{
|
{
|
||||||
@ -23,6 +24,7 @@ public:
|
|||||||
void NotifyUpdate();
|
void NotifyUpdate();
|
||||||
void SaveAll();
|
void SaveAll();
|
||||||
void LoadAll();
|
void LoadAll();
|
||||||
|
void ReloadBitmaps();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class CBreakPointBar;
|
friend class CBreakPointBar;
|
||||||
@ -38,4 +40,5 @@ private:
|
|||||||
wxAuiManager m_mgr;
|
wxAuiManager m_mgr;
|
||||||
CBreakPointView* m_BreakPointListView;
|
CBreakPointView* m_BreakPointListView;
|
||||||
CCodeWindow* m_pCodeWindow;
|
CCodeWindow* m_pCodeWindow;
|
||||||
|
CBreakPointBar* m_breakpointBar;
|
||||||
};
|
};
|
||||||
|
@ -178,6 +178,13 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
|
|||||||
case IDM_UPDATE_JIT_PANE:
|
case IDM_UPDATE_JIT_PANE:
|
||||||
RequirePanel<CJitWindow>()->ViewAddr(codeview->GetSelection());
|
RequirePanel<CJitWindow>()->ViewAddr(codeview->GetSelection());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDM_RELOAD_THEME_BITMAPS:
|
||||||
|
if (HasPanel<CBreakPointWindow>())
|
||||||
|
GetPanel<CBreakPointWindow>()->ReloadBitmaps();
|
||||||
|
if (HasPanel<CWatchWindow>())
|
||||||
|
GetPanel<CWatchWindow>()->ReloadBitmaps();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,33 +25,57 @@ public:
|
|||||||
: DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
|
: DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
|
||||||
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
|
wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
|
||||||
{
|
{
|
||||||
wxSize bitmap_size = FromDIP(wxSize(16, 16));
|
InitialiseThemedBitmaps();
|
||||||
SetToolBitmapSize(bitmap_size);
|
|
||||||
|
|
||||||
m_Bitmaps[Toolbar_File] = WxUtils::LoadScaledResourceBitmap(
|
AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_Load]);
|
||||||
"toolbar_debugger_delete", this, bitmap_size, wxDefaultSize,
|
|
||||||
WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);
|
|
||||||
|
|
||||||
AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_File]);
|
|
||||||
Bind(wxEVT_TOOL, &CWatchWindow::Event_LoadAll, parent, ID_LOAD);
|
Bind(wxEVT_TOOL, &CWatchWindow::Event_LoadAll, parent, ID_LOAD);
|
||||||
|
|
||||||
AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_File]);
|
AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_Save]);
|
||||||
Bind(wxEVT_TOOL, &CWatchWindow::Event_SaveAll, parent, ID_SAVE);
|
Bind(wxEVT_TOOL, &CWatchWindow::Event_SaveAll, parent, ID_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReloadBitmaps()
|
||||||
|
{
|
||||||
|
Freeze();
|
||||||
|
|
||||||
|
InitialiseThemedBitmaps();
|
||||||
|
for (int i = 0; i < ID_NUM; ++i)
|
||||||
|
SetToolBitmap(i, m_Bitmaps[i]);
|
||||||
|
|
||||||
|
Thaw();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
Toolbar_File,
|
Toolbar_Load,
|
||||||
|
Toolbar_Save,
|
||||||
Num_Bitmaps
|
Num_Bitmaps
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ID_LOAD,
|
ID_LOAD = 0,
|
||||||
ID_SAVE
|
ID_SAVE,
|
||||||
|
ID_NUM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void InitialiseThemedBitmaps()
|
||||||
|
{
|
||||||
|
wxSize bitmap_size = FromDIP(wxSize(24, 24));
|
||||||
|
SetToolBitmapSize(bitmap_size);
|
||||||
|
|
||||||
|
static const std::array<const char* const, Num_Bitmaps> m_image_names{
|
||||||
|
{"debugger_load", "debugger_save"}};
|
||||||
|
|
||||||
|
for (std::size_t i = 0; i < m_image_names.size(); ++i)
|
||||||
|
{
|
||||||
|
m_Bitmaps[i] =
|
||||||
|
WxUtils::LoadScaledThemeBitmap(m_image_names[i], this, bitmap_size, wxDefaultSize,
|
||||||
|
WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxBitmap m_Bitmaps[Num_Bitmaps];
|
wxBitmap m_Bitmaps[Num_Bitmaps];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -64,13 +88,15 @@ CWatchWindow::CWatchWindow(wxWindow* parent, wxWindowID id, const wxPoint& posit
|
|||||||
|
|
||||||
m_GPRGridView = new CWatchView(this);
|
m_GPRGridView = new CWatchView(this);
|
||||||
|
|
||||||
m_mgr.AddPane(new CWatchToolbar(this, wxID_ANY), wxAuiPaneInfo()
|
m_watch_toolbar = new CWatchToolbar(this, wxID_ANY);
|
||||||
.ToolbarPane()
|
|
||||||
.Top()
|
m_mgr.AddPane(m_watch_toolbar, wxAuiPaneInfo()
|
||||||
.LeftDockable(true)
|
.ToolbarPane()
|
||||||
.RightDockable(true)
|
.Top()
|
||||||
.BottomDockable(false)
|
.LeftDockable(true)
|
||||||
.Floatable(false));
|
.RightDockable(true)
|
||||||
|
.BottomDockable(false)
|
||||||
|
.Floatable(false));
|
||||||
m_mgr.AddPane(m_GPRGridView, wxAuiPaneInfo().CenterPane());
|
m_mgr.AddPane(m_GPRGridView, wxAuiPaneInfo().CenterPane());
|
||||||
m_mgr.Update();
|
m_mgr.Update();
|
||||||
}
|
}
|
||||||
@ -124,3 +150,8 @@ void CWatchWindow::LoadAll()
|
|||||||
|
|
||||||
NotifyUpdate();
|
NotifyUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CWatchWindow::ReloadBitmaps()
|
||||||
|
{
|
||||||
|
m_watch_toolbar->ReloadBitmaps();
|
||||||
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
|
||||||
class CWatchView;
|
class CWatchView;
|
||||||
|
class CWatchToolbar;
|
||||||
|
|
||||||
class CWatchWindow : public wxPanel
|
class CWatchWindow : public wxPanel
|
||||||
{
|
{
|
||||||
@ -24,8 +25,10 @@ public:
|
|||||||
void SaveAll();
|
void SaveAll();
|
||||||
void Event_LoadAll(wxCommandEvent& WXUNUSED(event));
|
void Event_LoadAll(wxCommandEvent& WXUNUSED(event));
|
||||||
void LoadAll();
|
void LoadAll();
|
||||||
|
void ReloadBitmaps();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CWatchToolbar* m_watch_toolbar;
|
||||||
wxAuiManager m_mgr;
|
wxAuiManager m_mgr;
|
||||||
|
|
||||||
// Owned by wx. Deleted implicitly upon destruction.
|
// Owned by wx. Deleted implicitly upon destruction.
|
||||||
|
@ -1107,6 +1107,12 @@ void CFrame::OnReloadThemeBitmaps(wxCommandEvent& WXUNUSED(event))
|
|||||||
reload_event.SetEventObject(this);
|
reload_event.SetEventObject(this);
|
||||||
wxPostEvent(GetToolBar(), reload_event);
|
wxPostEvent(GetToolBar(), reload_event);
|
||||||
|
|
||||||
|
if (m_code_window)
|
||||||
|
{
|
||||||
|
wxCommandEvent evt(wxEVT_HOST_COMMAND, IDM_RELOAD_THEME_BITMAPS);
|
||||||
|
m_code_window->GetEventHandler()->AddPendingEvent(evt);
|
||||||
|
}
|
||||||
|
|
||||||
GameListRefresh();
|
GameListRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +305,7 @@ enum
|
|||||||
IDM_UPDATE_TITLE,
|
IDM_UPDATE_TITLE,
|
||||||
IDM_UPDATE_BREAKPOINTS,
|
IDM_UPDATE_BREAKPOINTS,
|
||||||
IDM_UPDATE_JIT_PANE,
|
IDM_UPDATE_JIT_PANE,
|
||||||
|
IDM_RELOAD_THEME_BITMAPS,
|
||||||
IDM_PANIC,
|
IDM_PANIC,
|
||||||
IDM_KEYSTATE,
|
IDM_KEYSTATE,
|
||||||
IDM_WINDOW_SIZE_REQUEST,
|
IDM_WINDOW_SIZE_REQUEST,
|
||||||
|
@ -98,13 +98,12 @@ void MainToolBar::InitializeThemeBitmaps()
|
|||||||
|
|
||||||
void MainToolBar::InitializeDebuggerBitmaps()
|
void MainToolBar::InitializeDebuggerBitmaps()
|
||||||
{
|
{
|
||||||
m_icon_bitmaps.insert(
|
m_icon_bitmaps.insert({{TOOLBAR_DEBUG_STEP, CreateBitmap("debugger_step_in")},
|
||||||
{{TOOLBAR_DEBUG_STEP, CreateDebuggerBitmap("toolbar_debugger_step")},
|
{TOOLBAR_DEBUG_STEPOVER, CreateBitmap("debugger_step_over")},
|
||||||
{TOOLBAR_DEBUG_STEPOVER, CreateDebuggerBitmap("toolbar_debugger_step_over")},
|
{TOOLBAR_DEBUG_STEPOUT, CreateBitmap("debugger_step_out")},
|
||||||
{TOOLBAR_DEBUG_STEPOUT, CreateDebuggerBitmap("toolbar_debugger_step_out")},
|
{TOOLBAR_DEBUG_SKIP, CreateBitmap("debugger_skip")},
|
||||||
{TOOLBAR_DEBUG_SKIP, CreateDebuggerBitmap("toolbar_debugger_skip")},
|
{TOOLBAR_DEBUG_GOTOPC, CreateBitmap("debugger_show_pc")},
|
||||||
{TOOLBAR_DEBUG_GOTOPC, CreateDebuggerBitmap("toolbar_debugger_goto_pc")},
|
{TOOLBAR_DEBUG_SETPC, CreateBitmap("debugger_set_pc")}});
|
||||||
{TOOLBAR_DEBUG_SETPC, CreateDebuggerBitmap("toolbar_debugger_set_pc")}});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap MainToolBar::CreateBitmap(const std::string& name) const
|
wxBitmap MainToolBar::CreateBitmap(const std::string& name) const
|
||||||
@ -112,14 +111,6 @@ wxBitmap MainToolBar::CreateBitmap(const std::string& name) const
|
|||||||
return WxUtils::LoadScaledThemeBitmap(name, this, GetToolBitmapSize());
|
return WxUtils::LoadScaledThemeBitmap(name, this, GetToolBitmapSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap MainToolBar::CreateDebuggerBitmap(const std::string& name) const
|
|
||||||
{
|
|
||||||
constexpr auto scale_flags = WxUtils::LSI_SCALE_DOWN | WxUtils::LSI_ALIGN_CENTER;
|
|
||||||
|
|
||||||
return WxUtils::LoadScaledResourceBitmap(name, this, GetToolBitmapSize(), wxDefaultSize,
|
|
||||||
scale_flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainToolBar::ApplyThemeBitmaps()
|
void MainToolBar::ApplyThemeBitmaps()
|
||||||
{
|
{
|
||||||
constexpr std::array<std::pair<int, ToolBarBitmapID>, 8> bitmap_entries{
|
constexpr std::array<std::pair<int, ToolBarBitmapID>, 8> bitmap_entries{
|
||||||
|
@ -60,7 +60,6 @@ private:
|
|||||||
void InitializeDebuggerBitmaps();
|
void InitializeDebuggerBitmaps();
|
||||||
|
|
||||||
wxBitmap CreateBitmap(const std::string& name) const;
|
wxBitmap CreateBitmap(const std::string& name) const;
|
||||||
wxBitmap CreateDebuggerBitmap(const std::string& name) const;
|
|
||||||
|
|
||||||
void ApplyThemeBitmaps();
|
void ApplyThemeBitmaps();
|
||||||
void ApplyDebuggerBitmaps();
|
void ApplyDebuggerBitmaps();
|
||||||
|