]> git.saurik.com Git - wxWidgets.git/commitdiff
patch applied with thanks, fixes #10524
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 17 Feb 2011 06:46:09 +0000 (06:46 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 17 Feb 2011 06:46:09 +0000 (06:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/stattext.mm

index 42e5c85254923bb0df5e216ade0ae36beeec29e0..57ba5c40699bd5d33ac31fb075b256281bee87ad 100644 (file)
     }
 }
 
+- (void) setEnabled:(BOOL) flag 
+{ 
+    [super setEnabled: flag]; 
+    
+    if (![self drawsBackground]) { 
+        // Static text is drawn incorrectly when disabled. 
+        // For an explanation, see 
+        // http://www.cocoabuilder.com/archive/message/cocoa/2006/7/21/168028 
+        if (flag)
+        { 
+            [self setTextColor: [NSColor controlTextColor]]; 
+        }
+        else 
+        { 
+            [self setTextColor: [NSColor secondarySelectedControlColor]]; 
+        } 
+    } 
+} 
+
 @end
 
 class wxStaticTextCocoaImpl : public wxWidgetCocoaImpl