]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/toolbar.h
0b6ec16033a3072f07ff8fa775eed48e90ff5208
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 wxSize
DoGetBestSize() const ;
59 virtual bool Realize();
61 virtual void SetToolBitmapSize(const wxSize
& size
);
62 virtual wxSize
GetToolSize() const;
64 virtual void SetRows(int nRows
);
66 // Add all the buttons
68 virtual wxString
MacGetToolTipString( wxPoint
&where
) ;
69 void OnPaint(wxPaintEvent
& event
) ;
70 void OnMouse(wxMouseEvent
& event
) ;
71 virtual void MacSuperChangedPosition() ;
73 #if wxMAC_USE_NATIVE_TOOLBAR
74 bool MacInstallNativeToolbar(bool usesNative
);
75 bool MacWantsNativeToolbar();
76 bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled
) const;
79 // common part of all ctors
82 // implement base class pure virtuals
83 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
84 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
86 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
87 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
88 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
90 virtual wxToolBarToolBase
*CreateTool(int id
,
91 const wxString
& label
,
92 const wxBitmap
& bmpNormal
,
93 const wxBitmap
& bmpDisabled
,
96 const wxString
& shortHelp
,
97 const wxString
& longHelp
);
98 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
100 DECLARE_EVENT_TABLE()
101 #if wxMAC_USE_NATIVE_TOOLBAR
102 bool m_macUsesNativeToolbar
;
103 void* m_macHIToolbarRef
;
107 #endif // wxUSE_TOOLBAR