X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7b6126aa3adb67be63054dedc86d5ed90c65de22..9914bfbb77f48baf869b63aff58feb2b145ff4d3:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 90e8c472d6..8ffbfce0c1 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -544,7 +544,20 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, ::SendMessage(GetHwnd(), EM_SETEVENTMASK, 0, mask); } + else #endif // wxUSE_RICHEDIT + if ( HasFlag(wxTE_MULTILINE) && HasFlag(wxTE_READONLY) ) + { + // non-rich read-only multiline controls have grey background by + // default under MSW but this is not always appropriate, so forcefully + // reset the background colour to normal default + // + // this is not ideal but, after a long discussion on wx-dev (see + // http://thread.gmane.org/gmane.comp.lib.wxwidgets.devel/116360/) it + // was finally deemed to be the best behaviour by default (and ideally + // we'd have a way to change this, see #11521) + SetBackgroundColour(GetClassDefaultAttributes().colBg); + } #ifndef __WXWINCE__ // Without this, if we pass the size in the constructor and then don't change it, @@ -2197,23 +2210,6 @@ void wxTextCtrl::OnSetFocus(wxFocusEvent& event) event.Skip(); } -// ---------------------------------------------------------------------------- -// 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 @@ -2811,7 +2807,7 @@ bool wxRichEditModule::Load(Version version) return true; } - static const wxChar *dllnames[] = + static const wxChar *const dllnames[] = { wxT("riched32"), wxT("riched20"),