]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/gtk/infobar.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / gtk / infobar.h
... / ...
CommitLineData
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
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
22class WXDLLIMPEXP_CORE wxInfoBar : public wxInfoBarGeneric
23{
24public:
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
43 virtual void Dismiss();
44
45 virtual void AddButton(wxWindowID btnid,
46 const wxString& label = wxString());
47
48 virtual void RemoveButton(wxWindowID btnid);
49
50 // implementation only
51 // -------------------
52
53 void GTKResponse(int btnid);
54
55protected:
56 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
57
58private:
59 void Init() { m_impl = NULL; }
60
61 // add a button with the given id/label and return its widget
62 GtkWidget *GTKAddButton(wxWindowID btnid,
63 const wxString& label = wxString());
64
65
66 // only used when the native implementation is really being used
67 class wxInfoBarGTKImpl *m_impl;
68
69 wxDECLARE_NO_COPY_CLASS(wxInfoBar);
70};
71
72#endif // _WX_GTK_INFOBAR_H_
73