]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
0b83552a | 2 | // Name: wx/gtk/toolbar.h |
c801d85f KB |
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 | ||
0b83552a VZ |
10 | #ifndef _WX_GTK_TOOLBAR_H_ |
11 | #define _WX_GTK_TOOLBAR_H_ | |
c801d85f | 12 | |
dcf924a3 RR |
13 | #if wxUSE_TOOLBAR |
14 | ||
879e4f6e PC |
15 | typedef struct _GtkTooltips GtkTooltips; |
16 | ||
8a0681f9 | 17 | // ---------------------------------------------------------------------------- |
716b7364 | 18 | // wxToolBar |
8a0681f9 | 19 | // ---------------------------------------------------------------------------- |
c801d85f | 20 | |
20123d49 | 21 | class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase |
c801d85f | 22 | { |
9b7e522a | 23 | public: |
8a0681f9 VZ |
24 | // construction/destruction |
25 | wxToolBar() { Init(); } | |
26 | wxToolBar( wxWindow *parent, | |
27 | wxWindowID id, | |
28 | const wxPoint& pos = wxDefaultPosition, | |
29 | const wxSize& size = wxDefaultSize, | |
6a1b3ead | 30 | long style = wxTB_HORIZONTAL, |
8a0681f9 VZ |
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, | |
a1cb0b11 | 42 | long style = wxTB_HORIZONTAL, |
8a0681f9 VZ |
43 | const wxString& name = wxToolBarNameStr ); |
44 | ||
45 | virtual ~wxToolBar(); | |
46 | ||
8a0681f9 VZ |
47 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; |
48 | ||
a1f79c1e VZ |
49 | virtual void SetToolShortHelp(int id, const wxString& helpString); |
50 | ||
e76c0b5f VZ |
51 | virtual void SetWindowStyleFlag( long style ); |
52 | ||
bbd321ff RD |
53 | virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap); |
54 | virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap); | |
07d02e9e | 55 | |
9067c6c5 VZ |
56 | virtual bool Realize(); |
57 | ||
9d522606 RD |
58 | static wxVisualAttributes |
59 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
07d02e9e | 60 | |
f2b6dd8c RD |
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 | ||
8a0681f9 VZ |
72 | // implementation from now on |
73 | // -------------------------- | |
74 | ||
8a0681f9 | 75 | protected: |
f75b1bd3 VZ |
76 | // choose the default border for this window |
77 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; } | |
78 | ||
a1cb0b11 | 79 | virtual wxSize DoGetBestSize() const; |
48468900 | 80 | virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; |
07d02e9e | 81 | |
8a0681f9 VZ |
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 | ||
9b7e522a | 90 | private: |
a1cb0b11 PC |
91 | void Init(); |
92 | void GtkSetStyle(); | |
93 | GSList* GetRadioGroup(size_t pos); | |
48200154 | 94 | virtual void AddChildGTK(wxWindowGTK* child); |
a1cb0b11 PC |
95 | |
96 | GtkToolbar* m_toolbar; | |
97 | GtkTooltips* m_tooltips; | |
98 | ||
9b7e522a | 99 | DECLARE_DYNAMIC_CLASS(wxToolBar) |
c801d85f KB |
100 | }; |
101 | ||
8a0681f9 | 102 | #endif // wxUSE_TOOLBAR |
dcf924a3 | 103 | |
c801d85f | 104 | #endif |
0b83552a | 105 | // _WX_GTK_TOOLBAR_H_ |