From: Vadim Zeitlin Date: Sat, 18 Sep 2004 11:01:00 +0000 (+0000) Subject: added test for toggling wxLC_[HV]RULES styles X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/494ab5def0cbfdf076f8347d5b246e680003eb07?ds=inline added test for toggling wxLC_[HV]RULES styles git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 7198ec34ca..eab3daf678 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -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; diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index a8e29bddf4..f529be7d6e 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -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 };