]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/toolbar.h
Use (newly) added wxStaticCastVariantData() to fix wxNO_RTTI build.
[wxWidgets.git] / include / wx / gtk / toolbar.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
0b83552a 2// Name: wx/gtk/toolbar.h
c801d85f
KB
3// Purpose: GTK toolbar
4// Author: Robert Roebling
c801d85f
KB
5// RCS-ID: $Id$
6// Copyright: (c) Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
0b83552a
VZ
10#ifndef _WX_GTK_TOOLBAR_H_
11#define _WX_GTK_TOOLBAR_H_
c801d85f 12
dcf924a3
RR
13#if wxUSE_TOOLBAR
14
879e4f6e
PC
15typedef struct _GtkTooltips GtkTooltips;
16
8a0681f9 17// ----------------------------------------------------------------------------
716b7364 18// wxToolBar
8a0681f9 19// ----------------------------------------------------------------------------
c801d85f 20
20123d49 21class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
c801d85f 22{
9b7e522a 23public:
8a0681f9
VZ
24 // construction/destruction
25 wxToolBar() { Init(); }
26 wxToolBar( wxWindow *parent,
27 wxWindowID id,
28 const wxPoint& pos = wxDefaultPosition,
29 const wxSize& size = wxDefaultSize,
6a1b3ead 30 long style = wxTB_HORIZONTAL,
8a0681f9
VZ
31 const wxString& name = wxToolBarNameStr )
32 {
33 Init();
34
35 Create(parent, id, pos, size, style, name);
36 }
37
38 bool Create( wxWindow *parent,
39 wxWindowID id,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
a1cb0b11 42 long style = wxTB_HORIZONTAL,
8a0681f9
VZ
43 const wxString& name = wxToolBarNameStr );
44
45 virtual ~wxToolBar();
46
8a0681f9
VZ
47 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
48
a1f79c1e
VZ
49 virtual void SetToolShortHelp(int id, const wxString& helpString);
50
e76c0b5f
VZ
51 virtual void SetWindowStyleFlag( long style );
52
bbd321ff
RD
53 virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
54 virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
07d02e9e 55
9067c6c5
VZ
56 virtual bool Realize();
57
9d522606
RD
58 static wxVisualAttributes
59 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
07d02e9e 60
f2b6dd8c
RD
61 virtual wxToolBarToolBase *CreateTool(int id,
62 const wxString& label,
63 const wxBitmap& bitmap1,
64 const wxBitmap& bitmap2 = wxNullBitmap,
65 wxItemKind kind = wxITEM_NORMAL,
66 wxObject *clientData = NULL,
67 const wxString& shortHelpString = wxEmptyString,
68 const wxString& longHelpString = wxEmptyString);
69 virtual wxToolBarToolBase *CreateTool(wxControl *control,
70 const wxString& label);
71
8a0681f9
VZ
72 // implementation from now on
73 // --------------------------
74
8a0681f9 75protected:
a1cb0b11 76 virtual wxSize DoGetBestSize() const;
48468900 77 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
07d02e9e 78
8a0681f9
VZ
79 // implement base class pure virtuals
80 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
81 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
82
83 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
84 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
85 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
86
9b7e522a 87private:
a1cb0b11
PC
88 void Init();
89 void GtkSetStyle();
90 GSList* GetRadioGroup(size_t pos);
48200154 91 virtual void AddChildGTK(wxWindowGTK* child);
a1cb0b11
PC
92
93 GtkToolbar* m_toolbar;
94 GtkTooltips* m_tooltips;
95
9b7e522a 96 DECLARE_DYNAMIC_CLASS(wxToolBar)
c801d85f
KB
97};
98
8a0681f9 99#endif // wxUSE_TOOLBAR
dcf924a3 100
c801d85f 101#endif
0b83552a 102 // _WX_GTK_TOOLBAR_H_