// 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
/////////////////////////////////////////////////////////////////////////////
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 );
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);
}
if ( HasClientObjectData() )
delete GetClientObject( n );
-
+
m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( n ) );
m_strings.RemoveAt( n ) ;
event.SetInt( n );
event.SetString( GetStringSelection() );
event.SetEventObject( this );
-
+
if ( HasClientObjectData() )
event.SetClientObject( GetClientObject( n ) );
else if ( HasClientUntypedData() )