X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a290fa5a7deebe9d96c0c0089d18e27d4bd9b624..d485bda109d5ef0fef36a3f737549e9b9f54baab:/src/univ/spinbutt.cpp diff --git a/src/univ/spinbutt.cpp b/src/univ/spinbutt.cpp index 7df6ef7b8b..08ef3db11e 100644 --- a/src/univ/spinbutt.cpp +++ b/src/univ/spinbutt.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: univ/spinbutt.cpp +// Name: src/univ/spinbutt.cpp // Purpose: implementation of the universal version of wxSpinButton // Author: Vadim Zeitlin // Modified by: @@ -17,11 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "spinbutt.h" - #pragma implementation "univspinbutt.h" -#endif - #include "wx/wxprec.h" #ifdef __BORLANDC__ @@ -43,9 +38,6 @@ // implementation of wxSpinButton // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) -IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - // ---------------------------------------------------------------------------- // creation // ---------------------------------------------------------------------------- @@ -103,7 +95,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxDefaultValidator, name) ) return false; - SetBestSize(size); + SetInitialSize(size); CreateInputHandler(wxINP_HANDLER_SPINBTN); @@ -329,14 +321,14 @@ void wxSpinButton::CalcArrowRects(wxRect *rect1, wxRect *rect2) const } } -wxScrollArrows::Arrow wxSpinButton::HitTest(const wxPoint& pt) const +wxScrollArrows::Arrow wxSpinButton::HitTestArrow(const wxPoint& pt) const { wxRect rectArrow1, rectArrow2; CalcArrowRects(&rectArrow1, &rectArrow2); - if ( rectArrow1.Inside(pt) ) + if ( rectArrow1.Contains(pt) ) return wxScrollArrows::Arrow_First; - else if ( rectArrow2.Inside(pt) ) + else if ( rectArrow2.Contains(pt) ) return wxScrollArrows::Arrow_Second; else return wxScrollArrows::Arrow_None; @@ -360,6 +352,14 @@ bool wxSpinButton::PerformAction(const wxControlAction& action, return true; } +/* static */ +wxInputHandler *wxSpinButton::GetStdInputHandler(wxInputHandler *handlerDef) +{ + static wxStdSpinButtonInputHandler s_handler(handlerDef); + + return &s_handler; +} + // ---------------------------------------------------------------------------- // wxStdSpinButtonInputHandler // ----------------------------------------------------------------------------