]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/toolbar.h
Only compile wxStd{Input,Output}Stream if wxUSE_STREAMS==1.
[wxWidgets.git] / include / wx / osx / toolbar.h
CommitLineData
6762286d
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/mac/carbon/toolbar.h
3// Purpose: wxToolBar class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_TOOLBAR_H_
13#define _WX_TOOLBAR_H_
14
15#if wxUSE_TOOLBAR
16
17#include "wx/tbarbase.h"
18#include "wx/dynarray.h"
19
20WXDLLIMPEXP_DATA_CORE(extern const char) wxToolBarNameStr[];
21
22class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase
23{
24 DECLARE_DYNAMIC_CLASS(wxToolBar)
25 public:
26 /*
27 * Public interface
28 */
29
30 wxToolBar() { Init(); }
31
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)
36 {
37 Init();
38 Create(parent, id, pos, size, style, name);
39 }
40 virtual ~wxToolBar();
41
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);
45
46 virtual void SetWindowStyleFlag(long style);
1665389a
KO
47
48 virtual bool Destroy();
6762286d
SC
49
50 // override/implement base class virtuals
51 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
52
a0b48f26 53#ifndef __WXOSX_IPHONE__
6762286d
SC
54 virtual bool Show(bool show = true);
55 virtual bool IsShown() const;
a0b48f26 56#endif
6762286d
SC
57 virtual bool Realize();
58
59 virtual void SetToolBitmapSize(const wxSize& size);
60 virtual wxSize GetToolSize() const;
61
62 virtual void SetRows(int nRows);
63
64 virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap);
65 virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap);
66
a0b48f26 67#ifndef __WXOSX_IPHONE__
6762286d
SC
68 // Add all the buttons
69
70 virtual wxString MacGetToolTipString( wxPoint &where ) ;
71 void OnPaint(wxPaintEvent& event) ;
72 void OnMouse(wxMouseEvent& event) ;
73 virtual void MacSuperChangedPosition() ;
a0b48f26
SC
74#endif
75
6762286d
SC
76#if wxOSX_USE_NATIVE_TOOLBAR
77 bool MacInstallNativeToolbar(bool usesNative);
1665389a 78 void MacUninstallNativeToolbar();
6762286d
SC
79 bool MacWantsNativeToolbar();
80 bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const;
5c6eb3a8 81#endif
6762286d
SC
82protected:
83 // common part of all ctors
84 void Init();
85
a0b48f26
SC
86#ifndef __WXOSX_IPHONE__
87 virtual void DoGetSize(int *width, int *height) const;
6762286d 88 virtual wxSize DoGetBestSize() const;
a0b48f26 89#endif
6762286d
SC
90 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
91 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
92
93 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
94 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
95 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
96
97 virtual wxToolBarToolBase *CreateTool(int id,
98 const wxString& label,
99 const wxBitmap& bmpNormal,
100 const wxBitmap& bmpDisabled,
101 wxItemKind kind,
102 wxObject *clientData,
103 const wxString& shortHelp,
104 const wxString& longHelp);
105 virtual wxToolBarToolBase *CreateTool(wxControl *control,
106 const wxString& label);
107
108 DECLARE_EVENT_TABLE()
109#if wxOSX_USE_NATIVE_TOOLBAR
110 bool m_macUsesNativeToolbar ;
111 void* m_macToolbar ;
112#endif
a0b48f26
SC
113#ifdef __WXOSX_IPHONE__
114 WX_UIView m_macToolbar;
115#endif
6762286d
SC
116};
117
118#endif // wxUSE_TOOLBAR
119
120#endif
121 // _WX_TOOLBAR_H_