]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/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_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "toolbar.h"
21 #include "wx/tbarbase.h"
22 #include "wx/dynarray.h"
24 WXDLLEXPORT_DATA(extern const wxChar
*) wxToolBarNameStr
;
26 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
28 DECLARE_DYNAMIC_CLASS(wxToolBar
)
34 wxToolBar() { Init(); }
37 inline wxToolBar(wxWindow
*parent
, wxWindowID id
,
38 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
39 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
40 const wxString
& name
= wxToolBarNameStr
)
43 Create(parent
, id
, pos
, size
, style
, name
);
47 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
48 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
49 const wxString
& name
= wxToolBarNameStr
);
51 // override/implement base class virtuals
52 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
54 virtual bool Realize();
56 virtual void SetToolBitmapSize(const wxSize
& size
);
57 virtual wxSize
GetToolSize() const;
59 virtual void SetRows(int nRows
);
61 // Add all the buttons
63 virtual void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
, bool mouseStillDown
) ;
64 virtual wxString
MacGetToolTipString( wxPoint
&where
) ;
65 void OnPaint(wxPaintEvent
& event
) ;
66 void OnMouse(wxMouseEvent
& event
) ;
67 virtual void MacSuperChangedPosition() ;
69 // common part of all ctors
72 // implement base class pure virtuals
73 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
74 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
76 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
77 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
78 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
80 virtual wxToolBarToolBase
*CreateTool(int id
,
81 const wxString
& label
,
82 const wxBitmap
& bmpNormal
,
83 const wxBitmap
& bmpDisabled
,
86 const wxString
& shortHelp
,
87 const wxString
& longHelp
);
88 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
93 #endif // wxUSE_TOOLBAR