]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/bmpbuttn.mm
compilation fix for old SDKs (VC6...) which don't define HDM_SETBITMAPMARGIN/Header_S...
[wxWidgets.git] / src / osx / cocoa / bmpbuttn.mm
index 0c1f471a3ea87a7d70b14c7dfef0354c9e8c96b9..ab3433bd7fb7134dc7edcc86e088aa5b89cba3ae 100644 (file)
@@ -33,8 +33,20 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
+
+    // trying to get as close as possible to flags
+    if ( style & wxBORDER_NONE )
+    {
+        [v setBezelStyle:NSShadowlessSquareBezelStyle];
+    }
+    else
+    {
+        if ( style & wxBU_AUTODRAW )
+            [v setBezelStyle:NSShadowlessSquareBezelStyle];
+        else
+            [v setBezelStyle:NSRegularSquareBezelStyle];
+    }
     
-    [v setBezelStyle:NSRegularSquareBezelStyle];
     [v setImage:bitmap.GetNSImage() ];
     [v setButtonType:NSMomentaryPushInButton];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );