diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 8f3f531615..5354104c74 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -179,7 +179,6 @@ public: virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - virtual wxVisualAttributes GetDefaultAttributes() const; protected: // common part of all ctors diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 0a1695db17..af00d41d06 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -705,6 +705,18 @@ public: wxTextEntry::SetValue(value); } + // wxWindow overrides + virtual wxVisualAttributes GetDefaultAttributes() const + { + return GetClassDefaultAttributes(GetWindowVariant()); + } + + static wxVisualAttributes + GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL) + { + return GetCompositeControlsDefaultAttributes(variant); + } + protected: // override streambuf method #if wxHAS_TEXT_WINDOW_STREAM diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index b8c027b98c..4c910b173e 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2197,23 +2197,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