]> git.saurik.com Git - wxWidgets.git/commitdiff
added test for toggling wxLC_[HV]RULES styles
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 18 Sep 2004 11:01:00 +0000 (11:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 18 Sep 2004 11:01:00 +0000 (11:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 7198ec34cae62086c7546f089f0934c9b1bd9e15..eab3daf678717c107b95b551836925f988d51200 100644 (file)
@@ -76,6 +76,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo)
     EVT_MENU(LIST_FREEZE, MyFrame::OnFreeze)
     EVT_MENU(LIST_THAW, MyFrame::OnThaw)
+    EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines)
 
     EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo)
     EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel)    
@@ -215,6 +216,7 @@ MyFrame::MyFrame(const wxChar *title, int x, int y, int w, int h)
     menuList->Append(LIST_FREEZE, _T("Free&ze\tCtrl-Z"));
     menuList->Append(LIST_THAW, _T("Tha&w\tCtrl-W"));
     menuList->AppendSeparator();
+    menuList->AppendCheckItem(LIST_TOGGLE_LINES, _T("Toggle &lines\tCtrl-I"));
     menuList->Append(LIST_TOGGLE_MULTI_SEL, _T("&Multiple selection\tCtrl-M"),
             _T("Toggle multiple selection"), true);
 
@@ -307,6 +309,11 @@ void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event))
     m_listCtrl->Thaw();
 }
 
+void MyFrame::OnToggleLines(wxCommandEvent& event)
+{
+    m_listCtrl->SetSingleStyle(wxLC_HRULES | wxLC_VRULES, event.IsChecked());
+}
+
 void MyFrame::OnFocusLast(wxCommandEvent& WXUNUSED(event))
 {
     long index = m_listCtrl->GetItemCount() - 1;
index a8e29bddf47a48e71f53d010106415dd0791fe55..f529be7d6e5b3d8b80deb03166d689cc2ef9283a 100644 (file)
@@ -113,6 +113,7 @@ protected:
     void OnShowSelInfo(wxCommandEvent& event);
     void OnFreeze(wxCommandEvent& event);
     void OnThaw(wxCommandEvent& event);
+    void OnToggleLines(wxCommandEvent& event);
 
     void OnUpdateShowColInfo(wxUpdateUIEvent& event);
     void OnUpdateToggleMultiSel(wxUpdateUIEvent& event);
@@ -176,6 +177,7 @@ enum
     LIST_FOCUS_LAST,
     LIST_FREEZE,
     LIST_THAW,
+    LIST_TOGGLE_LINES,
 
     LIST_CTRL                   = 1000
 };