]> git.saurik.com Git - wxWidgets.git/blame - include/wx/infobar.h
using Run of base class
[wxWidgets.git] / include / wx / infobar.h
CommitLineData
a92b5dfe
VZ
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
a92b5dfe
VZ
6// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_INFOBAR_H_
11#define _WX_INFOBAR_H_
12
13#include "wx/defs.h"
14
15#if wxUSE_INFOBAR
16
e33253d1 17#include "wx/control.h"
a92b5dfe
VZ
18
19// ----------------------------------------------------------------------------
20// wxInfoBar shows non-critical but important information to the user
21// ----------------------------------------------------------------------------
22
742df992 23class WXDLLIMPEXP_CORE wxInfoBarBase : public wxControl
a92b5dfe
VZ
24{
25public:
26 // real ctors are provided by the derived classes, just notice that unlike
27 // most of the other windows, info bar is created hidden and must be
28 // explicitly shown when it is needed (this is done because it is supposed
29 // to be shown only intermittently and hiding it after creating it from the
30 // user code would result in flicker)
31 wxInfoBarBase() { }
32
33
34 // show the info bar with the given message and optionally an icon
ed8efd46
VZ
35 virtual void ShowMessage(const wxString& msg,
36 int flags = wxICON_INFORMATION) = 0;
a92b5dfe 37
0b1add25
VZ
38 // hide the info bar
39 virtual void Dismiss() = 0;
40
6a3f8b4f
VZ
41 // add an extra button to the bar, near the message (replacing the default
42 // close button which is only shown if no extra buttons are used)
374ae80f
VZ
43 virtual void AddButton(wxWindowID btnid,
44 const wxString& label = wxString()) = 0;
45
e6b2aae1
VZ
46 // remove a button previously added by AddButton()
47 virtual void RemoveButton(wxWindowID btnid) = 0;
48
a92b5dfe
VZ
49private:
50 wxDECLARE_NO_COPY_CLASS(wxInfoBarBase);
51};
52
ed8efd46 53// currently only GTK+ has a native implementation
d85aece1
VZ
54#if defined(__WXGTK218__) && !defined(__WXUNIVERSAL__)
55 #include "wx/gtk/infobar.h"
56 #define wxHAS_NATIVE_INFOBAR
ed8efd46
VZ
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
a92b5dfe
VZ
64
65#endif // wxUSE_INFOBAR
66
67#endif // _WX_INFOBAR_H_