Added wxMSW wxChoice::GetClassDefaultAttributes(), initially used in wxComboCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-12-21 15:20:37 +00:00
parent 163bd4f700
commit 2ec335db78
5 changed files with 57 additions and 29 deletions

View File

@@ -913,13 +913,27 @@ void wxComboCtrlBase::OnThemeChange()
// be the correct colour and themed brush. Instead we'll use
// wxSYS_COLOUR_WINDOW in the EVT_PAINT handler as needed.
#ifndef __WXMAC__
#if defined(__WXMSW__) || defined(__WXGTK__)
wxVisualAttributes vattrs = wxComboBox::GetClassDefaultAttributes();
#else
wxVisualAttributes vattrs;
vattrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
vattrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
#endif
// Only change the colours if application has not specified
// custom ones.
if ( !m_hasFgCol )
{
SetOwnForegroundColour(vattrs.colFg);
m_hasFgCol = false;
}
if ( !m_hasBgCol )
{
wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
SetOwnBackgroundColour(bgCol);
SetOwnBackgroundColour(vattrs.colBg);
m_hasBgCol = false;
}
#endif
#endif // !__WXMAC__
}
wxComboCtrlBase::~wxComboCtrlBase()