1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/toolbar.h
3 // Purpose: wxToolBar declaration
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIV_TOOLBAR_H_
13 #define _WX_UNIV_TOOLBAR_H_
16 #pragma interface "univtoolbar.h"
19 #include "wx/window.h"
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxToolBarTool
: public wxToolBarToolBase
28 wxToolBarTool( wxToolBarBase
*tbar
= (wxToolBarBase
*)NULL
,
29 int id
= wxID_SEPARATOR
,
30 const wxBitmap
& bitmap1
= wxNullBitmap
,
31 const wxBitmap
& bitmap2
= wxNullBitmap
,
33 wxObject
*clientData
= (wxObject
*) NULL
,
34 const wxString
& shortHelpString
= wxEmptyString
,
35 const wxString
& longHelpString
= wxEmptyString
) :
36 wxToolBarToolBase( tbar
, id
, bitmap1
, bitmap2
, toggle
, clientData
,
37 shortHelpString
, longHelpString
)
50 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
53 // construction/destruction
54 wxToolBar() { Init(); }
55 wxToolBar( wxWindow
*parent
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
60 const wxString
& name
= wxToolBarNameStr
)
64 Create(parent
, id
, pos
, size
, style
, name
);
67 bool Create( wxWindow
*parent
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& size
= wxDefaultSize
,
72 const wxString
& name
= wxToolBarNameStr
);
75 virtual ~wxToolBar() { }
78 virtual bool Realize();
80 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
82 virtual void SetToolShortHelp(int id
, const wxString
& helpString
);
85 // common part of all ctors
88 // implement base class pure virtuals
89 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
90 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
92 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
93 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
94 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
96 virtual wxToolBarToolBase
*CreateTool(int id
,
97 const wxBitmap
& bitmap1
,
98 const wxBitmap
& bitmap2
,
100 wxObject
*clientData
,
101 const wxString
& shortHelpString
,
102 const wxString
& longHelpString
);
103 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
106 wxToolBarTool
*m_captured
;
107 wxToolBarTool
*m_underMouse
;
108 wxCoord m_maxWidth
, m_maxHeight
;
111 void OnMouse( wxMouseEvent
&event
);
112 void OnEnter( wxMouseEvent
&event
);
113 void OnLeave( wxMouseEvent
&event
);
114 void RefreshTool( wxToolBarTool
*tool
);
115 void DrawToolBarTool( wxToolBarTool
*tool
, wxDC
&dc
, bool down
);
116 void OnPaint( wxPaintEvent
&event
);
119 DECLARE_EVENT_TABLE()
122 #endif // _WX_UNIV_TOOLBAR_H_