LboxTest_Delete,
LboxTest_DeleteText,
LboxTest_DeleteSel,
+ LboxTest_DeselectAll,
LboxTest_Listbox,
LboxTest_Quit
};
void OnButtonChange(wxCommandEvent& event);
void OnButtonDelete(wxCommandEvent& event);
void OnButtonDeleteSel(wxCommandEvent& event);
+ void OnButtonDeselectAll(wxCommandEvent& event);
void OnButtonClear(wxCommandEvent& event);
+
#if wxUSE_LOG
void OnButtonClearLog(wxCommandEvent& event);
#endif // wxUSE_LOG
void OnUpdateUIClearButton(wxUpdateUIEvent& event);
void OnUpdateUIDeleteButton(wxUpdateUIEvent& event);
void OnUpdateUIDeleteSelButton(wxUpdateUIEvent& event);
+ void OnUpdateUIDeselectAllButton(wxUpdateUIEvent& event);
// reset the listbox parameters
void Reset();
EVT_BUTTON(LboxTest_Change, LboxTestFrame::OnButtonChange)
EVT_BUTTON(LboxTest_Delete, LboxTestFrame::OnButtonDelete)
EVT_BUTTON(LboxTest_DeleteSel, LboxTestFrame::OnButtonDeleteSel)
+ EVT_BUTTON(LboxTest_DeselectAll, LboxTestFrame::OnButtonDeselectAll)
EVT_BUTTON(LboxTest_Clear, LboxTestFrame::OnButtonClear)
#if wxUSE_LOG
EVT_BUTTON(LboxTest_ClearLog, LboxTestFrame::OnButtonClearLog)
EVT_UPDATE_UI(LboxTest_Change, LboxTestFrame::OnUpdateUIDeleteSelButton)
EVT_UPDATE_UI(LboxTest_ChangeText, LboxTestFrame::OnUpdateUIDeleteSelButton)
EVT_UPDATE_UI(LboxTest_DeleteSel, LboxTestFrame::OnUpdateUIDeleteSelButton)
+ EVT_UPDATE_UI(LboxTest_DeselectAll, LboxTestFrame::OnUpdateUIDeselectAllButton)
EVT_LISTBOX(LboxTest_Listbox, LboxTestFrame::OnListbox)
EVT_LISTBOX_DCLICK(wxID_ANY, LboxTestFrame::OnListboxDClick)
btn = new wxButton(m_panel, LboxTest_DeleteSel, _T("Delete &selection"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
+ btn = new wxButton(m_panel, LboxTest_DeselectAll, _T("Deselect All"));
+ sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
+
btn = new wxButton(m_panel, LboxTest_Clear, _T("&Clear"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
}
}
+void LboxTestFrame::OnButtonDeselectAll(wxCommandEvent& WXUNUSED(event))
+{
+ m_lbox->SetSelection(-1);
+}
+
void LboxTestFrame::OnButtonClear(wxCommandEvent& WXUNUSED(event))
{
m_lbox->Clear();
event.Enable(m_lbox->GetSelections(selections) != 0);
}
+void LboxTestFrame::OnUpdateUIDeselectAllButton(wxUpdateUIEvent& event)
+{
+ wxArrayInt selections;
+ event.Enable(m_lbox->GetSelections(selections) != 0);
+}
+
void LboxTestFrame::OnUpdateUIClearButton(wxUpdateUIEvent& event)
{
event.Enable(m_lbox->GetCount() != 0);