]> git.saurik.com Git - wxWidgets.git/blob - include/wx/infobar.h
Add wxInfoBar::RemoveButton() method.
[wxWidgets.git] / include / wx / infobar.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/infobar.h
3 // Purpose: declaration of wxInfoBarBase defining common API of wxInfoBar
4 // Author: Vadim Zeitlin
5 // Created: 2009-07-28
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 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_INFOBAR_H_
12 #define _WX_INFOBAR_H_
13
14 #include "wx/defs.h"
15
16 #if wxUSE_INFOBAR
17
18 #include "wx/window.h"
19
20 // ----------------------------------------------------------------------------
21 // wxInfoBar shows non-critical but important information to the user
22 // ----------------------------------------------------------------------------
23
24 class WXDLLIMPEXP_ADV wxInfoBarBase : public wxControl
25 {
26 public:
27 // real ctors are provided by the derived classes, just notice that unlike
28 // most of the other windows, info bar is created hidden and must be
29 // explicitly shown when it is needed (this is done because it is supposed
30 // to be shown only intermittently and hiding it after creating it from the
31 // user code would result in flicker)
32 wxInfoBarBase() { }
33
34
35 // show the info bar with the given message and optionally an icon
36 virtual void ShowMessage(const wxString& msg,
37 int flags = wxICON_INFORMATION) = 0;
38
39 // add an extra button to the bar, near the message
40 virtual void AddButton(wxWindowID btnid,
41 const wxString& label = wxString()) = 0;
42
43 // remove a button previously added by AddButton()
44 virtual void RemoveButton(wxWindowID btnid) = 0;
45
46 private:
47 wxDECLARE_NO_COPY_CLASS(wxInfoBarBase);
48 };
49
50 // currently only GTK+ has a native implementation
51 #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
52 #include <gtk/gtkversion.h>
53 #if GTK_CHECK_VERSION(2, 18, 0)
54 #include "wx/gtk/infobar.h"
55 #define wxHAS_NATIVE_INFOBAR
56 #endif
57 #endif // wxGTK2
58
59 // if the generic version is the only one we have, use it
60 #ifndef wxHAS_NATIVE_INFOBAR
61 #include "wx/generic/infobar.h"
62 #define wxInfoBar wxInfoBarGeneric
63 #endif
64
65 #endif // wxUSE_INFOBAR
66
67 #endif // _WX_INFOBAR_H_