]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/tbargtk.h
replacing old core graphics with new graphics context implementation
[wxWidgets.git] / include / wx / gtk / tbargtk.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tbargtk.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_TBARGTK_H_
11 #define _WX_GTK_TBARGTK_H_
12
13 #if wxUSE_TOOLBAR
14
15 // ----------------------------------------------------------------------------
16 // wxToolBar
17 // ----------------------------------------------------------------------------
18
19 class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
20 {
21 public:
22 // construction/destruction
23 wxToolBar() { Init(); }
24 wxToolBar( wxWindow *parent,
25 wxWindowID id,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
28 long style = wxTB_HORIZONTAL,
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
46 virtual void SetMargins(int x, int y);
47 virtual void SetToolSeparation(int separation);
48
49 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
50
51 virtual void SetToolShortHelp(int id, const wxString& helpString);
52
53 virtual void SetWindowStyleFlag( long style );
54
55 static wxVisualAttributes
56 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
57
58 // implementation from now on
59 // --------------------------
60
61 GtkToolbar *m_toolbar;
62
63 bool m_blockEvent;
64
65 void OnInternalIdle();
66
67 protected:
68 // common part of all ctors
69 void Init();
70
71 // set the GTK toolbar style and orientation
72 void GtkSetStyle();
73
74 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
75
76 // implement base class pure virtuals
77 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
78 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
79
80 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
81 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
82 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
83
84 virtual wxToolBarToolBase *CreateTool(int id,
85 const wxString& label,
86 const wxBitmap& bitmap1,
87 const wxBitmap& bitmap2,
88 wxItemKind kind,
89 wxObject *clientData,
90 const wxString& shortHelpString,
91 const wxString& longHelpString);
92 virtual wxToolBarToolBase *CreateTool(wxControl *control);
93
94 private:
95 DECLARE_DYNAMIC_CLASS(wxToolBar)
96 };
97
98 #endif // wxUSE_TOOLBAR
99
100 #endif
101 // _WX_GTK_TBARGTK_H_