-// 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) ;
-
- // don't "and" with MF_ENABLED because its value is 0
- return (flag & MF_DISABLED) == 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);
-}