wxStAppResource resload ;
- Handle menubar = ::GetNewMBar( kwxMacMenuBarResource ) ;
- wxString message ;
- wxCHECK_RET( menubar != NULL, wxT("can't read MBAR resource") );
+ MenuBarHandle menubar = NewHandleClear( 6 /* sizeof( MenuBarHeader ) */ ) ;
::SetMenuBar( menubar ) ;
-#if TARGET_API_MAC_CARBON
- ::DisposeMenuBar( menubar ) ;
-#else
- ::DisposeHandle( menubar ) ;
-#endif
+ DisposeMenuBar( menubar ) ;
+ MenuHandle appleMenu = NULL ;
+ char appleMenuTitle[3] = { 01 , kMenuAppleLogoFilledGlyph , 0 } ;
-#if TARGET_API_MAC_OS8
- MenuHandle menu = ::GetMenuHandle( kwxMacAppleMenuId ) ;
- if ( CountMenuItems( menu ) == 2 )
- {
- ::AppendResMenu(menu, 'DRVR');
- }
-#endif
+ verify_noerr( CreateNewMenu( kwxMacAppleMenuId , 0 , &appleMenu ) ) ;
+ verify_noerr( SetMenuTitle( appleMenu , (ConstStr255Param) appleMenuTitle ) );
+ MacInsertMenuItem( appleMenu , "\pAbout..." , 0 ) ;
+ MacInsertMenu( appleMenu , 0 ) ;
// clean-up the help menu before adding new items
MenuHandle mh = NULL ;
Refresh();
}
+bool wxMenuBar::Enable( bool enable)
+{
+ wxCHECK_MSG( IsAttached(), false, wxT("doesn't work with unattached menubars") );
+ size_t i;
+ for (i = 0; i < GetMenuCount(); i++)
+ {
+ EnableTop(i, enable);
+ }
+ return true;
+}
+
void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
{
wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") );
for ( size_t i = 0; i < count; i++ )
{
wxString title = wxStripMenuCodes(m_titles[i]);
- if ( menuString == title )
+ if ( menuLabel == title )
return m_menus[i]->FindItem(itemString);
}