]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/gtk1/tbargtk.h
added native wxColourDialog for GTK2
[wxWidgets.git] / include / wx / gtk1 / tbargtk.h
... / ...
CommitLineData
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 defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
14 #pragma interface "tbargtk.h"
15#endif
16
17#if wxUSE_TOOLBAR
18
19// ----------------------------------------------------------------------------
20// wxToolBar
21// ----------------------------------------------------------------------------
22
23class wxToolBar : public wxToolBarBase
24{
25public:
26 // construction/destruction
27 wxToolBar() { Init(); }
28 wxToolBar( wxWindow *parent,
29 wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxString& name = wxToolBarNameStr )
34 {
35 Init();
36
37 Create(parent, id, pos, size, style, name);
38 }
39
40 bool Create( wxWindow *parent,
41 wxWindowID id,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 long style = 0,
45 const wxString& name = wxToolBarNameStr );
46
47 virtual ~wxToolBar();
48
49 // override base class virtuals
50 virtual void SetMargins(int x, int y);
51 virtual void SetToolSeparation(int separation);
52
53 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
54
55 virtual void SetToolShortHelp(int id, const wxString& helpString);
56
57 virtual void SetWindowStyleFlag( long style );
58
59 static wxVisualAttributes
60 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
61
62 // implementation from now on
63 // --------------------------
64
65 GtkToolbar *m_toolbar;
66
67 GdkColor *m_fg;
68 GdkColor *m_bg;
69
70 bool m_blockEvent;
71
72 void OnInternalIdle();
73
74protected:
75 // common part of all ctors
76 void Init();
77
78 // set the GTK toolbar style and orientation
79 void GtkSetStyle();
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 virtual wxToolBarToolBase *CreateTool(int id,
90 const wxString& label,
91 const wxBitmap& bitmap1,
92 const wxBitmap& bitmap2,
93 wxItemKind kind,
94 wxObject *clientData,
95 const wxString& shortHelpString,
96 const wxString& longHelpString);
97 virtual wxToolBarToolBase *CreateTool(wxControl *control);
98
99private:
100 DECLARE_DYNAMIC_CLASS(wxToolBar)
101};
102
103#endif // wxUSE_TOOLBAR
104
105#endif
106 // _WX_GTK_TBARGTK_H_