- wxMacBuildMenuString( title, NULL , NULL , label , false );
- UMASetMenuTitle( m_hMenu , title ) ;
-}
-
-/*
-
-void wxMenu::SetLabel(int id, const wxString& label)
-{
- Str255 maclabel ;
- int index ;
- wxMenuItem *item = FindItemForId(id) ;
- if (item==NULL)
- return;
-
- index = MacGetIndexFromItem( item ) ;
- if (index < 1)
- return;
-
- if (item->GetSubMenu()==NULL)
- {
- wxMacBuildMenuString( maclabel , NULL , NULL , label , false );
- ::SetMenuItemText( m_hMenu , index , maclabel ) ;
- }
- else
- {
- wxMacBuildMenuString( maclabel , NULL , NULL , label , false );
- ::SetMenuItemText( m_hMenu , index , maclabel ) ;
- }
- item->SetName(label);
-}
-
-wxString wxMenu::GetLabel(int Id) const
-{
- wxMenuItem *pItem = FindItemForId(Id) ;
- return pItem->GetName() ;
-}
-
-// Finds the item id matching the given string, -1 if not found.
-int wxMenu::FindItem (const wxString& itemString) const
-{
- char buf1[200];
- char buf2[200];
- wxStripMenuCodes ((char *)(const char *)itemString, buf1);
-
- for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
- {
- wxMenuItem *item = (wxMenuItem *) node->Data ();
- if (item->GetSubMenu())
- {
- int ans = item->GetSubMenu()->FindItem(itemString);
- if (ans > -1)
- return ans;
- }
- if ( !item->IsSeparator() )
- {
- wxStripMenuCodes((char *)item->GetName().c_str(), buf2);
- if (strcmp(buf1, buf2) == 0)
- return item->GetId();
- }
- }
-
- return -1;
-}
-
-wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const
-{
- if (itemMenu)
- *itemMenu = NULL;
- for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
- {
- wxMenuItem *item = (wxMenuItem *) node->Data ();
-
- if (item->GetId() == itemId)
- {
- if (itemMenu)
- *itemMenu = (wxMenu *) this;
- return item;
- }
-
- if (item->GetSubMenu())
- {
- wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu);
- if (ans)
- return ans;
- }
- }
-
- if (itemMenu)
- *itemMenu = NULL;
- return NULL;
-}
-
-void wxMenu::SetHelpString(int itemId, const wxString& helpString)
-{
- wxMenuItem *item = FindItemForId (itemId);
- if (item)
- item->SetHelp(helpString);
-}
-
-wxString wxMenu::GetHelpString (int itemId) const
-{
- wxMenuItem *item = FindItemForId (itemId);
- wxString str("");
- return (item == NULL) ? str : item->GetHelp();