Move wxMSW wxTextCtrl::GetDefaultAttributes() to wxTextCtrlBase.
This commit doesn't introduce any changes in the control behaviour, it simply moves the existing method to the base class because it is not MSW-specific. Also implement wxTextCtrlBase::GetClassDefaultAttributes() because if a class implements GetDefaultAttributes() it should implement it as well. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -179,7 +179,6 @@ public:
|
|||||||
|
|
||||||
virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg);
|
virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg);
|
||||||
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
||||||
virtual wxVisualAttributes GetDefaultAttributes() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
|
@@ -705,6 +705,18 @@ public:
|
|||||||
wxTextEntry::SetValue(value);
|
wxTextEntry::SetValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wxWindow overrides
|
||||||
|
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||||
|
{
|
||||||
|
return GetClassDefaultAttributes(GetWindowVariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
static wxVisualAttributes
|
||||||
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
|
||||||
|
{
|
||||||
|
return GetCompositeControlsDefaultAttributes(variant);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// override streambuf method
|
// override streambuf method
|
||||||
#if wxHAS_TEXT_WINDOW_STREAM
|
#if wxHAS_TEXT_WINDOW_STREAM
|
||||||
|
@@ -2197,23 +2197,6 @@ void wxTextCtrl::OnSetFocus(wxFocusEvent& event)
|
|||||||
event.Skip();
|
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
|
// the rest of the file only deals with the rich edit controls
|
||||||
#if wxUSE_RICHEDIT
|
#if wxUSE_RICHEDIT
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user