X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80fdcdb90ef779185492dab676d461fc34933312..d4e5c5b98a5a80c5cc65776f2add32ff543c2972:/src/osx/listbox_osx.cpp diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index 26e6f307a0..63a7bc9e4b 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -74,6 +74,9 @@ bool wxListBox::Create( DontCreatePeer(); m_blockEvents = false; + if ( ! (style & wxNO_BORDER) ) + style = (style & ~wxBORDER_MASK) | wxSUNKEN_BORDER ; + wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), wxT("only a single listbox selection mode can be specified") ); @@ -130,6 +133,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 ); } @@ -385,8 +393,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) );