]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected event type for standalone scrollbars (patch 1240385)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Jul 2005 21:38:46 +0000 (21:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Jul 2005 21:38:46 +0000 (21:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/univ/scrolbar.cpp

index b7480f9fc4b691b3452262bb668ae8317fed5732..f97d6ec69ea55816976bc2fc37917d0414f5919d 100644 (file)
@@ -36,7 +36,7 @@ wxOS2
 wxUniv:
 
 - Window creation now honours wxVSCROLL.
 wxUniv:
 
 - Window creation now honours wxVSCROLL.
-
+- Standalone scrollbars generate events of correct type (Jochen Roemmler)
 
 2.6.1
 -----
 
 2.6.1
 -----
index 93fdb0ba402a665d7eef3daff76860c3664b9d54..4ccf1481c528ec14517945643f7efecbdf9e8e3c 100644 (file)
@@ -554,12 +554,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;
             // 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;
     }
 
     return true;