]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/menu.cpp
corrected warnings
[wxWidgets.git] / src / mac / carbon / menu.cpp
index e31651102caa61ddb110b34760d1cd802045718a..caadf18ce3b69cddef6565e5583ba2c757fa3d97 100644 (file)
@@ -70,7 +70,6 @@ void wxMenu::Init()
        Str255  label;
        wxMenuItem::MacBuildMenuString( label, NULL , NULL , m_title , false );
        m_macMenuId = s_macNextMenuId++; 
-    wxCHECK_RET( s_macNextMenuId < 236 , "menu ids > 235 cannot be used for submenus on mac" );
        m_hMenu = ::NewMenu(m_macMenuId, label);
 
     if ( !m_hMenu )
@@ -210,10 +209,34 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
                        if ( pos == (size_t)-1 )
                        {
                                UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), label,key,modifiers);
+                               if ( pItem->GetBitmap().Ok() )
+                               {
+                                       ControlButtonContentInfo info ;
+                                       wxMacCreateBitmapButton( &info , pItem->GetBitmap() , true ) ;
+                                       if ( info.contentType != kControlNoContent )
+                                       {
+                                               if ( info.contentType == kControlContentCIconHandle )
+                                                       SetMenuItemIconHandle( MAC_WXHMENU(m_hMenu) , CountMenuItems(MAC_WXHMENU(m_hMenu) ) ,
+                                                               kMenuColorIconType , (Handle) info.u.cIconHandle ) ;
+                                   }
+                                               
+                               }
                        }
                        else
                        {
                                UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), label , pos,key,modifiers);
+                               if ( pItem->GetBitmap().Ok() )
+                               {
+                                       ControlButtonContentInfo info ;
+                                       wxMacCreateBitmapButton( &info , pItem->GetBitmap() , true ) ;
+                                       if ( info.contentType != kControlNoContent )
+                                       {
+                                               if ( info.contentType == kControlContentCIconHandle )
+                                                       SetMenuItemIconHandle( MAC_WXHMENU(m_hMenu) , pos ,
+                                                               kMenuColorIconType , (Handle) info.u.cIconHandle ) ;
+                                   }
+                                               
+                               }
                        }
                        if ( pItem->GetId() == idMenuTitle ) 
                        {