]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/menu.cpp
Fixup Blit so it can be used with a source that is a wxBufferedDC,
[wxWidgets.git] / src / mac / carbon / menu.cpp
index 94f29966bcfeb98a079aacb8e603512c25b620f9..75b60c03bf83afe3592cb642db60c11129926ba5 100644 (file)
     #include "wx/log.h"
     #include "wx/app.h"
     #include "wx/utils.h"
+    #include "wx/frame.h"
+    #include "wx/menuitem.h"
 #endif
 
-#include "wx/menuitem.h"
-#include "wx/window.h"
-#include "wx/log.h"
-#include "wx/frame.h"
-
 #include "wx/mac/uma.h"
 
 // other standard headers
@@ -43,8 +40,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
 // the (popup) menu title has this special id
 static const int idMenuTitle = -3;
 
-const short kwxMacMenuBarResource = 1 ;
-const short kwxMacAppleMenuId = 1 ;
+static const short kwxMacAppleMenuId = 1 ;
 
 
 // Find an item given the Macintosh Menu Reference
@@ -490,12 +486,10 @@ void wxMenu::MacAfterDisplay( bool isSubMenu )
     if ( isSubMenu )
         ::DeleteMenu(MacGetMenuId());
 
-    wxMenuItem* previousItem = NULL ;
     wxMenuItemList::compatibility_iterator node;
     wxMenuItem *item;
-    int pos ;
 
-    for (pos = 0, node = GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
+    for (node = GetMenuItems().GetFirst(); node; node = node->GetNext())
     {
         item = (wxMenuItem *)node->GetData();
         wxMenu* subMenu = item->GetSubMenu() ;
@@ -507,8 +501,6 @@ void wxMenu::MacAfterDisplay( bool isSubMenu )
         {
             // no need to undo hidings
         }
-
-        previousItem = item ;
     }
 }
 
@@ -665,12 +657,11 @@ void wxMenuBar::MacInstallMenuBar()
     {
         wxMenuItemList::compatibility_iterator node;
         wxMenuItem *item;
-        int pos ;
         wxMenu* menu = menuIter->GetData() , *subMenu = NULL ;
 
         if ( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?")  || m_titles[i] == wxApp::s_macHelpMenuTitleName )
         {
-            for (pos = 0 , node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext(), pos++)
+            for (node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext())
             {
                 item = (wxMenuItem *)node->GetData();
                 subMenu = item->GetSubMenu() ;
@@ -700,7 +691,8 @@ void wxMenuBar::MacInstallMenuBar()
                     }
                     else
                     {
-                        wxAcceleratorEntry* entry = wxGetAccelFromString( item->GetText() ) ;
+                        wxAcceleratorEntry*
+                            entry = wxAcceleratorEntry::Create( item->GetText() ) ;
 
                         if ( item->GetId() == wxApp::s_macAboutMenuItemId )
                         {
@@ -735,7 +727,8 @@ void wxMenuBar::MacInstallMenuBar()
         wxMenuItem *aboutMenuItem = FindItem(wxApp::s_macAboutMenuItemId , &aboutMenu) ;
         if ( aboutMenuItem )
         {
-            wxAcceleratorEntry* entry = wxGetAccelFromString( aboutMenuItem->GetText() ) ;
+            wxAcceleratorEntry*
+                entry = wxAcceleratorEntry::Create( aboutMenuItem->GetText() ) ;
             UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , wxStripMenuCodes ( aboutMenuItem->GetText() ) , wxFont::GetDefaultEncoding() );
             UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
             SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , kHICommandAbout ) ;