]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/toolbar.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / gtk / toolbar.h
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 /////////////////////////////////////////////////////////////////////////////
8
9 #ifndef _WX_GTK_TOOLBAR_H_
10 #define _WX_GTK_TOOLBAR_H_
11
12 #if wxUSE_TOOLBAR
13
14 typedef struct _GtkTooltips GtkTooltips;
15
16 // ----------------------------------------------------------------------------
17 // wxToolBar
18 // ----------------------------------------------------------------------------
19
20 class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
21 {
22 public:
23 // construction/destruction
24 wxToolBar() { Init(); }
25 wxToolBar( wxWindow *parent,
26 wxWindowID id,
27 const wxPoint& pos = wxDefaultPosition,
28 const wxSize& size = wxDefaultSize,
29 long style = wxTB_HORIZONTAL,
30 const wxString& name = wxToolBarNameStr )
31 {
32 Init();
33
34 Create(parent, id, pos, size, style, name);
35 }
36
37 bool Create( wxWindow *parent,
38 wxWindowID id,
39 const wxPoint& pos = wxDefaultPosition,
40 const wxSize& size = wxDefaultSize,
41 long style = wxTB_HORIZONTAL,
42 const wxString& name = wxToolBarNameStr );
43
44 virtual ~wxToolBar();
45
46 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
47
48 virtual void SetToolShortHelp(int id, const wxString& helpString);
49
50 virtual void SetWindowStyleFlag( long style );
51
52 virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
53 virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
54
55 virtual bool Realize();
56
57 static wxVisualAttributes
58 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
59
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);
70
71 // implementation from now on
72 // --------------------------
73
74 protected:
75 // choose the default border for this window
76 virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
77
78 virtual wxSize DoGetBestSize() const;
79 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
80
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 private:
90 void Init();
91 void GtkSetStyle();
92 GSList* GetRadioGroup(size_t pos);
93 virtual void AddChildGTK(wxWindowGTK* child);
94
95 GtkToolbar* m_toolbar;
96 GtkTooltips* m_tooltips;
97
98 DECLARE_DYNAMIC_CLASS(wxToolBar)
99 };
100
101 #endif // wxUSE_TOOLBAR
102
103 #endif
104 // _WX_GTK_TOOLBAR_H_