Fix wxSearchCtrl appearance under OS X 10.10 Yosemite.

Avoid centered look which renders the control unusable under this version.

Closes #16871.

(this is a backport of 563329f89f from master)
This commit is contained in:
John Roberts
2015-07-18 01:06:44 +02:00
committed by Vadim Zeitlin
parent 38e410a273
commit f313ecf9b6
2 changed files with 21 additions and 1 deletions

View File

@@ -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).

View File

@@ -166,6 +166,24 @@ 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:&centre 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;
}