1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Specify list control columns and styles all in one call

This commit is contained in:
Paul Licameli
2018-02-02 19:22:07 -05:00
parent 17ee2478bc
commit ae353fe61f
10 changed files with 127 additions and 67 deletions

View File

@@ -83,12 +83,12 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
{
S.StartStatic(_("&Manage History"), 1);
{
mList = S.AddListControlReportMode();
// Do this BEFORE inserting the columns. On the Mac at least, the
// columns are deleted and later InsertItem()s will cause Audacity to crash.
mList->SetSingleStyle(wxLC_SINGLE_SEL);
mList->InsertColumn(0, _("Action"), wxLIST_FORMAT_LEFT, 260);
mList->InsertColumn(1, _("Reclaimable Space"), wxLIST_FORMAT_LEFT, 125);
mList = S
.AddListControlReportMode(
{ { _("Action"), wxLIST_FORMAT_LEFT, 260 },
{ _("Reclaimable Space"), wxLIST_FORMAT_LEFT, 125 } },
wxLC_SINGLE_SEL
);
//Assign rather than set the image list, so that it is deleted later.
// AssignImageList takes ownership