]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
17 #include "wx/tbarbase.h"
18 #include "wx/dynarray.h"
20 WXDLLEXPORT_DATA(extern const wxChar
*) wxToolBarNameStr
;
22 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
24 DECLARE_DYNAMIC_CLASS(wxToolBar
)
30 wxToolBar() { Init(); }
33 inline wxToolBar(wxWindow
*parent
, wxWindowID id
,
34 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
35 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
36 const wxString
& name
= wxToolBarNameStr
)
39 Create(parent
, id
, pos
, size
, style
, name
);
43 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
44 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
45 const wxString
& name
= wxToolBarNameStr
);
47 // override/implement base class virtuals
48 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
50 virtual bool Realize();
52 virtual void SetToolBitmapSize(const wxSize
& size
);
53 virtual wxSize
GetToolSize() const;
55 virtual void SetRows(int nRows
);
57 // Add all the buttons
59 virtual void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
, bool mouseStillDown
) ;
60 virtual wxString
MacGetToolTipString( wxPoint
&where
) ;
61 void OnPaint(wxPaintEvent
& event
) ;
62 void OnMouse(wxMouseEvent
& event
) ;
63 virtual void MacSuperChangedPosition() ;
65 // common part of all ctors
68 // implement base class pure virtuals
69 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
70 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
72 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
73 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
74 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
76 virtual wxToolBarToolBase
*CreateTool(int id
,
77 const wxString
& label
,
78 const wxBitmap
& bmpNormal
,
79 const wxBitmap
& bmpDisabled
,
82 const wxString
& shortHelp
,
83 const wxString
& longHelp
);
84 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
89 #endif // wxUSE_TOOLBAR