]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/toolbar.h
Add ctor and assign() taking an iterator range to wxVector<>.
[wxWidgets.git] / include / wx / gtk / toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/toolbar.h
3 // Purpose: GTK toolbar
4 // Author: Robert Roebling
5 // RCS-ID: $Id$
6 // Copyright: (c) Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_GTK_TOOLBAR_H_
11 #define _WX_GTK_TOOLBAR_H_
12
13 #if wxUSE_TOOLBAR
14
15 typedef struct _GtkTooltips GtkTooltips;
16
17 // ----------------------------------------------------------------------------
18 // wxToolBar
19 // ----------------------------------------------------------------------------
20
21 class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
22 {
23 public:
24 // construction/destruction
25 wxToolBar() { Init(); }
26 wxToolBar( wxWindow *parent,
27 wxWindowID id,
28 const wxPoint& pos = wxDefaultPosition,
29 const wxSize& size = wxDefaultSize,
30 long style = wxTB_HORIZONTAL,
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,
42 long style = wxTB_HORIZONTAL,
43 const wxString& name = wxToolBarNameStr );
44
45 virtual ~wxToolBar();
46
47 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
48
49 virtual void SetToolShortHelp(int id, const wxString& helpString);
50
51 virtual void SetWindowStyleFlag( long style );
52
53 virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
54 virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
55
56 virtual bool Realize();
57
58 static wxVisualAttributes
59 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
60
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
72 // implementation from now on
73 // --------------------------
74
75 protected:
76 // choose the default border for this window
77 virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
78
79 virtual wxSize DoGetBestSize() const;
80 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
81
82 // implement base class pure virtuals
83 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
84 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
85
86 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
87 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
88 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
89
90 private:
91 void Init();
92 void GtkSetStyle();
93 GSList* GetRadioGroup(size_t pos);
94 virtual void AddChildGTK(wxWindowGTK* child);
95
96 GtkToolbar* m_toolbar;
97 GtkTooltips* m_tooltips;
98
99 DECLARE_DYNAMIC_CLASS(wxToolBar)
100 };
101
102 #endif // wxUSE_TOOLBAR
103
104 #endif
105 // _WX_GTK_TOOLBAR_H_