Fix wxSearchCtrl appearance under OS X 10.10 Yosemite.

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

See #16871.
This commit is contained in:
John Roberts 2015-07-18 01:06:44 +02:00 committed by Vadim Zeitlin
parent 4f69410cd8
commit 563329f89f

View File

@ -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:&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;
}