]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toolbar.cpp
don't allow clicking disabled buttons
[wxWidgets.git] / src / mac / carbon / toolbar.cpp
index 66bed14b79934a31ab9f9422a198bb7f96c48240..c7dd11d1956600413792b491c32095c004fed488 100644 (file)
@@ -210,37 +210,14 @@ bool wxToolBar::Realize()
             toolrect.bottom = toolrect.top + toolSize.y ;
             
             ControlButtonContentInfo info ;
-            if ( bmap )
-            {
-                if ( bmap->m_bitmapType == kMacBitmapTypePict )
-                {
-                    info.contentType = kControlContentPictHandle ;
-                    info.u.picture = MAC_WXHMETAFILE(bmap->m_hPict) ;
-                }
-                else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
-                {
-                    if ( tool->GetBitmap1().GetMask() )
-                    {
-                        info.contentType = kControlContentCIconHandle ;
-                        info.u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , MAC_WXHBITMAP(tool->GetBitmap1().GetMask()->GetMaskBitmap()) ,
-                                                               8 , 16 ) ;
-                    }
-                    else
-                    {
-                        info.contentType = kControlContentCIconHandle ;
-                        info.u.cIconHandle = wxMacCreateCIcon( MAC_WXHBITMAP(bmap->m_hBitmap) , NULL ,
-                                                               8 , 16 ) ;
-                    }
-                }
-            }
-            
+            wxMacCreateBitmapButton( &info , tool->GetBitmap1() ) ;
             ControlHandle m_macToolHandle ;
             
             SInt16 behaviour = kControlBehaviorOffsetContents ;
             if ( tool->CanBeToggled() )
                 behaviour += kControlBehaviorToggles ;
             
-            if ( info.u.cIconHandle ) // since it is a handle we can use one of them
+            if ( info.contentType != kControlNoContent ) 
             {
                 m_macToolHandle = ::NewControl( window , &toolrect , "\p" , false , 0 , 
                                                 behaviour + info.contentType , 0 , kControlBevelButtonNormalBevelProc , (long) this ) ;