]> git.saurik.com Git - wxWidgets.git/commitdiff
On Windows, force read-only property editor wxTextCtrl to have 'white' background...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 12 Dec 2009 10:10:15 +0000 (10:10 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 12 Dec 2009 10:10:15 +0000 (10:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/editors.cpp

index 9f6d5a5a3d892ea670959b8b90426824b65e2b84..bf24f496dd9bd5aec5923f7460260431ac72929c 100644 (file)
@@ -1695,6 +1695,18 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos,
     SetupTextCtrlValue(value);
     tc->Create(ctrlParent,id,value, p, s,tcFlags);
 
+#if defined(__WXMSW__)
+    // On Windows, we need to override read-only text ctrl's background
+    // colour to white. One problem with native 'grey' background is that
+    // tc->GetBackgroundColour() doesn't seem to return correct value
+    // for it.
+    if ( tcFlags & wxTE_READONLY )
+    {
+        wxVisualAttributes vattrs = tc->GetDefaultAttributes();
+        tc->SetBackgroundColour(vattrs.colBg);
+    }
+#endif
+
     // Center the control vertically
     if ( !hasSpecialSize )
         FixPosForTextCtrl(tc, forColumn);