X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/45e6e6f8ab806b337dffeb3b52fec7eba3c845ef..b70362998b8f562923f6ed6708f06537ac056cd4:/samples/scroll/scroll.cpp diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index c740185ad6..9c14457566 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -273,6 +273,7 @@ protected: // event stuff void OnMouseLeftDown(wxMouseEvent& event); void OnMouseLeftUp(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); + void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); void OnScroll(wxScrollWinEvent& event); DECLARE_EVENT_TABLE() @@ -743,6 +744,7 @@ BEGIN_EVENT_TABLE(MyAutoTimedScrollingWindow, wxScrolledWindow) EVT_LEFT_DOWN(MyAutoTimedScrollingWindow::OnMouseLeftDown) EVT_LEFT_UP(MyAutoTimedScrollingWindow::OnMouseLeftUp) EVT_MOTION(MyAutoTimedScrollingWindow::OnMouseMove) + EVT_MOUSE_CAPTURE_LOST(MyAutoTimedScrollingWindow::OnMouseCaptureLost) EVT_SCROLLWIN(MyAutoTimedScrollingWindow::OnScroll) END_EVENT_TABLE() @@ -1013,6 +1015,12 @@ void MyAutoTimedScrollingWindow::OnMouseMove(wxMouseEvent& event) } } +void MyAutoTimedScrollingWindow::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) +{ + // we only capture mouse for timed scrolling, so nothing is needed here + // other than making sure to not call event.Skip() +} + void MyAutoTimedScrollingWindow::OnScroll(wxScrollWinEvent& event) { // need to move the cursor when autoscrolling