#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];
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];
}
-
- [v setImage:bitmap.GetNSImage() ];
+
+ if (bitmap.Ok())
+ [v setImage:bitmap.GetNSImage() ];
+
[v setButtonType:NSMomentaryPushInButton];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
return c;