1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/infobar.h
3 // Purpose: native implementation of wxInfoBar for GTK+ 2.18 and later
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_INFOBAR_H_
12 #define _WX_GTK_INFOBAR_H_
14 #include "wx/generic/infobar.h"
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // notice that the native GTK+ implementation is only available since
21 // (relatively recent) 2.18 so we inherit from the generic one to be able to
22 // fall back to it if GTK+ version is determined to be too old during run-time
23 class WXDLLIMPEXP_CORE wxInfoBar
: public wxInfoBarGeneric
26 wxInfoBar() { Init(); }
28 wxInfoBar(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
)
31 Create(parent
, winid
);
34 bool Create(wxWindow
*parent
, wxWindowID winid
= wxID_ANY
);
38 // implement base class methods
39 // ----------------------------
41 virtual void ShowMessage(const wxString
& msg
,
42 int flags
= wxICON_INFORMATION
);
44 virtual void Dismiss();
46 virtual void AddButton(wxWindowID btnid
,
47 const wxString
& label
= wxString());
49 virtual void RemoveButton(wxWindowID btnid
);
51 // implementation only
52 // -------------------
54 void GTKResponse(int btnid
);
57 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
60 void Init() { m_impl
= NULL
; }
62 // add a button with the given id/label and return its widget
63 GtkWidget
*GTKAddButton(wxWindowID btnid
,
64 const wxString
& label
= wxString());
67 // only used when the native implementation is really being used
68 class wxInfoBarGTKImpl
*m_impl
;
70 wxDECLARE_NO_COPY_CLASS(wxInfoBar
);
73 #endif // _WX_GTK_INFOBAR_H_