]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/toolbar.h
527c97e7931724c35f70266d0a7ce318d91d53bf
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(); }
32 inline wxToolBar(wxWindow
*parent
, wxWindowID id
,
33 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
34 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
35 const wxString
& name
= wxToolBarNameStr
)
38 Create(parent
, id
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
43 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
44 const wxString
& name
= wxToolBarNameStr
);
46 virtual void SetWindowStyleFlag(long style
);
48 // override/implement base class virtuals
49 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
51 virtual bool Show(bool show
= true);
52 virtual bool IsShown() 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 wxString
MacGetToolTipString( wxPoint
&where
) ;
63 void OnPaint(wxPaintEvent
& event
) ;
64 void OnMouse(wxMouseEvent
& event
) ;
65 virtual void MacSuperChangedPosition() ;
67 #if wxMAC_USE_NATIVE_TOOLBAR
68 bool MacInstallNativeToolbar(bool usesNative
);
69 bool MacWantsNativeToolbar();
70 bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled
) const;
73 // common part of all ctors
76 virtual void DoGetSize(int *width
, int *height
) const;
77 virtual wxSize
DoGetBestSize() const;
78 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
79 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
81 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
82 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
83 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
85 virtual wxToolBarToolBase
*CreateTool(int id
,
86 const wxString
& label
,
87 const wxBitmap
& bmpNormal
,
88 const wxBitmap
& bmpDisabled
,
91 const wxString
& shortHelp
,
92 const wxString
& longHelp
);
93 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
96 #if wxMAC_USE_NATIVE_TOOLBAR
97 bool m_macUsesNativeToolbar
;
98 void* m_macHIToolbarRef
;
102 #endif // wxUSE_TOOLBAR