]>
Commit | Line | Data |
---|---|---|
ed8efd46 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/gtk/infobar.h | |
3 | // Purpose: native implementation of wxInfoBar for GTK+ 2.18 and later | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2009-09-26 | |
ed8efd46 VZ |
6 | // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org> |
7 | // Licence: wxWindows licence | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_GTK_INFOBAR_H_ | |
11 | #define _WX_GTK_INFOBAR_H_ | |
12 | ||
13 | #include "wx/generic/infobar.h" | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // wxInfoBar for GTK+ | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
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 | |
742df992 | 22 | class WXDLLIMPEXP_CORE wxInfoBar : public wxInfoBarGeneric |
ed8efd46 VZ |
23 | { |
24 | public: | |
25 | wxInfoBar() { Init(); } | |
26 | ||
27 | wxInfoBar(wxWindow *parent, wxWindowID winid = wxID_ANY) | |
28 | { | |
29 | Init(); | |
30 | Create(parent, winid); | |
31 | } | |
32 | ||
33 | bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY); | |
34 | ||
35 | virtual ~wxInfoBar(); | |
36 | ||
37 | // implement base class methods | |
38 | // ---------------------------- | |
39 | ||
40 | virtual void ShowMessage(const wxString& msg, | |
41 | int flags = wxICON_INFORMATION); | |
42 | ||
0b1add25 VZ |
43 | virtual void Dismiss(); |
44 | ||
ed8efd46 VZ |
45 | virtual void AddButton(wxWindowID btnid, |
46 | const wxString& label = wxString()); | |
47 | ||
e6b2aae1 VZ |
48 | virtual void RemoveButton(wxWindowID btnid); |
49 | ||
ed8efd46 VZ |
50 | // implementation only |
51 | // ------------------- | |
52 | ||
53 | void GTKResponse(int btnid); | |
54 | ||
55 | protected: | |
4026acf1 | 56 | virtual void DoApplyWidgetStyle(GtkRcStyle *style); |
ed8efd46 VZ |
57 | |
58 | private: | |
e6b2aae1 VZ |
59 | void Init() { m_impl = NULL; } |
60 | ||
6a3f8b4f VZ |
61 | // add a button with the given id/label and return its widget |
62 | GtkWidget *GTKAddButton(wxWindowID btnid, | |
63 | const wxString& label = wxString()); | |
64 | ||
ed8efd46 | 65 | |
e6b2aae1 VZ |
66 | // only used when the native implementation is really being used |
67 | class wxInfoBarGTKImpl *m_impl; | |
ed8efd46 VZ |
68 | |
69 | wxDECLARE_NO_COPY_CLASS(wxInfoBar); | |
70 | }; | |
71 | ||
72 | #endif // _WX_GTK_INFOBAR_H_ | |
73 |