]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/srchctrl.mm
add alignment flags support to wxSpinCtrl[Double] (closes #10621)
[wxWidgets.git] / src / osx / cocoa / srchctrl.mm
index 34758780b96fb23579d429deaced3a551492006d..32d3514b3a5807245936bcba5e4a10c5bab3aa75 100644 (file)
 
 @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<wxSearchCtrl*>( 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;
 }