EVT_MENU(LIST_TOGGLE_FIRST, MyFrame::OnToggleFirstSel)
EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll)
EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll)
+ EVT_MENU(LIST_DELETE, MyFrame::OnDelete)
EVT_MENU(LIST_DELETE_ALL, MyFrame::OnDeleteAll)
EVT_MENU(LIST_SORT, MyFrame::OnSort)
EVT_MENU(LIST_SET_FG_COL, MyFrame::OnSetFgColour)
menuList->AppendSeparator();
menuList->Append(LIST_SORT, "&Sort\tCtrl-S");
menuList->AppendSeparator();
+ menuList->Append(LIST_DELETE, "&Delete first item");
menuList->Append(LIST_DELETE_ALL, "Delete &all items");
menuList->AppendSeparator();
menuList->Append(LIST_TOGGLE_MULTI_SEL, "&Multiple selection\tCtrl-M",
m_listCtrl->Refresh();
}
+void MyFrame::OnDelete(wxCommandEvent& WXUNUSED(event))
+{
+ if ( m_listCtrl->GetItemCount() )
+ {
+ m_listCtrl->DeleteItem(0);
+ }
+ else
+ {
+ m_logWindow->WriteText("Nothing to delete");
+ }
+}
+
void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event))
{
wxStopWatch sw;
void OnToggleFirstSel(wxCommandEvent& event);
void OnDeselectAll(wxCommandEvent& event);
void OnSelectAll(wxCommandEvent& event);
+ void OnDelete(wxCommandEvent& event);
void OnDeleteAll(wxCommandEvent& event);
void OnSort(wxCommandEvent& event);
void OnSetFgColour(wxCommandEvent& event);
BUSY_ON = 10,
BUSY_OFF = 11,
LIST_DELETE_ALL = 12,
+ LIST_DELETE,
LIST_SORT,
LIST_SET_FG_COL,
LIST_SET_BG_COL,