]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/spinbutt.cpp
Fix horizontal mouse wheel scrolling in wxGTK.
[wxWidgets.git] / src / univ / spinbutt.cpp
index e3adb55cc1265407015a89aa025edc0d6b820c18..f354520b5991f9f6a393b8ea3bf98654802c4e8e 100644 (file)
@@ -1,10 +1,9 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        univ/spinbutt.cpp
+// Name:        src/univ/spinbutt.cpp
 // Purpose:     implementation of the universal version of wxSpinButton
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     21.01.01
-// RCS-ID:      $Id$
 // Copyright:   (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -38,9 +37,6 @@
 // implementation of wxSpinButton
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
-IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
-
 // ----------------------------------------------------------------------------
 // creation
 // ----------------------------------------------------------------------------
@@ -98,7 +94,7 @@ bool wxSpinButton::Create(wxWindow *parent,
                                    wxDefaultValidator, name) )
         return false;
 
-    SetBestSize(size);
+    SetInitialSize(size);
 
     CreateInputHandler(wxINP_HANDLER_SPINBTN);
 
@@ -324,14 +320,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;
@@ -355,6 +351,14 @@ bool wxSpinButton::PerformAction(const wxControlAction& action,
     return true;
 }
 
+/* static */
+wxInputHandler *wxSpinButton::GetStdInputHandler(wxInputHandler *handlerDef)
+{
+    static wxStdSpinButtonInputHandler s_handler(handlerDef);
+
+    return &s_handler;
+}
+
 // ----------------------------------------------------------------------------
 // wxStdSpinButtonInputHandler
 // ----------------------------------------------------------------------------