]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/toolbar.h
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_TOOLBAR_H__
13 #define __WX_COCOA_TOOLBAR_H__
17 // ========================================================================
19 // ========================================================================
20 typedef struct _NSPoint NSPoint
;
23 class wxToolBar
: public wxToolBarBase
25 DECLARE_DYNAMIC_CLASS(wxToolBar
)
26 // ------------------------------------------------------------------------
28 // ------------------------------------------------------------------------
30 wxToolBar() { Init(); }
31 wxToolBar( wxWindow
*parent
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
36 const wxString
& name
= wxToolBarNameStr
)
40 Create(parent
, toolid
, pos
, size
, style
, name
);
43 bool Create( wxWindow
*parent
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
48 const wxString
& name
= wxToolBarNameStr
);
53 // common part of all ctors
56 // ------------------------------------------------------------------------
58 // ------------------------------------------------------------------------
60 virtual bool Cocoa_drawRect(const NSRect
&rect
);
61 virtual bool Cocoa_mouseDown(WX_NSEvent theEvent
);
62 virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent
);
63 wxToolBarTool
*CocoaFindToolForPosition(const NSPoint
& pos
) const;
64 // ------------------------------------------------------------------------
66 // ------------------------------------------------------------------------
68 // override base class virtuals
69 virtual void SetMargins(int x
, int y
);
70 virtual void SetToolSeparation(int separation
);
72 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
74 virtual void SetToolShortHelp(int toolid
, const wxString
& helpString
);
76 virtual void SetWindowStyleFlag( long style
);
78 // implementation from now on
79 // --------------------------
81 void OnInternalIdle();
82 virtual bool Realize();
83 virtual wxSize
DoGetBestSize() const;
85 void SetOwningFrame(wxFrame
*owningFrame
)
86 { m_owningFrame
= owningFrame
; }
88 // implement base class pure virtuals
89 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
90 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
92 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
93 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
94 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
96 virtual wxToolBarToolBase
*CreateTool(int toolid
,
97 const wxString
& label
,
98 const wxBitmap
& bitmap1
,
99 const wxBitmap
& bitmap2
,
101 wxObject
*clientData
,
102 const wxString
& shortHelpString
,
103 const wxString
& longHelpString
);
104 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
107 wxFrame
*m_owningFrame
;
108 wxToolBarTool
*m_mouseDownTool
;
111 #endif // wxUSE_TOOLBAR
113 #endif // __WX_COCOA_TOOLBAR_H__