-const wxString wxMenu::GetTitle() const
-{
- return m_title;
-}
-
-void wxMenu::SetLabel(int Id, const wxString& label)
-{
- wxMenuItem *item = FindItemForId(Id) ;
- if (item==NULL)
- return;
-
- if (item->GetSubMenu()==NULL)
- {
- if (m_hMenu)
- {
- UINT was_flag = GetMenuState((HMENU)m_hMenu,Id,MF_BYCOMMAND) ;
- ModifyMenu((HMENU)m_hMenu,Id,MF_BYCOMMAND|MF_STRING|was_flag,Id,(const char *)label) ;
- }
- else if (m_savehMenu)
- {
- UINT was_flag = GetMenuState((HMENU)m_savehMenu,Id,MF_BYCOMMAND) ;
- ModifyMenu((HMENU)m_savehMenu,Id,MF_BYCOMMAND|MF_STRING|was_flag,Id,(const char *)label) ;
- }
- }
- else
- {
- wxMenu *father = item->GetSubMenu()->m_topLevelMenu ;
- wxNode *node = father->m_menuItems.First() ;
- int i = 0 ;
- while (node)
- {
- wxMenuItem *matched = (wxMenuItem*)node->Data() ;
- if (matched==item)
- break ;
- i++ ;
- node = node->Next() ;
- }
- // Here, we have the position.
- ModifyMenu((HMENU)father->m_savehMenu,i,
- MF_BYPOSITION|MF_STRING|MF_POPUP,
- (UINT)item->GetSubMenu()->m_savehMenu,(const char *)label) ;
- }
- item->SetName(label);
-}
-
-wxString wxMenu::GetLabel(int id) const
-{
-/*
- static char tmp[128] ;
- int len;
- if (m_hMenu)
- len = GetMenuString((HMENU)m_hMenu,Id,tmp,WXSIZEOF(tmp) - 1,MF_BYCOMMAND);
- else if (m_savehMenu)
- len = GetMenuString((HMENU)m_savehMenu,Id,tmp,WXSIZEOF(tmp) - 1,MF_BYCOMMAND);
- else
- len = 0 ;
- tmp[len] = '\0' ;
- return wxString(tmp) ;
-
-*/
- wxMenuItem *pItem = FindItemForId(id) ;
- if (pItem)
- return pItem->GetName() ;
- else
- return wxEmptyString;
-}