]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/scroll/scroll.cpp
use wxDC::GetMultiLineTextExtent() instead of duplicating its code in wxButton::DoGet...
[wxWidgets.git] / samples / scroll / scroll.cpp
index f4dd64f70efc3e15169f0d9d9dc190175866084b..1bec08436a3c29920185a0b15f11fea9cf136290 100644 (file)
@@ -630,10 +630,10 @@ void MyScrolledWindowSmart::OnDraw(wxDC& dc)
 // ----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(MyAutoTimedScrollingWindow, wxScrolledWindow)
-    EVT_LEFT_DOWN(OnMouseLeftDown)
-    EVT_LEFT_UP(OnMouseLeftUp)
-    EVT_MOTION(OnMouseMove)
-    EVT_SCROLLWIN(OnScroll)
+    EVT_LEFT_DOWN(MyAutoTimedScrollingWindow::OnMouseLeftDown)
+    EVT_LEFT_UP(MyAutoTimedScrollingWindow::OnMouseLeftUp)
+    EVT_MOTION(MyAutoTimedScrollingWindow::OnMouseMove)
+    EVT_SCROLLWIN(MyAutoTimedScrollingWindow::OnScroll)
 END_EVENT_TABLE()
 
 MyAutoTimedScrollingWindow::MyAutoTimedScrollingWindow(wxWindow* parent)
@@ -830,7 +830,6 @@ void MyAutoTimedScrollingWindow::OnDraw(wxDC& dc)
     // draw the characters
     // 1. for each update region
     for (wxRegionIterator upd(GetUpdateRegion()); upd; ++upd) {
-        wxSize clientSize = GetClientSize();
         wxRect updRect = upd.GetRect();
         wxRect updRectInGChars(DeviceCoordsToGraphicalChars(updRect));
         // 2. for each row of chars in the update region
@@ -905,15 +904,15 @@ void MyAutoTimedScrollingWindow::OnScroll(wxScrollWinEvent& event)
     // FIXME: the cursor also moves when the scrollbar arrows are clicked
     if (HasCapture()) {
         if (event.GetOrientation() == wxHORIZONTAL) {
-            if (event.m_eventType == wxEVT_SCROLLWIN_LINEUP) {
+            if (event.GetEventType() == wxEVT_SCROLLWIN_LINEUP) {
                 --m_cursor.x;
-            } else if (event.m_eventType == wxEVT_SCROLLWIN_LINEDOWN) {
+            } else if (event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN) {
                 ++m_cursor.x;
             }
         } else if (event.GetOrientation() == wxVERTICAL) {
-            if (event.m_eventType == wxEVT_SCROLLWIN_LINEUP) {
+            if (event.GetEventType() == wxEVT_SCROLLWIN_LINEUP) {
                 --m_cursor.y;
-            } else if (event.m_eventType == wxEVT_SCROLLWIN_LINEDOWN) {
+            } else if (event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN) {
                 ++m_cursor.y;
             }
         }