]> git.saurik.com Git - wxWidgets.git/commitdiff
support for standard command IDs
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 10 Dec 2005 15:36:09 +0000 (15:36 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 10 Dec 2005 15:36:09 +0000 (15:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/menu.cpp

index 891f908d647f572c4e0960f1b73bd0f33df5842f..fd5997855efe460e1c9b6adfd8a6522cc45f6610 100644 (file)
@@ -198,8 +198,8 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
                 UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos);
                 pos += 1 ;
             }
                 UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), wxT("a"), wxFont::GetDefaultEncoding(), pos);
                 pos += 1 ;
             }
-
-            SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , pItem->GetId() ) ;
+            
+            SetMenuItemCommandID( MAC_WXHMENU(m_hMenu) , pos , wxIdToMacCommand ( pItem->GetId() ) ) ;
             SetMenuItemRefCon( MAC_WXHMENU(m_hMenu) , pos , (UInt32) pItem ) ;
             pItem->UpdateItemText() ;
             pItem->UpdateItemBitmap() ;
             SetMenuItemRefCon( MAC_WXHMENU(m_hMenu) , pos , (UInt32) pItem ) ;
             pItem->UpdateItemText() ;
             pItem->UpdateItemBitmap() ;
@@ -713,7 +713,7 @@ void wxMenuBar::MacInstallMenuBar()
                             if ( mh )
                             {
                                 UMAAppendMenuItem(mh, item->GetText()  , wxFont::GetDefaultEncoding(), entry);
                             if ( mh )
                             {
                                 UMAAppendMenuItem(mh, item->GetText()  , wxFont::GetDefaultEncoding(), entry);
-                                SetMenuItemCommandID( mh , CountMenuItems(mh) , item->GetId() ) ;
+                                SetMenuItemCommandID( mh , CountMenuItems(mh) , wxIdToMacCommand ( item->GetId() ) ) ;
                                 SetMenuItemRefCon( mh , CountMenuItems(mh) , (UInt32)item ) ;
                             }
                         }
                                 SetMenuItemRefCon( mh , CountMenuItems(mh) , (UInt32)item ) ;
                             }
                         }
@@ -739,7 +739,7 @@ void wxMenuBar::MacInstallMenuBar()
             wxAcceleratorEntry* entry = wxGetAccelFromString( aboutMenuItem->GetText() ) ;
             UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , aboutMenuItem->GetText() , wxFont::GetDefaultEncoding() );
             UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
             wxAcceleratorEntry* entry = wxGetAccelFromString( aboutMenuItem->GetText() ) ;
             UMASetMenuItemText( GetMenuHandle( kwxMacAppleMenuId ) , 1 , aboutMenuItem->GetText() , wxFont::GetDefaultEncoding() );
             UMAEnableMenuItem( GetMenuHandle( kwxMacAppleMenuId ) , 1 , true );
-            SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , aboutMenuItem->GetId() ) ;
+            SetMenuItemCommandID( GetMenuHandle( kwxMacAppleMenuId ) , 1 , kHICommandAbout ) ;
             SetMenuItemRefCon(GetMenuHandle( kwxMacAppleMenuId ) , 1 , (UInt32)aboutMenuItem ) ;
             UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
         }
             SetMenuItemRefCon(GetMenuHandle( kwxMacAppleMenuId ) , 1 , (UInt32)aboutMenuItem ) ;
             UMASetMenuItemShortcut( GetMenuHandle( kwxMacAppleMenuId ) , 1 , entry ) ;
         }