X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36eca861601eb5329d7b87bc6e93cc31c49584f9..9b66a1d31a32e9235792261db6ff755ce26ab5c1:/src/osx/cocoa/bmpbuttn.mm diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index 3de4eafe5f..ab3433bd7f 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -31,15 +31,24 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, long style, long extraStyle) { - NSView* sv = static_cast(wxpeer->GetParent()->GetHandle() ); - 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]; - [sv addSubview:v]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); [v setImplementation:c]; return c;