X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/195df7a7672277af495a4ecf9bf6eee2a7517069..f5058cd7d926d45a6b0673a0b557ca0792f60e48:/samples/widgets/spinbtn.cpp diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 7b63513959..a1ea73f112 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -24,6 +24,8 @@ #pragma hdrstop #endif +#if wxUSE_SPINBTN + // for all others, include the necessary headers #ifndef WX_PRECOMP #include "wx/log.h" @@ -42,7 +44,7 @@ #include "wx/sizer.h" #include "widgets.h" -#if wxUSE_SPINBTN + #include "icons/spinbtn.xpm" // ---------------------------------------------------------------------------- @@ -71,10 +73,12 @@ enum class SpinBtnWidgetsPage : public WidgetsPage { public: - SpinBtnWidgetsPage(wxNotebook *notebook, wxImageList *imaglist); + SpinBtnWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist); virtual ~SpinBtnWidgetsPage(){}; virtual wxControl *GetWidget() const { return m_spinbtn; } + virtual wxControl *GetWidget2() const { return m_spinctrl; } + virtual void RecreateWidget() { CreateSpin(); } protected: // event handlers @@ -164,9 +168,9 @@ END_EVENT_TABLE() IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin")); -SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxNotebook *notebook, +SpinBtnWidgetsPage::SpinBtnWidgetsPage(wxBookCtrlBase *book, wxImageList *imaglist) - : WidgetsPage(notebook) + : WidgetsPage(book) { m_chkVert = NULL; m_chkWrap = NULL; @@ -265,7 +269,7 @@ void SpinBtnWidgetsPage::Reset() void SpinBtnWidgetsPage::CreateSpin() { - int flags = 0; + int flags = ms_defaultFlags; bool isVert = m_chkVert->GetValue(); if ( isVert ) @@ -405,13 +409,13 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event) { - wxLogMessage( _T("Spin button value incremented, will be %ld (was %d)"), + wxLogMessage( _T("Spin button value incremented, will be %d (was %d)"), event.GetInt(), m_spinbtn->GetValue() ); } void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event) { - wxLogMessage( _T("Spin button value decremented, will be %ld (was %d)"), + wxLogMessage( _T("Spin button value decremented, will be %d (was %d)"), event.GetInt(), m_spinbtn->GetValue() ); }