]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/radiobox.cpp
regenerated after undoing recent HP-UX changes
[wxWidgets.git] / samples / widgets / radiobox.cpp
index b3af3419add576f015778b98cabf819e0c0616c9..44fd53b749f7e9e1f8b0b13373f282f281a33e8b 100644 (file)
@@ -24,6 +24,8 @@
     #pragma hdrstop
 #endif
 
+#if wxUSE_RADIOBOX
+
 // for all others, include the necessary headers
 #ifndef WX_PRECOMP
     #include "wx/log.h"
@@ -39,7 +41,7 @@
 #include "wx/sizer.h"
 
 #include "widgets.h"
-#if 1
+
 #include "icons/radiobox.xpm"
 
 // ----------------------------------------------------------------------------
@@ -54,6 +56,8 @@ enum
     RadioPage_Selection,
     RadioPage_Label,
     RadioPage_LabelBtn,
+    RadioPage_Enable2nd,
+    RadioPage_Show2nd,
     RadioPage_Radio
 };
 
@@ -76,7 +80,7 @@ static const unsigned int DEFAULT_MAJOR_DIM = 3;
 class RadioWidgetsPage : public WidgetsPage
 {
 public:
-    RadioWidgetsPage(wxNotebook *notebook, wxImageList *imaglist);
+    RadioWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
     virtual ~RadioWidgetsPage(){};
 
     virtual wxControl *GetWidget() const { return m_radio; }
@@ -107,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
@@ -154,14 +160,16 @@ END_EVENT_TABLE()
 
 IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"));
 
-RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
-                                       wxImageList *imaglist)
-                  : WidgetsPage(notebook)
+RadioWidgetsPage::RadioWidgetsPage(wxBookCtrl *book,
+                                   wxImageList *imaglist)
+                  : WidgetsPage(book)
 {
     imaglist->Add(wxBitmap(radio_xpm));
 
     // init everything
     m_chkVert = (wxCheckBox *)NULL;
+    m_2ndEnabled = (wxCheckBox *)NULL;
+    m_2ndShown = (wxCheckBox *)NULL;
 
     m_textNumBtns =
     m_textLabelBtns =
@@ -245,6 +253,9 @@ RadioWidgetsPage::RadioWidgetsPage(wxNotebook *notebook,
                                             &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);
@@ -276,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);
 }
 
@@ -361,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() );
 }
 
 // ----------------------------------------------------------------------------
@@ -455,4 +471,4 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event)
     event.Enable(enable);
 }
 
-#endif
+#endif // wxUSE_RADIOBOX