]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 920076 ] [listctrl sample] Keep multiselect menu item in sync
authorJulian Smart <julian@anthemion.co.uk>
Tue, 23 Mar 2004 22:18:06 +0000 (22:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 23 Mar 2004 22:18:06 +0000 (22:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/listctrl/listtest.cpp
samples/listctrl/listtest.h

index c9462339ddf61ec1dd5920fd026c5e13eecbd7de..4a23f885dd0f3a630e66416e5fdf2d162e7c7c82 100644 (file)
@@ -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));
index b3efd7c148ac88972caa632f20a0d6cf52b92e61..fb09e68cfd8dba17b8502aee0d7da357f747207f 100644 (file)
@@ -115,6 +115,7 @@ protected:
     void OnThaw(wxCommandEvent& event);
 
     void OnUpdateShowColInfo(wxUpdateUIEvent& event);
+    void OnUpdateToggleMultiSel(wxUpdateUIEvent& event);
 
     wxImageList *m_imageListNormal;
     wxImageList *m_imageListSmall;