]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/tbargtk.h
Fix memory leak by letting the base class version handle the
[wxWidgets.git] / include / wx / gtk / tbargtk.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: tbargtk.h
3// Purpose: GTK toolbar
4// Author: Robert Roebling
c801d85f
KB
5// RCS-ID: $Id$
6// Copyright: (c) Robert Roebling
77ffb593 7// Licence: wxWidgets licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
8a0681f9
VZ
10#ifndef _WX_GTK_TBARGTK_H_
11#define _WX_GTK_TBARGTK_H_
c801d85f 12
12028905 13#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
8a0681f9 14 #pragma interface "tbargtk.h"
c801d85f
KB
15#endif
16
dcf924a3
RR
17#if wxUSE_TOOLBAR
18
8a0681f9 19// ----------------------------------------------------------------------------
716b7364 20// wxToolBar
8a0681f9 21// ----------------------------------------------------------------------------
c801d85f 22
8a0681f9 23class wxToolBar : public wxToolBarBase
c801d85f 24{
9b7e522a 25public:
8a0681f9
VZ
26 // construction/destruction
27 wxToolBar() { Init(); }
28 wxToolBar( wxWindow *parent,
29 wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxString& name = wxToolBarNameStr )
34 {
35 Init();
36
37 Create(parent, id, pos, size, style, name);
38 }
39
40 bool Create( wxWindow *parent,
41 wxWindowID id,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = 0,
45 const wxString& name = wxToolBarNameStr );
46
47 virtual ~wxToolBar();
48
49 // override base class virtuals
debe6624 50 virtual void SetMargins(int x, int y);
debe6624 51 virtual void SetToolSeparation(int separation);
8a0681f9
VZ
52
53 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
54
a1f79c1e
VZ
55 virtual void SetToolShortHelp(int id, const wxString& helpString);
56
e76c0b5f
VZ
57 virtual void SetWindowStyleFlag( long style );
58
9d522606
RD
59 static wxVisualAttributes
60 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
61
8a0681f9
VZ
62 // implementation from now on
63 // --------------------------
64
c801d85f 65 GtkToolbar *m_toolbar;
8a0681f9
VZ
66
67 GdkColor *m_fg;
68 GdkColor *m_bg;
69
9864c56d 70 bool m_blockEvent;
8a0681f9 71
9b7e522a 72 void OnInternalIdle();
8a0681f9
VZ
73
74protected:
75 // common part of all ctors
76 void Init();
77
e76c0b5f
VZ
78 // set the GTK toolbar style and orientation
79 void GtkSetStyle();
80
8a0681f9
VZ
81 // implement base class pure virtuals
82 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
83 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
84
85 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
86 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
87 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
88
89 virtual wxToolBarToolBase *CreateTool(int id,
e76c0b5f 90 const wxString& label,
8a0681f9
VZ
91 const wxBitmap& bitmap1,
92 const wxBitmap& bitmap2,
e76c0b5f 93 wxItemKind kind,
8a0681f9
VZ
94 wxObject *clientData,
95 const wxString& shortHelpString,
96 const wxString& longHelpString);
97 virtual wxToolBarToolBase *CreateTool(wxControl *control);
98
9b7e522a 99private:
9b7e522a 100 DECLARE_DYNAMIC_CLASS(wxToolBar)
c801d85f
KB
101};
102
8a0681f9 103#endif // wxUSE_TOOLBAR
dcf924a3 104
c801d85f 105#endif
8a0681f9 106 // _WX_GTK_TBARGTK_H_