]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/toolbar.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / gtk1 / toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk1/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 // ----------------------------------------------------------------------------
15 // wxToolBar
16 // ----------------------------------------------------------------------------
17
18 class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
19 {
20 public:
21 // construction/destruction
22 wxToolBar() { Init(); }
23 wxToolBar( wxWindow *parent,
24 wxWindowID id,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 long style = 0,
28 const wxString& name = wxToolBarNameStr )
29 {
30 Init();
31
32 Create(parent, id, pos, size, style, name);
33 }
34
35 bool Create( wxWindow *parent,
36 wxWindowID id,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 long style = 0,
40 const wxString& name = wxToolBarNameStr );
41
42 virtual ~wxToolBar();
43
44 // override base class virtuals
45 virtual void SetMargins(int x, int y);
46 virtual void SetToolSeparation(int separation);
47
48 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
49
50 virtual void SetToolShortHelp(int id, const wxString& helpString);
51
52 virtual void SetWindowStyleFlag( long style );
53
54 static wxVisualAttributes
55 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
56
57 // implementation from now on
58 // --------------------------
59
60 GtkToolbar *m_toolbar;
61
62 bool m_blockEvent;
63
64 void OnInternalIdle();
65
66 protected:
67 // common part of all ctors
68 void Init();
69
70 // choose the default border for this window
71 virtual wxBorder GetDefaultBorder() const { return wxBORDER_DEFAULT; }
72
73 // set the GTK toolbar style and orientation
74 void GtkSetStyle();
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 const wxString& label);
94
95 private:
96 DECLARE_DYNAMIC_CLASS(wxToolBar)
97 };
98
99 #endif // wxUSE_TOOLBAR
100
101 #endif
102 // _WX_GTK_TOOLBAR_H_