diff --git a/include/wx/combo.h b/include/wx/combo.h index 797658c901..718adde355 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -483,6 +483,10 @@ protected: // override the base class virtuals involved in geometry calculations virtual wxSize DoGetBestSize() const; + // also set the embedded wxTextCtrl colours + virtual bool SetForegroundColour(const wxColour& colour); + virtual bool SetBackgroundColour(const wxColour& colour); + // NULL popup can be used to indicate default in a derived class virtual void DoSetPopupControl(wxComboPopup* popup); diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 71b6075086..10f41f8473 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1322,6 +1322,27 @@ wxValidator* wxComboCtrlBase::GetValidator() } #endif // wxUSE_VALIDATORS +bool wxComboCtrlBase::SetForegroundColour(const wxColour& colour) +{ + if ( wxControl::SetForegroundColour(colour) ) + { + if ( m_text ) + m_text->SetForegroundColour(colour); + return true; + } + return false; +} + +bool wxComboCtrlBase::SetBackgroundColour(const wxColour& colour) +{ + if ( wxControl::SetBackgroundColour(colour) ) + { + if ( m_text ) + m_text->SetBackgroundColour(colour); + return true; + } + return false; +} // ---------------------------------------------------------------------------- // painting // ----------------------------------------------------------------------------