reworking event handling to redirect to c++ virtual functions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-02-07 13:25:58 +00:00
parent 58fbf2616f
commit 4dd9fdf827
29 changed files with 878 additions and 779 deletions

View File

@@ -123,24 +123,13 @@ wxSize wxButton::GetDefaultSize()
@implementation wxNSButton
- (id)initWithFrame:(NSRect)frame
+ (void)initialize
{
[super initWithFrame:frame];
impl = NULL;
[self setTarget: self];
[self setAction: @selector(clickedAction:)];
return self;
}
WXCOCOAIMPL_COMMON_IMPLEMENTATION
- (void) clickedAction: (id) sender
{
if ( impl )
static BOOL initialized = NO;
if (!initialized)
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer )
wxpeer->OSXHandleClicked(0);
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
}
}
@@ -199,7 +188,6 @@ wxWidgetImplType* wxWidgetImpl::CreateButton( wxWindowMac* wxpeer,
[v setButtonType:NSMomentaryPushInButton];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
[v setImplementation:c];
return c;
/*
OSStatus err;
@@ -278,6 +266,5 @@ wxWidgetImplType* wxWidgetImpl::CreateDisclosureTriangle( wxWindowMac* wxpeer,
[v setTitle:wxCFStringRef( label).AsNSString()];
[v setImagePosition:NSImageRight];
wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
[v setImplementation:c];
return c;
}