]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/tbargtk.h
Hold a reference on m_widget for the life of the associated wxWindow object.
[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
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
8a0681f9
VZ
10#ifndef _WX_GTK_TBARGTK_H_
11#define _WX_GTK_TBARGTK_H_
c801d85f 12
dcf924a3
RR
13#if wxUSE_TOOLBAR
14
8a0681f9 15// ----------------------------------------------------------------------------
716b7364 16// wxToolBar
8a0681f9 17// ----------------------------------------------------------------------------
c801d85f 18
20123d49 19class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
c801d85f 20{
9b7e522a 21public:
8a0681f9
VZ
22 // construction/destruction
23 wxToolBar() { Init(); }
24 wxToolBar( wxWindow *parent,
25 wxWindowID id,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
6a1b3ead 28 long style = wxTB_HORIZONTAL,
8a0681f9
VZ
29 const wxString& name = wxToolBarNameStr )
30 {
31 Init();
32
33 Create(parent, id, pos, size, style, name);
34 }
35
36 bool Create( wxWindow *parent,
37 wxWindowID id,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
a1cb0b11 40 long style = wxTB_HORIZONTAL,
8a0681f9
VZ
41 const wxString& name = wxToolBarNameStr );
42
43 virtual ~wxToolBar();
44
8a0681f9
VZ
45 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
46
a1f79c1e
VZ
47 virtual void SetToolShortHelp(int id, const wxString& helpString);
48
e76c0b5f
VZ
49 virtual void SetWindowStyleFlag( long style );
50
bbd321ff
RD
51 virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
52 virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
07d02e9e 53
9d522606
RD
54 static wxVisualAttributes
55 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
07d02e9e 56
8a0681f9
VZ
57 // implementation from now on
58 // --------------------------
59
9b7e522a 60 void OnInternalIdle();
8a0681f9
VZ
61
62protected:
a1cb0b11 63 virtual wxSize DoGetBestSize() const;
48468900 64 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
07d02e9e 65
8a0681f9
VZ
66 // implement base class pure virtuals
67 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
68 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
69
70 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
71 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
72 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
73
74 virtual wxToolBarToolBase *CreateTool(int id,
e76c0b5f 75 const wxString& label,
8a0681f9
VZ
76 const wxBitmap& bitmap1,
77 const wxBitmap& bitmap2,
e76c0b5f 78 wxItemKind kind,
8a0681f9
VZ
79 wxObject *clientData,
80 const wxString& shortHelpString,
81 const wxString& longHelpString);
07d02e9e
VZ
82 virtual wxToolBarToolBase *CreateTool(wxControl *control,
83 const wxString& label);
8a0681f9 84
9b7e522a 85private:
a1cb0b11
PC
86 void Init();
87 void GtkSetStyle();
88 GSList* GetRadioGroup(size_t pos);
89
90 GtkToolbar* m_toolbar;
91 GtkTooltips* m_tooltips;
92
9b7e522a 93 DECLARE_DYNAMIC_CLASS(wxToolBar)
c801d85f
KB
94};
95
8a0681f9 96#endif // wxUSE_TOOLBAR
dcf924a3 97
c801d85f 98#endif
8a0681f9 99 // _WX_GTK_TBARGTK_H_