wxMenuItem::GetLabelFromText() added/documented, bug in wxMenu::FindItem() fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-01-11 13:58:41 +00:00
parent ba2d860554
commit 3b59cdbfaf
12 changed files with 43 additions and 27 deletions

View File

@@ -625,11 +625,12 @@ wxMenuItem::~wxMenuItem()
}
// return the menu item text without any menu accels
wxString wxMenuItem::GetLabel() const
/* static */
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
{
wxString label;
#if (GTK_MINOR_VERSION > 0)
for ( const wxChar *pc = m_text.c_str(); *pc; pc++ )
for ( const wxChar *pc = text.c_str(); *pc; pc++ )
{
if ( *pc == wxT('_') )
{
@@ -640,7 +641,7 @@ wxString wxMenuItem::GetLabel() const
label += *pc;
}
#else // GTK+ 1.0
label = m_text;
label = text;
#endif // GTK+ 1.2/1.0
return label;