X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4850cc8b2e1037cd394806db4ddcf73868588a4c..7e4952db837344e369ff9ccc7ece1f7b8c207cf1:/src/osx/cocoa/srchctrl.mm?ds=sidebyside diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 34758780b9..32d3514b3a 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -31,45 +31,33 @@ @interface wxNSSearchField : NSSearchField { - wxWidgetCocoaImpl* impl; } @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; } -- (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation -{ - impl = theImplementation; -} - -- (wxWidgetCocoaImpl*) implementation -{ - return impl; -} - -- (BOOL) isFlipped -{ - return YES; -} - -// use our common calls -- (void) setTitle:(NSString *) title -{ - [self setStringValue: title]; -} - - (void) searchAction: (id) sender { + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { wxSearchCtrl* wxpeer = dynamic_cast( impl->GetWXPeer() ); @@ -178,8 +166,8 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer, [[v cell] setCancelButtonCell:nil]; wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v ); + c->SetNeedsFrame( false ); c->SetStringValue( str ); - [v setImplementation:c]; return c; }