+bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event)
+{
+ wxEventType evType = event.GetEventType();
+
+ // pass it on to the real handler
+ bool processed = wxEvtHandler::ProcessEvent(event);
+
+ // always process the size events ourselves, even if the user code handles
+ // them as well, as we need to AdjustScrollbars()
+ //
+ // NB: it is important to do it after processing the event in the normal
+ // way as HandleOnSize() may generate a wxEVT_SIZE itself if the
+ // scrollbar[s] (dis)appear and it should be seen by the user code
+ // after this one
+ if ( evType == wxEVT_SIZE )
+ {
+ m_scrollHelper->HandleOnSize((wxSizeEvent &)event);
+
+ return !event.GetSkipped();
+ }
+
+ if ( processed )
+ {
+ // normally, nothing more to do here - except if we have a command
+ // event
+ if ( event.IsCommandEvent() )
+ {
+ return true;
+ }
+ }
+
+ // reset the skipped flag (which might have been set to true in
+ // ProcessEvent() above) to be able to test it below
+ bool wasSkipped = event.GetSkipped();
+ if ( wasSkipped )
+ event.Skip(false);
+
+ // reset the skipped flag to false as it might have been set to true in
+ // ProcessEvent() above
+ event.Skip(false);
+
+ if ( evType == wxEVT_SCROLLWIN_TOP ||
+ evType == wxEVT_SCROLLWIN_BOTTOM ||
+ evType == wxEVT_SCROLLWIN_LINEUP ||
+ evType == wxEVT_SCROLLWIN_LINEDOWN ||
+ evType == wxEVT_SCROLLWIN_PAGEUP ||
+ evType == wxEVT_SCROLLWIN_PAGEDOWN ||
+ evType == wxEVT_SCROLLWIN_THUMBTRACK ||
+ evType == wxEVT_SCROLLWIN_THUMBRELEASE )
+ {
+ m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event);
+ if ( !event.GetSkipped() )
+ {
+ // it makes sense to indicate that we processed the message as we
+ // did scroll the window (and also notice that wxAutoScrollTimer
+ // relies on our return value for continuous scrolling)
+ processed = true;
+ wasSkipped = false;
+ }
+ }
+#if wxUSE_MOUSEWHEEL
+ else if ( evType == wxEVT_MOUSEWHEEL )
+ {
+ m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event);
+ }
+#endif // wxUSE_MOUSEWHEEL
+
+ if ( processed )
+ event.Skip(wasSkipped);
+
+ return processed;
+}
+
+
+// ============================================================================
+// wxVarScrollHelperBase implementation
+// ============================================================================