From 8b6d589d512cad9010a7d9a6ecb396ee8562629e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 23 Feb 2005 15:50:48 +0000 Subject: [PATCH] Presentation of hiding and disabling of the items in wxRadioBox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/widgets/radiobox.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index ebb3f78086..44fd53b749 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -56,6 +56,8 @@ enum RadioPage_Selection, RadioPage_Label, RadioPage_LabelBtn, + RadioPage_Enable2nd, + RadioPage_Show2nd, RadioPage_Radio }; @@ -109,6 +111,8 @@ protected: // the check/radio boxes for styles wxCheckBox *m_chkVert; + wxCheckBox *m_2ndEnabled; + wxCheckBox *m_2ndShown; wxRadioBox *m_radioDir; // the gauge itself and the sizer it is in @@ -164,6 +168,8 @@ RadioWidgetsPage::RadioWidgetsPage(wxBookCtrl *book, // init everything m_chkVert = (wxCheckBox *)NULL; + m_2ndEnabled = (wxCheckBox *)NULL; + m_2ndShown = (wxCheckBox *)NULL; m_textNumBtns = m_textLabelBtns = @@ -247,6 +253,9 @@ RadioWidgetsPage::RadioWidgetsPage(wxBookCtrl *book, &m_textLabelBtns); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); + m_2ndEnabled = CreateCheckBoxAndAddToSizer(sizerMiddle, _T("2nd item enabled")); + m_2ndShown = CreateCheckBoxAndAddToSizer(sizerMiddle, _T("2nd item shown")); + // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); sizerRight->SetMinSize(150, 0); @@ -278,6 +287,8 @@ void RadioWidgetsPage::Reset() m_textLabelBtns->SetValue(_T("item")); m_chkVert->SetValue(false); + m_2ndEnabled->SetValue(true); + m_2ndShown->SetValue(true); m_radioDir->SetSelection(RadioDir_Default); } @@ -363,6 +374,9 @@ void RadioWidgetsPage::CreateRadio() m_sizerRadio->Add(m_radio, 1, wxGROW); m_sizerRadio->Layout(); + + m_radio->Enable( 1 , m_2ndEnabled->GetValue() ); + m_radio->Show( 1 , m_2ndShown->GetValue() ); } // ----------------------------------------------------------------------------