1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/infobar.h
3 // Purpose: generic wxInfoBar class declaration
4 // Author: Vadim Zeitlin
6 // RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $
7 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_INFOBAR_H_
12 #define _WX_GENERIC_INFOBAR_H_
14 class WXDLLIMPEXP_FWD_CORE wxBitmapButton
;
15 class WXDLLIMPEXP_FWD_CORE wxStaticBitmap
;
16 class WXDLLIMPEXP_FWD_CORE wxStaticText
;
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
22 class WXDLLIMPEXP_ADV wxInfoBar
: public wxInfoBarBase
25 // the usual ctors and Create() but remember that info bar is created
27 wxInfoBar() { Init(); }
29 wxInfoBar(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
)
32 Create(parent
, winid
);
35 bool Create(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
);
38 // implement base class methods
39 // ----------------------------
41 virtual void ShowMessage(const wxString
& msg
, int flags
= wxICON_NONE
);
44 // methods specific to this version
45 // --------------------------------
47 // set the effect(s) to use when showing/hiding the bar, may be
48 // wxSHOW_EFFECT_NONE to disable any effects entirely
50 // by default, slide to bottom/top is used when it's positioned on the top
51 // of the window for showing/hiding it and top/bottom when it's positioned
53 void SetShowHideEffects(wxShowEffect showEffect
, wxShowEffect hideEffect
)
55 m_showEffect
= showEffect
;
56 m_hideEffect
= hideEffect
;
59 // get effect used when showing/hiding the window
60 wxShowEffect
GetShowEffect() const { return m_showEffect
; }
61 wxShowEffect
GetHideEffect() const { return m_hideEffect
; }
63 // set the duration of animation used when showing/hiding the bar, in ms
64 void SetEffectDuration(int duration
) { m_effectDuration
= duration
; }
66 // get the currently used effect animation duration
67 int GetEffectDuration() const { return m_effectDuration
; }
70 // overridden base class methods
71 // -----------------------------
73 // setting the font of this window sets it for the text control inside it
74 // (default font is a larger and bold version of the normal one)
75 virtual bool SetFont(const wxFont
& font
);
78 // common part of all ctors
81 // handler for the close button
82 void OnButton(wxCommandEvent
& event
);
84 // update the parent after we're shown or hidden
87 // change the parent background colour to match that of our sibling
88 void ChangeParentBackground();
90 // restore the parent background changed by the above function
91 void RestoreParentBackground();
98 // different controls making up the bar
99 wxStaticBitmap
*m_icon
;
100 wxStaticText
*m_text
;
101 wxBitmapButton
*m_button
;
103 // the effects to use when showing/hiding and duration for them
104 wxShowEffect m_showEffect
,
106 int m_effectDuration
;
108 // the original parent background colour, before we changed it
109 wxColour m_origParentBgCol
;
111 wxDECLARE_NO_COPY_CLASS(wxInfoBar
);
114 #endif // _WX_GENERIC_INFOBAR_H_