]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/bmpbuttn.mm
Applied #10639 (Not all previewed fonts are displayed with the correct nameface)
[wxWidgets.git] / src / osx / cocoa / bmpbuttn.mm
index 0c1f471a3ea87a7d70b14c7dfef0354c9e8c96b9..1cbc2dfa81cf5a118d919cf4958cd6cdcafda84b 100644 (file)
 
 #include "wx/osx/private.h"
 
-wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, 
-                                    wxWindowMac* parent, 
-                                    wxWindowID id, 
+wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer,
+                                    wxWindowMac* WXUNUSED(parent),
+                                    wxWindowID WXUNUSED(id),
                                     const wxBitmap& bitmap,
-                                    const wxPoint& pos, 
+                                    const wxPoint& pos,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle) 
+                                    long style,
+                                    long WXUNUSED(extraStyle))
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
-    
-    [v setBezelStyle:NSRegularSquareBezelStyle];
-    [v setImage:bitmap.GetNSImage() ];
+
+    // 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];
+    }
+
+    if (bitmap.Ok())
+        [v setImage:bitmap.GetNSImage() ];
+
     [v setButtonType:NSMomentaryPushInButton];
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }