X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/206d3a16caa7a4e626395ae52cc8f7e0225e202d..3e21fc053d9017f79ad71675db8d2e1497049159:/samples/widgets/slider.cpp diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index b1ee9b4005..ec8cb751ec 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Program: wxWindows Widgets Sample +// Program: wxWidgets Widgets Sample // Name: slider.cpp // Purpose: Part of the widgets sample showing wxSlider // Author: Vadim Zeitlin @@ -24,6 +24,8 @@ #pragma hdrstop #endif +#if wxUSE_SLIDER + // for all others, include the necessary headers #ifndef WX_PRECOMP #include "wx/log.h" @@ -44,7 +46,7 @@ #include "wx/sizer.h" #include "widgets.h" -#if wxUSE_SLIDER + #include "icons/slider.xpm" // ---------------------------------------------------------------------------- @@ -87,8 +89,10 @@ enum 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 @@ -195,9 +199,9 @@ END_EVENT_TABLE() 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)); @@ -288,7 +292,7 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook, sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen, - _T("Thumb &lenght"), + _T("Thumb &length"), SliderPage_ThumbLenText, &m_textThumbLen); @@ -313,10 +317,6 @@ SliderWidgetsPage::SliderWidgetsPage(wxNotebook *notebook, sizerTop->Fit(this); } -SliderWidgetsPage::~SliderWidgetsPage() -{ -} - // ---------------------------------------------------------------------------- // operations // ---------------------------------------------------------------------------- @@ -438,7 +438,7 @@ void SliderWidgetsPage::DoSetThumbLen() long len; if ( !m_textThumbLen->GetValue().ToLong(&len) ) { - wxLogWarning(_T("Invalid slider thumb lenght")); + wxLogWarning(_T("Invalid slider thumb length")); return; } @@ -602,5 +602,4 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) event.GetPosition()); } -#endif - // wxUSE_SLIDER +#endif // wxUSE_SLIDER