class SliderWidgetsPage : public WidgetsPage
{
public:
- SliderWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist);
+ SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~SliderWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_slider; }
+ virtual void RecreateWidget() { CreateSlider(); }
+
+ // lazy creation of the content
+ virtual void CreateContent();
protected:
// event handlers
// implementation
// ============================================================================
-IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"));
+#if defined(__WXUNIVERSAL__)
+ #define FAMILY_CTRLS UNIVERSAL_CTRLS
+#else
+ #define FAMILY_CTRLS NATIVE_CTRLS
+#endif
+
+IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), FAMILY_CTRLS );
-SliderWidgetsPage::SliderWidgetsPage(wxBookCtrlBase *book,
+SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
- : WidgetsPage(book)
+ : WidgetsPage(book, imaglist, slider_xpm)
{
- imaglist->Add(wxBitmap(slider_xpm));
-
// init everything
m_min = 0;
m_max = 100;
m_slider = (wxSlider *)NULL;
m_sizerSlider = (wxSizer *)NULL;
+}
+void SliderWidgetsPage::CreateContent()
+{
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
void SliderWidgetsPage::CreateSlider()
{
- int flags = 0;
+ int flags = ms_defaultFlags;
if ( m_chkInverse->GetValue() )
{
void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event)
{
-#if defined(__WIN95__) || defined(__WXUNIVERSAL__)
+#if defined(__WXMSW__) || defined(__WXUNIVERSAL__)
event.Enable( m_chkTicks->GetValue() );
#else
event.Enable( false );
-#endif // defined(__WIN95__) || defined(__WXUNIVERSAL__)
+#endif // defined(__WXMSW__) || defined(__WXUNIVERSAL__)
}
void SliderWidgetsPage::OnSlider(wxScrollEvent& event)
static int s_numSliderEvents = 0;
- wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %ld)"),
+ wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %d)"),
s_numSliderEvents++,
eventNames[index],
event.GetPosition(),