]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for [ 1052989 ] TextCtrl.SetBackgroundColour(wx.NullColour) bug
authorRyan Norton <wxprojects@comcast.net>
Sun, 7 Nov 2004 14:14:10 +0000 (14:14 +0000)
committerRyan Norton <wxprojects@comcast.net>
Sun, 7 Nov 2004 14:14:10 +0000 (14:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/textctrl.h
src/msw/textctrl.cpp

index e3b5fc68ad8506b3875b253a748d64c29a407ded..316248cf0933522def5f3937672ac0c8c72c6b70 100644 (file)
@@ -252,6 +252,8 @@ protected:
     // code as to why this is needed)
     bool m_suppressNextUpdate;
 
+    virtual wxVisualAttributes GetDefaultAttributes() const;
+
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextCtrl)
index 25aecb4bdfb2e7344edabcad5047bced359c395f..210d3ecf59531e8a00bb385d43a504531bdc3a1c 100644 (file)
@@ -2176,6 +2176,22 @@ bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
     return wxTextCtrlBase::MSWOnNotify(idCtrl, lParam, result);
 }
 
+// ----------------------------------------------------------------------------
+// default colors for MSW text control
+// ----------------------------------------------------------------------------
+
+wxVisualAttributes wxTextCtrl::GetDefaultAttributes() const
+{
+    // it is important to return valid values for all attributes from here,
+    // GetXXX() below rely on this
+    wxVisualAttributes attrs;
+    attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+    attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
+
+    return attrs;
+}
+
 // ----------------------------------------------------------------------------
 // colour setting for the rich edit controls
 // ----------------------------------------------------------------------------