]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Various other tweaks and updates
[wxWidgets.git] / src / msw / textctrl.cpp
index 1ec178c99f522b72c84f286ac9bdaaf7add96575..bc78ce19b0386d5c5629d8c9496fd72ca0cc097f 100644 (file)
@@ -297,9 +297,22 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
         m_isRich = FALSE;
 #endif // wxUSE_RICHEDIT
 
-    if ( !MSWCreateControl(windowClass, msStyle, pos, size, value) )
+    // we need to turn '\n's into "\r\n"s for the multiline controls
+    wxString valueWin;
+    if ( m_windowStyle & wxTE_MULTILINE )
+    {
+        valueWin = wxTextFile::Translate(value, wxTextFileType_Dos);
+    }
+    else // single line
+    {
+        valueWin = value;
+    }
+
+    if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) )
         return FALSE;
 
+    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+
 #if wxUSE_RICHEDIT
     if (m_isRich)
     {