Added wxComboCtrlBase::m_hasTcBgCol. Re-using base wxWindow::m_hasBgCol was trouble.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2011-03-20 11:15:17 +00:00
parent 10ba26777d
commit bed867e3f9
2 changed files with 8 additions and 4 deletions

View File

@ -713,6 +713,9 @@ protected:
// should the focus be reset to the textctrl in idle time?
bool m_resetFocus;
// is the text-area background colour overridden?
bool m_hasTcBgCol;
private:
void Init();

View File

@ -988,6 +988,7 @@ void wxComboCtrlBase::Init()
m_timeCanAcceptClick = 0;
m_resetFocus = false;
m_hasTcBgCol = false;
}
bool wxComboCtrlBase::Create(wxWindow *parent,
@ -1083,7 +1084,7 @@ void wxComboCtrlBase::OnThemeChange()
vattrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
#endif
if ( !m_hasBgCol )
if ( !m_hasTcBgCol )
m_tcBgCol = vattrs.colBg;
#ifndef __WXMAC__
@ -1483,7 +1484,7 @@ bool wxComboCtrlBase::SetBackgroundColour(const wxColour& colour)
if ( m_text )
m_text->SetBackgroundColour(colour);
m_tcBgCol = colour;
m_hasBgCol = true;
m_hasTcBgCol = true;
return true;
}
@ -1577,10 +1578,10 @@ void wxComboCtrlBase::PrepareBackground( wxDC& dc, const wxRect& rect, int flags
{
bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
}
else if ( m_hasBgCol )
else if ( m_hasTcBgCol )
{
// Honour the custom background colour
bgCol = GetBackgroundColour();
bgCol = m_tcBgCol;
}
else
{