class SliderWidgetsPage : public WidgetsPage
{
public:
- SliderWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
+ SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist);
virtual ~SliderWidgetsPage(){};
virtual wxControl *GetWidget() const { return m_slider; }
+ virtual void RecreateWidget() { CreateSlider(); }
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
-SliderWidgetsPage::SliderWidgetsPage(wxBookCtrl *book,
+IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), FAMILY_CTRLS );
+
+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;
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)
wxT("wxEVT_SCROLL_PAGEDOWN"),
wxT("wxEVT_SCROLL_THUMBTRACK"),
wxT("wxEVT_SCROLL_THUMBRELEASE"),
- wxT("wxEVT_SCROLL_ENDSCROLL")
+ wxT("wxEVT_SCROLL_CHANGED")
};
int index = eventType - wxEVT_SCROLL_TOP;
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(),