X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e23949a984101c8146869ad6d37753838f0a7ec..d6d3b323020f6851f04b7111bb432ac0bbd63eb5:/src/osx/cocoa/bmpbuttn.mm diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index f6fbea3476..d3c0092ba0 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -22,14 +22,14 @@ #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]; @@ -38,18 +38,22 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, if ( style & wxBORDER_NONE ) { [v setBezelStyle:NSShadowlessSquareBezelStyle]; + [v setBordered:NO]; } else { - if ( style & wxBU_AUTODRAW ) - [v setBezelStyle:NSShadowlessSquareBezelStyle]; - else + // see trac #11128 for a thorough discussion + if ( (style & wxBORDER_MASK) == wxBORDER_RAISED ) [v setBezelStyle:NSRegularSquareBezelStyle]; + else if ( (style & wxBORDER_MASK) == wxBORDER_SUNKEN ) + [v setBezelStyle:NSSmallSquareBezelStyle]; + else + [v setBezelStyle:NSShadowlessSquareBezelStyle]; } - + if (bitmap.Ok()) [v setImage:bitmap.GetNSImage() ]; - + [v setButtonType:NSMomentaryPushInButton]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); return c;