X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..aa3e374197e99d6362468dd821935050e5074065:/src/osx/choice_osx.cpp diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 2668c1b1cd..28af5cdf2c 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 ///////////////////////////////////////////////////////////////////////////// @@ -22,8 +22,6 @@ #include "wx/osx/private.h" -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControlWithItems) - wxChoice::~wxChoice() { if ( HasClientObjectData() ) @@ -126,7 +124,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); } @@ -218,15 +219,11 @@ wxString wxChoice::GetString(unsigned int n) const // ---------------------------------------------------------------------------- void wxChoice::DoSetItemClientData(unsigned int n, void* clientData) { - wxCHECK_RET( IsValid(n), wxT("wxChoice::DoSetItemClientData: invalid index") ); - m_datas[n] = (char*)clientData ; } void * wxChoice::DoGetItemClientData(unsigned int n) const { - wxCHECK_MSG( IsValid(n), NULL, wxT("wxChoice::DoGetClientData: invalid index") ); - return (void *)m_datas[n]; }