From: Vadim Zeitlin Date: Mon, 5 Oct 2009 22:54:24 +0000 (+0000) Subject: Made wxInfoBar::SetFont() change the text message font. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/df8c364bf488d99d6b0c305898a5289fe20a393b Made wxInfoBar::SetFont() change the text message font. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/infobar.h b/include/wx/generic/infobar.h index 9b2109028f..f107549907 100644 --- a/include/wx/generic/infobar.h +++ b/include/wx/generic/infobar.h @@ -66,6 +66,14 @@ public: // get the currently used effect animation duration int GetEffectDuration() const { return m_effectDuration; } + + // overridden base class methods + // ----------------------------- + + // setting the font of this window sets it for the text control inside it + // (default font is a larger and bold version of the normal one) + virtual bool SetFont(const wxFont& font); + private: // common part of all ctors void Init(); diff --git a/src/generic/infobar.cpp b/src/generic/infobar.cpp index db8708a56b..549f20617d 100644 --- a/src/generic/infobar.cpp +++ b/src/generic/infobar.cpp @@ -108,6 +108,18 @@ bool wxInfoBar::Create(wxWindow *parent, wxWindowID winid) return true; } +bool wxInfoBar::SetFont(const wxFont& font) +{ + if ( !wxInfoBarBase::SetFont(font) ) + return false; + + // check that we're not called before Create() + if ( m_text ) + m_text->SetFont(font); + + return true; +} + void wxInfoBar::UpdateParent() { wxWindow * const parent = wxGetTopLevelParent(GetParent());