]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/srchctrl.mm
adding HitTest to osx_cocoa implementation of listbox, refactoring code, fixes #11972
[wxWidgets.git] / src / osx / cocoa / srchctrl.mm
index 4ca6328909b98333699dc257d565cee8042880b6..e98a3cf7f3b83ae67a05225087ea5c53cf2fbd49 100644 (file)
@@ -40,7 +40,7 @@
 + (void)initialize
 {
     static BOOL initialized = NO;
 + (void)initialize
 {
     static BOOL initialized = NO;
-    if (!initialized) 
+    if (!initialized)
     {
         initialized = YES;
         wxOSXCocoaClassAddWXMethods( self );
     {
         initialized = YES;
         wxOSXCocoaClassAddWXMethods( self );
@@ -57,6 +57,7 @@
 
 - (void) searchAction: (id) sender
 {
 
 - (void) searchAction: (id) sender
 {
+    (void) sender;
     wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
     wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
     }
 }
 
     }
 }
 
+- (void)controlTextDidChange:(NSNotification *)aNotification
+{
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
+    if ( impl )
+        impl->controlTextDidChange();
+}
+
 @end
 
 // ============================================================================
 @end
 
 // ============================================================================
@@ -101,7 +110,7 @@ public :
             [m_searchFieldCell setSearchButtonCell:nil];
         [m_searchField setNeedsDisplay:YES];
     }
             [m_searchFieldCell setSearchButtonCell:nil];
         [m_searchField setNeedsDisplay:YES];
     }
-    
+
     virtual bool IsSearchButtonVisible() const
     {
         return [m_searchFieldCell searchButtonCell] != nil;
     virtual bool IsSearchButtonVisible() const
     {
         return [m_searchFieldCell searchButtonCell] != nil;
@@ -115,7 +124,7 @@ public :
             [m_searchFieldCell setCancelButtonCell:nil];
         [m_searchField setNeedsDisplay:YES];
     }
             [m_searchFieldCell setCancelButtonCell:nil];
         [m_searchField setNeedsDisplay:YES];
     }
-    
+
     virtual bool IsCancelButtonVisible() const
     {
         return [m_searchFieldCell cancelButtonCell] != nil;
     virtual bool IsCancelButtonVisible() const
     {
         return [m_searchFieldCell cancelButtonCell] != nil;
@@ -135,7 +144,7 @@ public :
         [m_searchFieldCell setPlaceholderString:
             wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
     }
         [m_searchFieldCell setPlaceholderString:
             wxCFStringRef( text , m_wxPeer->GetFont().GetEncoding() ).AsNSString()];
     }
-        
+
     virtual bool SetFocus()
     {
        return  wxNSTextFieldControl::SetFocus();
     virtual bool SetFocus()
     {
        return  wxNSTextFieldControl::SetFocus();
@@ -150,14 +159,14 @@ wxNSSearchFieldControl::~wxNSSearchFieldControl()
 {
 }
 
 {
 }
 
-wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer, 
-                                    wxWindowMac* parent, 
-                                    wxWindowID id, 
+wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
+                                    wxWindowMac* WXUNUSED(parent),
+                                    wxWindowID WXUNUSED(id),
                                     const wxString& str,
                                     const wxString& str,
-                                    const wxPoint& pos, 
+                                    const wxPoint& pos,
                                     const wxSize& size,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle)
+                                    long WXUNUSED(style),
+                                    long WXUNUSED(extraStyle))
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSSearchField* v = [[wxNSSearchField alloc] initWithFrame:r];
 {
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSSearchField* v = [[wxNSSearchField alloc] initWithFrame:r];
@@ -166,6 +175,7 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxTextCtrl* wxpeer,
     [[v cell] setCancelButtonCell:nil];
 
     wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v );
     [[v cell] setCancelButtonCell:nil];
 
     wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v );
+    c->SetNeedsFrame( false );
     c->SetStringValue( str );
     return c;
 }
     c->SetStringValue( str );
     return c;
 }