From 1a289c624bca8583cd7f2cd6bfc22a70fc1a41db Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 6 Apr 2010 21:17:59 +0000 Subject: [PATCH] supporting text foreground color, fixes #11903 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/window.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index a5148d5ee3..14396fd9bb 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -131,6 +131,7 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const - (void)setAction:(SEL)aSelector; - (void)setDoubleAction:(SEL)aSelector; - (void)setBackgroundColor:(NSColor*)aColor; +- (void)setTextColor:(NSColor *)color; - (void)setImagePosition:(NSCellImagePosition)aPosition; @end @@ -1888,10 +1889,15 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant ) } } -void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&, long, bool) +void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&col, long, bool) { if ([m_osxView respondsToSelector:@selector(setFont:)]) [m_osxView setFont: font.OSXGetNSFont()]; + if ([m_osxView respondsToSelector:@selector(setTextColor:)]) + [m_osxView setTextColor:[NSColor colorWithCalibratedRed:(CGFloat) (col.Red() / 255.0) + green:(CGFloat) (col.Green() / 255.0) + blue:(CGFloat) (col.Blue() / 255.0) + alpha:(CGFloat) (col.Alpha() / 255.0)]]; } void wxWidgetCocoaImpl::SetToolTip(wxToolTip* tooltip)