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:
@@ -713,6 +713,9 @@ protected:
|
|||||||
// should the focus be reset to the textctrl in idle time?
|
// should the focus be reset to the textctrl in idle time?
|
||||||
bool m_resetFocus;
|
bool m_resetFocus;
|
||||||
|
|
||||||
|
// is the text-area background colour overridden?
|
||||||
|
bool m_hasTcBgCol;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
@@ -988,6 +988,7 @@ void wxComboCtrlBase::Init()
|
|||||||
m_timeCanAcceptClick = 0;
|
m_timeCanAcceptClick = 0;
|
||||||
|
|
||||||
m_resetFocus = false;
|
m_resetFocus = false;
|
||||||
|
m_hasTcBgCol = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxComboCtrlBase::Create(wxWindow *parent,
|
bool wxComboCtrlBase::Create(wxWindow *parent,
|
||||||
@@ -1083,7 +1084,7 @@ void wxComboCtrlBase::OnThemeChange()
|
|||||||
vattrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
vattrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( !m_hasBgCol )
|
if ( !m_hasTcBgCol )
|
||||||
m_tcBgCol = vattrs.colBg;
|
m_tcBgCol = vattrs.colBg;
|
||||||
|
|
||||||
#ifndef __WXMAC__
|
#ifndef __WXMAC__
|
||||||
@@ -1483,7 +1484,7 @@ bool wxComboCtrlBase::SetBackgroundColour(const wxColour& colour)
|
|||||||
if ( m_text )
|
if ( m_text )
|
||||||
m_text->SetBackgroundColour(colour);
|
m_text->SetBackgroundColour(colour);
|
||||||
m_tcBgCol = colour;
|
m_tcBgCol = colour;
|
||||||
m_hasBgCol = true;
|
m_hasTcBgCol = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1577,10 +1578,10 @@ void wxComboCtrlBase::PrepareBackground( wxDC& dc, const wxRect& rect, int flags
|
|||||||
{
|
{
|
||||||
bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
|
bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
|
||||||
}
|
}
|
||||||
else if ( m_hasBgCol )
|
else if ( m_hasTcBgCol )
|
||||||
{
|
{
|
||||||
// Honour the custom background colour
|
// Honour the custom background colour
|
||||||
bgCol = GetBackgroundColour();
|
bgCol = m_tcBgCol;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user