Use correct visual attributes for wxSpinCtrl.

The default colours for this control are wxTextCtrl-like and not wxButton-like
(which is the default). Override GetDefaultAttributes() to indicate this and
to avoid returning a wrong background from wxControl::DoMSWControlColor() when
just a foreground is set.

See #1691.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61858 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-09-08 12:23:06 +00:00
parent 9d7cb6715f
commit ddc4214a4f

View File

@@ -79,6 +79,18 @@ public:
// wxSpinButton doesn't accept focus, but we do
virtual bool AcceptsFocus() const { return wxWindow::AcceptsFocus(); }
// we're like wxTextCtrl and not (default) wxButton
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
{
return GetCompositeControlsDefaultAttributes(variant);
}
// for internal use only
// get the subclassed window proc of the buddy text