X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f2fdc4d56e41711ce7c547484bf97aa0c2bd997a..55f42db2fb9228acd93329f702f1f41af7fa8f15:/samples/widgets/radiobox.cpp diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 1fd80178a4..a4e73f24cc 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -51,7 +51,7 @@ // control ids enum { - RadioPage_Reset = 100, + RadioPage_Reset = wxID_HIGHEST, RadioPage_Update, RadioPage_Selection, RadioPage_Label, @@ -89,6 +89,9 @@ public: virtual wxControl *GetWidget() const { return m_radio; } virtual void RecreateWidget() { CreateRadio(); } + // lazy creation of the content + virtual void CreateContent(); + protected: // event handlers void OnCheckOrRadioBox(wxCommandEvent& event); @@ -173,17 +176,20 @@ END_EVENT_TABLE() // implementation // ============================================================================ +#if defined(__WXUNIVERSAL__) + #define FAMILY_CTRLS UNIVERSAL_CTRLS +#else + #define FAMILY_CTRLS NATIVE_CTRLS +#endif + IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"), - (int)wxPlatform(GENERIC_CTRLS).If(wxMSW,NATIVE_CTRLS) - | WITH_ITEMS_CTRLS + FAMILY_CTRLS | WITH_ITEMS_CTRLS ); 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; @@ -196,7 +202,10 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book, m_radio = m_radioDir = (wxRadioBox *)NULL; m_sizerRadio = (wxSizer *)NULL; +} +void RadioWidgetsPage::CreateContent() +{ wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane