X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d33e45f134004bdb8199de60d60a251569bbed96..29188693b3b8ba4b07762df012cc652d421dae79:/src/osx/choice_osx.cpp diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 9702a7da67..966974de06 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -4,7 +4,7 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: choice.cpp 54129 2008-06-11 19:30:52Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -72,10 +72,10 @@ bool wxChoice::Create(wxWindow *parent, if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) ) return false; - + m_popUpMenu = new wxMenu(); m_popUpMenu->SetNoEventsMode(true); - + m_peer = wxWidgetImpl::CreateChoice( this, parent, id, m_popUpMenu, pos, size, style, GetExtraStyle() ); MacPostControlCreate( pos, size ); @@ -126,7 +126,10 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, m_strings.Insert( items[i], idx ); } - m_popUpMenu->Insert( idx, i+1, items[i] ); + wxString text = items[i]; + if (text == wxEmptyString) + text = " "; // menu items can't have empty labels + m_popUpMenu->Insert( idx, i+1, text ); m_datas.Insert( NULL, idx ); AssignNewItemClientData(idx, clientData, i, type); } @@ -142,7 +145,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) if ( HasClientObjectData() ) delete GetClientObject( n ); - + m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) ); m_strings.RemoveAt( n ) ; @@ -241,7 +244,7 @@ bool wxChoice::OSXHandleClicked( double WXUNUSED(timestampsec) ) event.SetInt( n ); event.SetString( GetStringSelection() ); event.SetEventObject( this ); - + if ( HasClientObjectData() ) event.SetClientObject( GetClientObject( n ) ); else if ( HasClientUntypedData() )