]> 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 7df6ef7b8b70e3cbe88541ee9388ad12541ff2ec..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
 ///////////////////////////////////////////////////////////////////////////////
 // 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 +37,6 @@
 // implementation of wxSpinButton
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
-IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
-
 // ----------------------------------------------------------------------------
 // creation
 // ----------------------------------------------------------------------------
@@ -103,7 +94,7 @@ bool wxSpinButton::Create(wxWindow *parent,
                                    wxDefaultValidator, name) )
         return false;
 
-    SetBestSize(size);
+    SetInitialSize(size);
 
     CreateInputHandler(wxINP_HANDLER_SPINBTN);
 
@@ -329,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;
@@ -360,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
 // ----------------------------------------------------------------------------