X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4850cc8b2e1037cd394806db4ddcf73868588a4c..f8d0234d39c66f3d1d7fc2346562cb96c8c7be20:/src/osx/cocoa/srchctrl.mm diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 34758780b9..0ed85e50f3 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() ); @@ -177,9 +165,11 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer, // per wx default cancel is not shown [[v cell] setCancelButtonCell:nil]; + [v setBezeled:NO]; + [v setBordered:NO]; + wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v ); c->SetStringValue( str ); - [v setImplementation:c]; return c; }