-// Must only be used AFTER menu has been attached to frame,
-// otherwise use individual menus to enable/disable items
-void wxMenuBar::Enable(int id, bool enable)
-{
- wxMenu *itemMenu = NULL;
- wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-
- wxCHECK_RET( item, _T("attempt to enable an item which doesn't exist") );
-
- item->Enable(enable);
-}
-
-void wxMenuBar::EnableTop(int pos, bool enable)
-{
- int flag = enable ? MF_ENABLED : MF_GRAYED;;
-
- EnableMenuItem((HMENU)m_hMenu, pos, MF_BYPOSITION | flag);
-}
-
-// Must only be used AFTER menu has been attached to frame,
-// otherwise use individual menus
-void wxMenuBar::Check(int id, bool check)
-{
- wxMenu *itemMenu = NULL;
- wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-
- wxCHECK_RET( item, _T("attempt to check an item which doesn't exist") );
- wxCHECK_RET( item->IsCheckable(), _T("attempt to check an uncheckable item") );
-
- item->Check(check);
-}
-
-bool wxMenuBar::IsChecked(int id) const
-{
- wxMenu *itemMenu = NULL;
- wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked(): no such item") );
-
- int flag = ::GetMenuState(GetHMenuOf(itemMenu), id, MF_BYCOMMAND);
-
- return (flag & MF_CHECKED) != 0;
-}
-
-bool wxMenuBar::IsEnabled(int id) const
-{
- wxMenu *itemMenu = NULL;
- wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled(): no such item") );
-
- int flag = ::GetMenuState(GetHMenuOf(itemMenu), id, MF_BYCOMMAND) ;
-
- return (flag & MF_ENABLED) != 0;
-}
-
-void wxMenuBar::SetLabel(int id, const wxString& label)
-{
- wxMenu *itemMenu = NULL;
- wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-
- wxCHECK_RET( item, _T("wxMenuBar::SetLabel(): no such item") );
-
- item->SetName(label);
-}