]> git.saurik.com Git - wxWidgets.git/commitdiff
On Mac the first visible line needs to be recalculated after the Scroll because it...
authorRobin Dunn <robin@alldunn.com>
Mon, 8 Oct 2007 22:29:58 +0000 (22:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 8 Oct 2007 22:29:58 +0000 (22:29 +0000)
to the wrong value in Scroll because of the paint event generated by the Update() there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 4e49115d1a7400e69aebe2b5875451f987a1f6d5..b316c39ea9b3a34cc5007d14195d60178d3cc121 100644 (file)
@@ -3296,6 +3296,17 @@ void wxListMainWindow::MoveToItem(size_t item)
             Scroll( -1, rect.y / hLine );
         if (rect.y + rect.height + 5 > view_y + client_h)
             Scroll( -1, (rect.y + rect.height - client_h + hLine) / hLine );
+
+#ifdef __WXMAC__
+        // At least on Mac the visible lines value will get reset inside of
+        // Scroll *before* it actually scrolls the window because of the
+        // Update() that happens there, so it will still have the wrong value.
+        // So let's reset it again and wait for it to be recalculated in the
+        // next paint event.  I would expect this problem to show up in wxGTK
+        // too but couldn't duplicate it there.  Perhaps the order of events
+        // is different...  --Robin
+        ResetVisibleLinesRange();
+#endif
     }
     else // !report
     {