moved wxMenuBar::FindMenu(title) from MSW to common code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-22 09:53:55 +00:00
parent 86ad564eb1
commit 52130557bf
4 changed files with 23 additions and 17 deletions

View File

@@ -544,6 +544,26 @@ wxMenu *wxMenuBarBase::Remove(size_t pos)
return menu;
}
int wxMenuBarBase::FindMenu(const wxString& title)
{
wxString label = wxMenuItem::GetLabelFromText(title);
size_t count = GetMenuCount();
for ( size_t i = 0; i < count; i++ )
{
wxString title2 = GetLabelTop(i);
if ( (title2 == title) ||
(wxMenuItem::GetLabelFromText(title2) == label) )
{
// found
return (int)i;
}
}
return wxNOT_FOUND;
}
// ---------------------------------------------------------------------------
// wxMenuBar functions forwarded to wxMenuItem
// ---------------------------------------------------------------------------