// control ids
enum
{
- GaugePage_Reset = 100,
+ GaugePage_Reset = wxID_HIGHEST,
GaugePage_Progress,
GaugePage_Clear,
GaugePage_SetValue,
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(); }
+
+ // lazy creation of the content
+ virtual void CreateContent();
+
protected:
// event handlers
void OnButtonReset(wxCommandEvent& event);
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"));
+#if defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
-GaugeWidgetsPage::GaugeWidgetsPage(wxNotebook *notebook,
- wxImageList *imaglist)
- : WidgetsPage(notebook)
-{
- imaglist->Add(wxBitmap(gauge_xpm));
+IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"), FAMILY_CTRLS );
+GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book,
+ wxImageList *imaglist)
+ :WidgetsPage(book, imaglist, gauge_xpm)
+{
// init everything
m_range = 100;
m_gauge = (wxGauge *)NULL;
m_sizerGauge = (wxSizer *)NULL;
+}
+void GaugeWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
void GaugeWidgetsPage::CreateGauge()
{
- int flags = 0;
+ int flags = ms_defaultFlags;
if ( m_chkVert->GetValue() )
flags |= wxGA_VERTICAL;