1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #pragma interface "toolbar.h"
21 #include "wx/tbarbase.h"
22 #include "wx/dynarray.h"
24 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
26 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
28 DECLARE_DYNAMIC_CLASS(wxToolBar
)
34 wxToolBar() { Init(); }
37 inline wxToolBar(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
38 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
39 const wxString
& name
= wxToolBarNameStr
)
42 Create(parent
, id
, pos
, size
, style
, name
);
46 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
47 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
48 const wxString
& name
= wxToolBarNameStr
);
50 // override/implement base class virtuals
51 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
53 virtual bool Realize();
55 virtual void SetToolBitmapSize(const wxSize
& size
);
56 virtual wxSize
GetToolSize() const;
58 virtual void SetRows(int nRows
);
60 // Add all the buttons
62 virtual void MacHandleControlClick( WXWidget control
, short controlpart
) ;
63 virtual wxString
MacGetToolTipString( wxPoint
&where
) ;
64 void OnPaint(wxPaintEvent
& event
) ;
65 void OnMouse(wxMouseEvent
& event
) ;
66 virtual void MacSuperChangedPosition() ;
68 // common part of all ctors
71 // implement base class pure virtuals
72 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
73 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
75 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
76 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
77 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
79 virtual wxToolBarToolBase
*CreateTool(int id
,
80 const wxString
& label
,
81 const wxBitmap
& bmpNormal
,
82 const wxBitmap
& bmpDisabled
,
85 const wxString
& shortHelp
,
86 const wxString
& longHelp
);
87 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
89 wxArrayPtrVoid m_macToolHandles
;
94 #endif // wxUSE_TOOLBAR