]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/radiobox.cpp
added wxTB_NO_TOOLTIPS (heavily modified patch 1458009)
[wxWidgets.git] / samples / widgets / radiobox.cpp
index ddb845608486bfd1679d0b07acd59639426310a2..9f647fd92eb0eb6f14b8a2851093232370a97c1a 100644 (file)
@@ -51,7 +51,7 @@
 // control ids
 enum
 {
-    RadioPage_Reset = 100,
+    RadioPage_Reset = wxID_HIGHEST,
     RadioPage_Update,
     RadioPage_Selection,
     RadioPage_Label,
@@ -83,10 +83,11 @@ static const int TEST_BUTTON = 1;
 class RadioWidgetsPage : public WidgetsPage
 {
 public:
-    RadioWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
+    RadioWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
     virtual ~RadioWidgetsPage(){};
 
     virtual wxControl *GetWidget() const { return m_radio; }
+    virtual void RecreateWidget() { CreateRadio(); }
 
 protected:
     // event handlers
@@ -172,14 +173,20 @@ END_EVENT_TABLE()
 // implementation
 // ============================================================================
 
-IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"));
+#if defined(__WXUNIVERSAL__)
+    #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+    #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"),
+                       FAMILY_CTRLS | WITH_ITEMS_CTRLS
+                       );
 
-RadioWidgetsPage::RadioWidgetsPage(wxBookCtrlBase *book,
+RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
                                    wxImageList *imaglist)
-                  : WidgetsPage(book)
+                  : WidgetsPage(book, imaglist, radio_xpm)
 {
-    imaglist->Add(wxBitmap(radio_xpm));
-
     // init everything
     m_chkVert = (wxCheckBox *)NULL;
     m_chkEnableItem = (wxCheckBox *)NULL;
@@ -356,6 +363,8 @@ void RadioWidgetsPage::CreateRadio()
     int flags = m_chkVert->GetValue() ? wxRA_VERTICAL
                                       : wxRA_HORIZONTAL;
 
+    flags |= ms_defaultFlags;
+
 #ifdef wxRA_LEFTTORIGHT
     switch ( m_radioDir->GetSelection() )
     {