]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/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(NO_GCC_PRAGMA)
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(); }
36 inline wxToolBar(wxWindow
*parent
, wxWindowID id
,
37 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 virtual void SetWindowStyleFlag(long style
);
52 // override/implement base class virtuals
53 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
55 virtual bool Show(bool show
= true);
56 virtual bool IsShown() const;
57 virtual void DoGetSize(int *width
, int *height
) const;
58 virtual bool Realize();
60 virtual void SetToolBitmapSize(const wxSize
& size
);
61 virtual wxSize
GetToolSize() const;
63 virtual void SetRows(int nRows
);
65 // Add all the buttons
67 virtual wxString
MacGetToolTipString( wxPoint
&where
) ;
68 void OnPaint(wxPaintEvent
& event
) ;
69 void OnMouse(wxMouseEvent
& event
) ;
70 virtual void MacSuperChangedPosition() ;
72 #if wxMAC_USE_NATIVE_TOOLBAR
73 bool MacInstallNativeToolbar(bool usesNative
);
74 bool MacWantsNativeToolbar();
75 bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled
) const;
78 // common part of all ctors
81 // implement base class pure virtuals
82 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
83 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
85 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
86 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
87 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
89 virtual wxToolBarToolBase
*CreateTool(int id
,
90 const wxString
& label
,
91 const wxBitmap
& bmpNormal
,
92 const wxBitmap
& bmpDisabled
,
95 const wxString
& shortHelp
,
96 const wxString
& longHelp
);
97 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
100 #if wxMAC_USE_NATIVE_TOOLBAR
101 bool m_macUsesNativeToolbar
;
102 void* m_macHIToolbarRef
;
106 #endif // wxUSE_TOOLBAR