/////////////////////////////////////////////////////////////////////////////
-// Name: src/mac/carbon/bmpbuttn.cpp
+// Name: src/osx/carbon/bmpbuttn.cpp
// Purpose: wxBitmapButton
// Author: Stefan Csomor
// Modified by:
long style,
long extraStyle)
{
- NSView* sv = (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];
+ if (bitmap.Ok())
+ [v setImage:bitmap.GetNSImage() ];
[v setButtonType:NSMomentaryPushInButton];
- [sv addSubview:v];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
- [v setImplementation:c];
return c;
}