Use a " " (space) for the menu item if an empty string is used for an item in a wxChoice, in order to avoid an assert in wxMenuItem.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-12-17 00:56:26 +00:00
parent 2debe2b120
commit 708cc39462

View File

@@ -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);
}