BreakpointsDlg::BreakpointsDlg() :
wxPanel(Manager::Get()->GetAppWindow(), -1),
m_icons(16, 16, true)
{
wxBoxSizer* bs = new wxBoxSizer(wxVERTICAL);
m_pList = new wxListCtrl(this, idList, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxLC_HRULES | wxLC_VRULES);
bs->Add(m_pList, 1, wxEXPAND | wxALL);
SetAutoLayout(TRUE);
SetSizer(bs);
// Setup the image list for the enabled/disabled icons.
const wxString &basepath = ConfigManager::GetDataFolder() + wxT("/manager_resources.zip#zip:/images/16x16/");
wxBitmap icon = cbLoadBitmap(basepath + wxT("breakpoint.png"), wxBITMAP_TYPE_PNG);
if (icon.IsOk())
m_icons.Add(icon);
icon = cbLoadBitmap(basepath + wxT("breakpoint_disabled.png"), wxBITMAP_TYPE_PNG);
if (icon.IsOk())
m_icons.Add(icon);
icon = cbLoadBitmap(basepath + wxT("breakpoint_other.png"), wxBITMAP_TYPE_PNG);
if (icon.IsOk())
m_icons.Add(icon);
m_pList->SetImageList(&m_icons, wxIMAGE_LIST_SMALL);
m_pList->InsertColumn(Type, _("Type"), wxLIST_FORMAT_LEFT, 128);
m_pList->InsertColumn(FilenameAddress, _("Filename/Address"), wxLIST_FORMAT_LEFT, 128);
m_pList->InsertColumn(Line, _("Line"), wxLIST_FORMAT_LEFT, 44);
m_pList->InsertColumn(Info, _("Info"), wxLIST_FORMAT_LEFT, 120);
m_pList->InsertColumn(Debugger, _("Debugger"), wxLIST_FORMAT_LEFT, 60);
Connect(idList, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
(wxObjectEventFunction) (wxEventFunction) (wxListEventFunction)
&BreakpointsDlg::OnDoubleClick);
Connect(idList, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
(wxObjectEventFunction) (wxEventFunction) (wxListEventFunction)
&BreakpointsDlg::OnRightClick);
typedef cbEventFunctor<BreakpointsDlg, CodeBlocksEvent> CBEvent;
Reload();
}