From eee388cfcfd097ac7d0c1f24d45f9dbdab500d65 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 20 May 2008 13:04:32 +0000 Subject: [PATCH] allows resetting color of text to black, closes #4826 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index ca84d36b66..cc2ebf3d5c 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -1274,6 +1274,25 @@ int wxMacTextControl::GetLineLength(long lineNo) const return 0 ; } +void wxMacTextControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle ) +{ + wxMacControl::SetFont(font, foreground, windowStyle ); +#ifndef __LP64__ + + // overrule the barrier in wxMacControl for supporting disabled controls, in order to support + // setting the color to eg red and back to black by controllers + + if ( foreground == *wxBLACK ) + { + ControlFontStyleRec fontStyle; + fontStyle.foreColor.red = fontStyle.foreColor.green = fontStyle.foreColor.blue = 0; + fontStyle.flags = kControlUseForeColorMask; + ::SetControlFontStyle( m_controlRef , &fontStyle ); + } + +#endif +} + // ---------------------------------------------------------------------------- // standard unicode control implementation // ----------------------------------------------------------------------------