git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50321
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
GetScrollPosition( &top , &left ) ;
wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n );
GetScrollPosition( &top , &left ) ;
wxMacDataItem * item = (wxMacDataItem*) GetItemFromLine( n );
+ // there is a bug in RevealItem that leads to situations
+ // in large lists, where the item does not get scrolled
+ // into sight, so we do a pre-scroll if necessary
UInt16 height ;
GetRowHeight( (DataBrowserItemID) item , &height ) ;
UInt16 height ;
GetRowHeight( (DataBrowserItemID) item , &height ) ;
- SetScrollPosition( n * ((UInt32)height) , left ) ;
+ UInt32 linetop = n * ((UInt32) height );
+ UInt32 linebottom = linetop + height;
+ Rect rect ;
+ GetRect( &rect );
+
+ if ( linetop < top || linebottom > (top + rect.bottom - rect.top ) )
+ SetScrollPosition( wxMax( n-2, 0 ) * ((UInt32)height) , left ) ;
RevealItem( item , kDataBrowserRevealWithoutSelecting );
}
RevealItem( item , kDataBrowserRevealWithoutSelecting );
}