]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/srchctrl.mm
move wxGridCellRenderer::Draw before other derived classes implementations (no real...
[wxWidgets.git] / src / osx / cocoa / srchctrl.mm
index 0c33e9859943fb46c37892f1b5ddc60622387443..0ed85e50f37c82a9fa5c8b81f993942cfcf19b0e 100644 (file)
 
 @interface wxNSSearchField : NSSearchField
 {
-    wxWidgetImpl* 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: (wxWidgetImpl *) theImplementation
-{
-    impl = theImplementation;
-}
-
-- (wxWidgetImpl*) 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() );
@@ -171,18 +159,17 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
                                     long style, 
                                     long extraStyle)
 {
-    NSView* sv = (wxpeer->GetParent()->GetHandle() );
-    
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSSearchField* v = [[wxNSSearchField alloc] initWithFrame:r];
-    [sv addSubview:v];
     [[v cell] setSendsWholeSearchString:YES];
     // 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;
 }