]> git.saurik.com Git - wxWidgets.git/commitdiff
Test for IsScrolling() added
authorGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 18 Jan 2000 20:23:38 +0000 (20:23 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 18 Jan 2000 20:23:38 +0000 (20:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/scroll/scroll.cpp

index 8f5cba310cd299ca1d48e3d1e1455d5f697d1f44..e612f23c765e7150ec15b378ba5208076c686344 100644 (file)
@@ -44,6 +44,7 @@ public:
     void OnMoveButton( wxCommandEvent &event );
     void OnScrollWin( wxCommandEvent &event );
     void OnMouseDown( wxMouseEvent &event );
+    void OnScroll( wxScrollWinEvent &event );
 
     wxButton *m_button;
 
@@ -102,6 +103,7 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
   EVT_BUTTON( ID_DELBUTTON,   MyCanvas::OnDeleteButton)
   EVT_BUTTON( ID_MOVEBUTTON,  MyCanvas::OnMoveButton)
   EVT_BUTTON( ID_SCROLLWIN,   MyCanvas::OnScrollWin)
+  EVT_SCROLLWIN(              MyCanvas::OnScroll)
 END_EVENT_TABLE()
 
 MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
@@ -250,6 +252,16 @@ void MyCanvas::OnScrollWin( wxCommandEvent &WXUNUSED(event) )
     Scroll( -1, y+2 );
 }
 
+void MyCanvas::OnScroll( wxScrollWinEvent &event )
+{
+    if (( event.GetEventType() == wxEVT_SCROLLWIN_THUMBTRACK ) &&
+        ( !event.IsScrolling() ))
+    {
+        wxLogMessage( "Thumb released; position: %u", event.GetPosition() );
+    }
+    event.Skip();
+}
+
 // MyFrame
 
 const int ID_QUIT  = 108;