From 6fb16229f5ecba225cb2955f40c8bdd579246532 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:40:30 +0000 Subject: [PATCH] When call EnsureVisible in wxUniv, make sure reset visible lines range correctly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77790 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index d7ba8dc88e..fe64b6f346 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2646,7 +2646,7 @@ void wxListMainWindow::MoveToItem(size_t item) if (rect.y + rect.height + 5 > view_y + client_h) GetListCtrl()->Scroll( -1, (rect.y + rect.height - client_h + hLine) / hLine ); -#ifdef __WXMAC__ +#if defined(__WXMAC__) || defined(__WXUNIVERSAL__) // 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. @@ -2654,6 +2654,7 @@ void wxListMainWindow::MoveToItem(size_t item) // 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 + // Same in wxUniv/X11 ResetVisibleLinesRange(); #endif } @@ -2696,7 +2697,7 @@ bool wxListMainWindow::ScrollList(int WXUNUSED(dx), int dy) GetListCtrl()->Scroll(-1, top + dy / hLine); -#ifdef __WXMAC__ +#if defined(__WXMAC__) || defined(__WXUNIVERSAL__) // see comment in MoveToItem() for why we do this ResetVisibleLinesRange(); #endif