diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index c9462339dd..4a23f885dd 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -78,6 +78,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(LIST_THAW, MyFrame::OnThaw) EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo) + EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) @@ -591,6 +592,11 @@ void MyFrame::OnToggleMultiSel(wxCommandEvent& WXUNUSED(event)) RecreateList(flags); } +void MyFrame::OnUpdateToggleMultiSel(wxUpdateUIEvent& event) +{ + event.Check((m_listCtrl->GetWindowStyleFlag() & wxLC_SINGLE_SEL) == 0); +} + void MyFrame::OnSetFgColour(wxCommandEvent& WXUNUSED(event)) { m_listCtrl->SetForegroundColour(wxGetColourFromUser(this)); diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index b3efd7c148..fb09e68cfd 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -115,6 +115,7 @@ protected: void OnThaw(wxCommandEvent& event); void OnUpdateShowColInfo(wxUpdateUIEvent& event); + void OnUpdateToggleMultiSel(wxUpdateUIEvent& event); wxImageList *m_imageListNormal; wxImageList *m_imageListSmall;