1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/toolbar.h
3 // Purpose: GTK toolbar
4 // Author: Robert Roebling
5 // Copyright: (c) Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_GTK_TOOLBAR_H_
10 #define _WX_GTK_TOOLBAR_H_
14 typedef struct _GtkTooltips GtkTooltips
;
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 class WXDLLIMPEXP_CORE wxToolBar
: public wxToolBarBase
23 // construction/destruction
24 wxToolBar() { Init(); }
25 wxToolBar( wxWindow
*parent
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
29 long style
= wxTB_HORIZONTAL
,
30 const wxString
& name
= wxToolBarNameStr
)
34 Create(parent
, id
, pos
, size
, style
, name
);
37 bool Create( wxWindow
*parent
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
41 long style
= wxTB_HORIZONTAL
,
42 const wxString
& name
= wxToolBarNameStr
);
46 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
48 virtual void SetToolShortHelp(int id
, const wxString
& helpString
);
50 virtual void SetWindowStyleFlag( long style
);
52 virtual void SetToolNormalBitmap(int id
, const wxBitmap
& bitmap
);
53 virtual void SetToolDisabledBitmap(int id
, const wxBitmap
& bitmap
);
55 virtual bool Realize();
57 static wxVisualAttributes
58 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
60 virtual wxToolBarToolBase
*CreateTool(int id
,
61 const wxString
& label
,
62 const wxBitmap
& bitmap1
,
63 const wxBitmap
& bitmap2
= wxNullBitmap
,
64 wxItemKind kind
= wxITEM_NORMAL
,
65 wxObject
*clientData
= NULL
,
66 const wxString
& shortHelpString
= wxEmptyString
,
67 const wxString
& longHelpString
= wxEmptyString
);
68 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
,
69 const wxString
& label
);
71 // implementation from now on
72 // --------------------------
75 // choose the default border for this window
76 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_DEFAULT
; }
78 virtual wxSize
DoGetBestSize() const;
79 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
81 // implement base class pure virtuals
82 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
83 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
85 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
86 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
87 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
92 GSList
* GetRadioGroup(size_t pos
);
93 virtual void AddChildGTK(wxWindowGTK
* child
);
95 GtkToolbar
* m_toolbar
;
96 GtkTooltips
* m_tooltips
;
98 DECLARE_DYNAMIC_CLASS(wxToolBar
)
101 #endif // wxUSE_TOOLBAR
104 // _WX_GTK_TOOLBAR_H_