]> git.saurik.com Git - wxWidgets.git/commitdiff
allows resetting color of text to black, closes #4826
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 20 May 2008 13:23:46 +0000 (13:23 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 20 May 2008 13:23:46 +0000 (13:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/textctrl.cpp

index 6aac442420314221f6fdb3b41583e0a4e894de5e..2f76bf0fb16823f01658d3d46b8ce3e69b0e609e 100644 (file)
@@ -1254,6 +1254,24 @@ 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
 // ----------------------------------------------------------------------------