1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/infobar.h
3 // Purpose: native implementation of wxInfoBar for GTK+ 2.18 and later
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_INFOBAR_H_
11 #define _WX_GTK_INFOBAR_H_
13 #include "wx/generic/infobar.h"
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // notice that the native GTK+ implementation is only available since
20 // (relatively recent) 2.18 so we inherit from the generic one to be able to
21 // fall back to it if GTK+ version is determined to be too old during run-time
22 class WXDLLIMPEXP_CORE wxInfoBar
: public wxInfoBarGeneric
25 wxInfoBar() { Init(); }
27 wxInfoBar(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
)
30 Create(parent
, winid
);
33 bool Create(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
);
37 // implement base class methods
38 // ----------------------------
40 virtual void ShowMessage(const wxString
& msg
,
41 int flags
= wxICON_INFORMATION
);
43 virtual void Dismiss();
45 virtual void AddButton(wxWindowID btnid
,
46 const wxString
& label
= wxString());
48 virtual void RemoveButton(wxWindowID btnid
);
50 // implementation only
51 // -------------------
53 void GTKResponse(int btnid
);
56 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
59 void Init() { m_impl
= NULL
; }
61 // add a button with the given id/label and return its widget
62 GtkWidget
*GTKAddButton(wxWindowID btnid
,
63 const wxString
& label
= wxString());
66 // only used when the native implementation is really being used
67 class wxInfoBarGTKImpl
*m_impl
;
69 wxDECLARE_NO_COPY_CLASS(wxInfoBar
);
72 #endif // _WX_GTK_INFOBAR_H_