X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be5a51fb592f3fa2ba38ac6cd1e488d6d806058c..55325d01e68cfb071e42699ca72ba84a7071aa2b:/samples/widgets/gauge.cpp diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index f20aac08ef..f7cd1bb582 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -52,7 +52,7 @@ // control ids enum { - GaugePage_Reset = 100, + GaugePage_Reset = wxID_HIGHEST, GaugePage_Progress, GaugePage_Clear, GaugePage_SetValue, @@ -71,9 +71,12 @@ enum class GaugeWidgetsPage : public WidgetsPage { public: - GaugeWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); + GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist); virtual ~GaugeWidgetsPage(); + virtual wxControl *GetWidget() const { return m_gauge; } + virtual void RecreateWidget() { CreateGauge(); } + protected: // event handlers void OnButtonReset(wxCommandEvent& event); @@ -154,14 +157,18 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge")); +#if defined(__WXUNIVERSAL__) + #define FAMILY_CTRLS UNIVERSAL_CTRLS +#else + #define FAMILY_CTRLS NATIVE_CTRLS +#endif + +IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"), FAMILY_CTRLS ); -GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook, - wxImageList *imaglist) - : WidgetsPage(notebook) +GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book, + wxImageList *imaglist) + :WidgetsPage(book, imaglist, gauge_xpm) { - imaglist->Add(wxBitmap(gauge_xpm)); - // init everything m_range = 100; @@ -257,7 +264,7 @@ void GaugeWidgetsPage::Reset() void GaugeWidgetsPage::CreateGauge() { - int flags = 0; + int flags = ms_defaultFlags; if ( m_chkVert->GetValue() ) flags |= wxGA_VERTICAL;