X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36eca861601eb5329d7b87bc6e93cc31c49584f9..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/cocoa/bmpbuttn.mm diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index 3de4eafe5f..f6fbea3476 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -31,17 +31,27 @@ 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]; + } + + if (bitmap.Ok()) + [v setImage:bitmap.GetNSImage() ]; - [v setBezelStyle:NSRegularSquareBezelStyle]; - [v setImage:bitmap.GetNSImage() ]; [v setButtonType:NSMomentaryPushInButton]; - [sv addSubview:v]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); - [v setImplementation:c]; return c; }