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

@@ -31,26 +31,30 @@
@interface wxNSSearchField : NSSearchField
{
WXCOCOAIMPL_COMMON_MEMBERS
}
WXCOCOAIMPL_COMMON_INTERFACE
@end
@implementation wxNSSearchField
+ (void)initialize
{
static BOOL initialized = NO;
if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
}
}
- (id)initWithFrame:(NSRect)frame
{
[super initWithFrame:frame];
impl = NULL;
[self setTarget: self];
[self setAction: @selector(searchAction:)];
return self;
}
WXCOCOAIMPL_COMMON_IMPLEMENTATION
// use our common calls
- (void) setTitle:(NSString *) title
{
@@ -59,6 +63,7 @@ WXCOCOAIMPL_COMMON_IMPLEMENTATION
- (void) searchAction: (id) sender
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if ( impl )
{
wxSearchCtrl* wxpeer = dynamic_cast<wxSearchCtrl*>( impl->GetWXPeer() );
@@ -168,7 +173,6 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v );
c->SetStringValue( str );
[v setImplementation:c];
return c;
}