From b65c371ca8696e92362af0d48adea2c64ef4ceb3 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 30 Aug 2000 07:53:13 +0000 Subject: [PATCH] Added check for wxCheckBox::SetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 801efbb5de..dd17179cf7 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -386,6 +386,7 @@ const int ID_LISTBOX_DELETE = 135; const int ID_LISTBOX_FONT = 136; const int ID_LISTBOX_ENABLE = 137; const int ID_LISTBOX_SORTED = 138; +const int ID_LISTBOX_TOGGLE = 139; const int ID_CHOICE = 120; const int ID_CHOICE_SEL_NUM = 121; @@ -444,6 +445,7 @@ EVT_BUTTON (ID_LISTBOX_CLEAR, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_APPEND, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_DELETE, MyPanel::OnListBoxButtons) EVT_BUTTON (ID_LISTBOX_FONT, MyPanel::OnListBoxButtons) +EVT_BUTTON (ID_LISTBOX_TOGGLE, MyPanel::OnListBoxButtons) EVT_CHECKBOX (ID_LISTBOX_ENABLE, MyPanel::OnListBoxButtons) EVT_CHOICE (ID_CHOICE, MyPanel::OnChoice) EVT_CHOICE (ID_CHOICE_SORTED, MyPanel::OnChoice) @@ -611,6 +613,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) (void)new MyButton( panel, ID_LISTBOX_APPEND, "&Append 'Hi!'", wxPoint(340,80), wxSize(140,30) ); (void)new wxButton( panel, ID_LISTBOX_DELETE, "D&elete selected item", wxPoint(180,130), wxSize(140,30) ); wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, "Set &Italic font", wxPoint(340,130), wxSize(140,30) ); + (void)new wxButton( panel, ID_LISTBOX_TOGGLE, "Toggle checkbox", wxPoint(340,180), wxSize(140,30) ); button->SetDefault(); @@ -1026,6 +1029,11 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) m_checkbox->SetFont( *wxITALIC_FONT ); break; } + case ID_LISTBOX_TOGGLE: + { + m_checkbox->SetValue( TRUE ); + break; + } } }