From: Jaakko Salli Date: Fri, 25 Dec 2009 09:04:53 +0000 (+0000) Subject: Added wxComboCtrlBase::SetFore/BackgroundColour() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5f54075053e041086bb71f107c3d70faedf0d9b9 Added wxComboCtrlBase::SetFore/BackgroundColour() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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 // ----------------------------------------------------------------------------