]>
Commit | Line | Data |
---|---|---|
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 | 19 | class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase |
c801d85f | 20 | { |
9b7e522a | 21 | public: |
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, | |
40 | long style = 0, | |
41 | const wxString& name = wxToolBarNameStr ); | |
42 | ||
43 | virtual ~wxToolBar(); | |
44 | ||
45 | // override base class virtuals | |
debe6624 | 46 | virtual void SetMargins(int x, int y); |
debe6624 | 47 | virtual void SetToolSeparation(int separation); |
8a0681f9 VZ |
48 | |
49 | virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; | |
50 | ||
a1f79c1e VZ |
51 | virtual void SetToolShortHelp(int id, const wxString& helpString); |
52 | ||
e76c0b5f VZ |
53 | virtual void SetWindowStyleFlag( long style ); |
54 | ||
bbd321ff RD |
55 | virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap); |
56 | virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap); | |
07d02e9e | 57 | |
9d522606 RD |
58 | static wxVisualAttributes |
59 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
07d02e9e | 60 | |
8a0681f9 VZ |
61 | // implementation from now on |
62 | // -------------------------- | |
63 | ||
c801d85f | 64 | GtkToolbar *m_toolbar; |
8a0681f9 | 65 | |
9864c56d | 66 | bool m_blockEvent; |
8a0681f9 | 67 | |
9b7e522a | 68 | void OnInternalIdle(); |
8a0681f9 VZ |
69 | |
70 | protected: | |
71 | // common part of all ctors | |
72 | void Init(); | |
73 | ||
e76c0b5f VZ |
74 | // set the GTK toolbar style and orientation |
75 | void GtkSetStyle(); | |
76 | ||
48468900 | 77 | virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; |
07d02e9e | 78 | |
8a0681f9 VZ |
79 | // implement base class pure virtuals |
80 | virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); | |
81 | virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); | |
82 | ||
83 | virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); | |
84 | virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); | |
85 | virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); | |
86 | ||
87 | virtual wxToolBarToolBase *CreateTool(int id, | |
e76c0b5f | 88 | const wxString& label, |
8a0681f9 VZ |
89 | const wxBitmap& bitmap1, |
90 | const wxBitmap& bitmap2, | |
e76c0b5f | 91 | wxItemKind kind, |
8a0681f9 VZ |
92 | wxObject *clientData, |
93 | const wxString& shortHelpString, | |
94 | const wxString& longHelpString); | |
07d02e9e VZ |
95 | virtual wxToolBarToolBase *CreateTool(wxControl *control, |
96 | const wxString& label); | |
8a0681f9 | 97 | |
9b7e522a | 98 | private: |
9b7e522a | 99 | DECLARE_DYNAMIC_CLASS(wxToolBar) |
c801d85f KB |
100 | }; |
101 | ||
8a0681f9 | 102 | #endif // wxUSE_TOOLBAR |
dcf924a3 | 103 | |
c801d85f | 104 | #endif |
8a0681f9 | 105 | // _WX_GTK_TBARGTK_H_ |