]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
last fix resulted in wrongly inheriting bg colour from the parent with m_inheritBgCol...
[wxWidgets.git] / src / msw / textctrl.cpp
index 18912b2bd1425e23d9b1e2b97668394cc8a11829..ef70b6f9e34cacc659f9455e60fef9faf5f61de6 100644 (file)
@@ -39,6 +39,7 @@
     #include "wx/log.h"
     #include "wx/app.h"
     #include "wx/menu.h"
+    #include "wx/math.h"
 #endif
 
 #include "wx/module.h"
@@ -2078,6 +2079,23 @@ void wxTextCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event))
     }
 }
 
+// ----------------------------------------------------------------------------
+// Default colors for MSW text control
+//
+// Set default background color to the native white instead of
+// the default wxSYS_COLOUR_BTNFACE (is triggered with wxNullColour). 
+// ----------------------------------------------------------------------------
+
+wxVisualAttributes wxTextCtrl::GetDefaultAttributes() const
+{
+    wxVisualAttributes attrs;
+    attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+    attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); //white
+
+    return attrs;
+}
+
 // the rest of the file only deals with the rich edit controls
 #if wxUSE_RICHEDIT
 
@@ -2181,23 +2199,6 @@ bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
     return wxTextCtrlBase::MSWOnNotify(idCtrl, lParam, result);
 }
 
-// ----------------------------------------------------------------------------
-// Default colors for MSW text control
-//
-// Set default background color to the native white instead of
-// the default wxSYS_COLOUR_BTNFACE (is triggered with wxNullColour). 
-// ----------------------------------------------------------------------------
-
-wxVisualAttributes wxTextCtrl::GetDefaultAttributes() const
-{
-    wxVisualAttributes attrs;
-    attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
-    attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
-    attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); //white
-
-    return attrs;
-}
-
 // ----------------------------------------------------------------------------
 // colour setting for the rich edit controls
 // ----------------------------------------------------------------------------