X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69fa3d26d3add4f53310e1b2486d1bed11dec33b..3d777efedc1e05bd6c2a7c34a00a65895b62bb13:/src/osx/listbox_osx.cpp diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index 982dad0705..c48607ea5a 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -133,6 +132,11 @@ void wxListBox::FreeData() void wxListBox::DoSetFirstItem(int n) { + // osx actually only has an implementation for ensuring the visibility of a row, it does so + // by scrolling the minimal amount necessary from the current scrolling position. + // in order to get the same behaviour I'd have to make sure first that the last line is visible, + // followed by a scrollRowToVisible for the desired line + GetListPeer()->ListScrollTo( GetCount()-1 ); GetListPeer()->ListScrollTo( n ); } @@ -388,8 +392,8 @@ void wxListBox::SetString(unsigned int n, const wxString& s) void wxListBox::HandleLineEvent( unsigned int n, bool doubleClick ) { - wxCommandEvent event( doubleClick ? wxEVT_COMMAND_LISTBOX_DOUBLECLICKED : - wxEVT_COMMAND_LISTBOX_SELECTED, GetId() ); + wxCommandEvent event( doubleClick ? wxEVT_LISTBOX_DCLICK : + wxEVT_LISTBOX, GetId() ); event.SetEventObject( this ); if ( HasClientObjectData() ) event.SetClientObject( GetClientObject(n) );