X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dbeddfb93d3479d03d8ec4c0121dfbe3bbcc422b..1f73290186ebc29e2b90903c2117ec02480b8c71:/src/osx/cocoa/button.mm diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index ec39699324..ffe3c6e397 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -132,6 +132,8 @@ wxSize wxButton::GetDefaultSize() return self; } +WXCOCOAIMPL_COMMON_IMPLEMENTATION + - (void) clickedAction: (id) sender { if ( impl ) @@ -142,21 +144,6 @@ wxSize wxButton::GetDefaultSize() } } -- (void)setImplementation: (wxWidgetImpl *) theImplementation -{ - impl = theImplementation; -} - -- (wxWidgetImpl*) implementation -{ - return impl; -} - -- (BOOL) isFlipped -{ - return YES; -} - - (int) intValue { switch ( [self state] ) @@ -198,8 +185,6 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer, long style, long extraStyle) { - NSView* sv = (wxpeer->GetParent()->GetHandle() ); - NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; @@ -213,7 +198,6 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer, } [v setButtonType:NSMomentaryPushInButton]; - [sv addSubview:v]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); [v setImplementation:c]; return c; @@ -287,15 +271,12 @@ wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer, long style, long extraStyle) { - NSView* sv = (wxpeer->GetParent()->GetHandle() ); - NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; [v setBezelStyle:NSDisclosureBezelStyle]; [v setButtonType:NSOnOffButton]; [v setTitle:wxCFStringRef( label).AsNSString()]; [v setImagePosition:NSImageRight]; - [sv addSubview:v]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); [v setImplementation:c]; return c;