]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/scrolbar.cpp
replaced all int/size_t indices in wxControlWithItems API with unsigned int (committi...
[wxWidgets.git] / src / univ / scrolbar.cpp
index 4fe391f0881a04ffcf976631010afc7ddb8b44fe..d103fb90e76849e56c1f60121444bcbe9852754b 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "univscrolbar.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
@@ -256,7 +252,7 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize,
                                int range, int pageSize,
                                bool refresh)
 {
-    // we only refresh everythign when the range changes, thumb position
+    // we only refresh everything when the range changes, thumb position
     // changes are handled in OnIdle
     bool needsRefresh = (range != m_range) ||
                         (thumbSize != m_thumbSize) ||
@@ -554,12 +550,18 @@ bool wxScrollBar::PerformAction(const wxControlAction& action,
             // NB: we assume that scrollbar events are sequentially numbered
             //     but this should be ok as other code relies on this as well
             scrollType += wxEVT_SCROLL_TOP - wxEVT_SCROLLWIN_TOP;
+            wxScrollEvent event(scrollType, this->GetId(), m_thumbPos,
+                                IsVertical() ? wxVERTICAL : wxHORIZONTAL);
+            event.SetEventObject(this);
+            GetParent()->GetEventHandler()->ProcessEvent(event);
+        }
+        else // part of the window
+        {
+            wxScrollWinEvent event(scrollType, m_thumbPos,
+                                   IsVertical() ? wxVERTICAL : wxHORIZONTAL);
+            event.SetEventObject(this);
+            GetParent()->GetEventHandler()->ProcessEvent(event);
         }
-
-        wxScrollWinEvent event(scrollType, m_thumbPos,
-                               IsVertical() ? wxVERTICAL : wxHORIZONTAL);
-        event.SetEventObject(this);
-        GetParent()->GetEventHandler()->ProcessEvent(event);
     }
 
     return true;
@@ -849,7 +851,7 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
 
     if ( m_winCapture )
     {
-        if ( (m_htLast == wxHT_SCROLLBAR_THUMB) && event.Moving() )
+        if ( (m_htLast == wxHT_SCROLLBAR_THUMB) && event.Dragging() )
         {
             // make the thumb follow the mouse by keeping the same offset
             // between the mouse position and the top/left of the thumb
@@ -864,7 +866,7 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
 
     bool isArrow = scrollbar->GetArrows().HandleMouseMove(event);
 
-    if ( event.Moving() )
+    if ( event.Dragging() )
     {
         wxHitTest ht = m_renderer->HitTestScrollbar
                                    (