/////////////////////////////////////////////////////////////////////////////
-// Program: wxWindows Widgets Sample
+// Program: wxWidgets Widgets Sample
// Name: slider.cpp
// Purpose: Part of the widgets sample showing wxSlider
// Author: Vadim Zeitlin
#pragma hdrstop
#endif
+#if wxUSE_SLIDER
+
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include "wx/log.h"
#include "wx/sizer.h"
#include "widgets.h"
-#if wxUSE_SLIDER
+
#include "icons/slider.xpm"
// ----------------------------------------------------------------------------
class SliderWidgetsPage : public WidgetsPage
{
public:
- SliderWidgetsPage(wxNotebook *notebook, wxImageList *imaglist);
- virtual ~SliderWidgetsPage();
+ SliderWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
+ virtual ~SliderWidgetsPage(){};
+
+ virtual wxControl *GetWidget() const { return m_slider; }
protected:
// event handlers
IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"));
-SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook,
- wxImageList *imaglist)
- : WidgetsPage(notebook)
+SliderWidgetsPage::SliderWidgetsPage(wxBookCtrl *book,
+ wxImageList *imaglist)
+ : WidgetsPage(book)
{
imaglist->Add(wxBitmap(slider_xpm));
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen,
- _T("Thumb &lenght"),
+ _T("Thumb &length"),
SliderPage_ThumbLenText,
&m_textThumbLen);
sizerTop->Fit(this);
}
-SliderWidgetsPage::~SliderWidgetsPage()
-{
-}
-
// ----------------------------------------------------------------------------
// operations
// ----------------------------------------------------------------------------
long len;
if ( !m_textThumbLen->GetValue().ToLong(&len) )
{
- wxLogWarning(_T("Invalid slider thumb lenght"));
+ wxLogWarning(_T("Invalid slider thumb length"));
return;
}
event.GetPosition());
}
-#endif
- // wxUSE_SLIDER
+#endif // wxUSE_SLIDER