X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b466e85a7e81db84545bc44c83cbe4ccacd4fe8e..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/osx/cocoa/srchctrl.mm diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index c1abb250ff..0ed85e50f3 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -31,34 +31,33 @@ @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 -{ - [self setStringValue: title]; -} - - (void) searchAction: (id) sender { + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { wxSearchCtrl* wxpeer = dynamic_cast( impl->GetWXPeer() ); @@ -166,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; }