diff --git a/docs/changes.txt b/docs/changes.txt index caef19bec6..31c1f2d6a8 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -636,6 +636,7 @@ wxOSX: - Fix length of text in wxTextDataObject. - Fix using wxHTTP and wxFTP from worker thread. - Fix wxFileDialog::GetFilterIndex() for file open dialogs (phsilva). +- Fix wxSearchCtrl appearance under 10.10 (John Roberts). - Generate correct events for WXK_NUMPAD_ENTER (John Roberts). - Fix handling of WXK_NUMPAD_ENTER in wxTextCtrl (John Roberts). - Fix printing all pages non-interactively (John Roberts). diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 880d590773..2525391bef 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -165,7 +165,25 @@ public : } } } - + + virtual void SetCentredLook( bool centre ) + { + SEL sel = @selector(setCenteredLook:); + if ( [m_searchFieldCell respondsToSelector: sel] ) + { + // all this avoids xcode parsing warnings when using + // [m_searchFieldCell setCenteredLook:NO]; + NSMethodSignature* signature = + [NSSearchFieldCell instanceMethodSignatureForSelector:sel]; + NSInvocation* invocation = + [NSInvocation invocationWithMethodSignature: signature]; + [invocation setTarget: m_searchFieldCell]; + [invocation setSelector:sel]; + [invocation setArgument:¢re atIndex:2]; + [invocation invoke]; + } + } + private: wxNSSearchField* m_searchField; NSSearchFieldCell* m_searchFieldCell; @@ -192,6 +210,7 @@ wxWidgetImplType* wxWidgetImpl::CreateSearchControl( wxSearchCtrl* wxpeer, wxNSSearchFieldControl* c = new wxNSSearchFieldControl( wxpeer, v ); c->SetNeedsFrame( false ); + c->SetCentredLook( false ); c->SetStringValue( str ); return c; }