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
This commit is contained in:
Vadim Zeitlin 2004-09-18 11:01:00 +00:00
parent c9cb79cbd6
commit 494ab5def0
2 changed files with 9 additions and 0 deletions

View 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;

View 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
};