]>
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_acceptsFirstMouse(bool &acceptsFirstMouse
, WX_NSEvent theEvent
);
61 virtual bool Cocoa_drawRect(const NSRect
&rect
);
62 virtual bool Cocoa_mouseDown(WX_NSEvent theEvent
);
63 virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent
);
64 wxToolBarTool
*CocoaFindToolForPosition(const NSPoint
& pos
) const;
65 void CocoaToolClickEnded();
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
70 // override base class virtuals
71 virtual void SetMargins(int x
, int y
);
72 virtual void SetToolSeparation(int separation
);
74 virtual wxToolBarToolBase
*FindToolForPosition(wxCoord x
, wxCoord y
) const;
76 virtual void SetToolShortHelp(int toolid
, const wxString
& helpString
);
78 virtual void SetWindowStyleFlag( long style
);
80 // implementation from now on
81 // --------------------------
83 void OnInternalIdle();
84 virtual bool Realize();
85 virtual wxSize
DoGetBestSize() const;
87 void SetOwningFrame(wxFrame
*owningFrame
)
88 { m_owningFrame
= owningFrame
; }
90 // implement base class pure virtuals
91 virtual bool DoInsertTool(size_t pos
, wxToolBarToolBase
*tool
);
92 virtual bool DoDeleteTool(size_t pos
, wxToolBarToolBase
*tool
);
94 virtual void DoEnableTool(wxToolBarToolBase
*tool
, bool enable
);
95 virtual void DoToggleTool(wxToolBarToolBase
*tool
, bool toggle
);
96 virtual void DoSetToggle(wxToolBarToolBase
*tool
, bool toggle
);
98 virtual wxToolBarToolBase
*CreateTool(int toolid
,
99 const wxString
& label
,
100 const wxBitmap
& bitmap1
,
101 const wxBitmap
& bitmap2
,
103 wxObject
*clientData
,
104 const wxString
& shortHelpString
,
105 const wxString
& longHelpString
);
106 virtual wxToolBarToolBase
*CreateTool(wxControl
*control
);
109 wxFrame
*m_owningFrame
;
110 wxToolBarTool
*m_mouseDownTool
;
113 #endif // wxUSE_TOOLBAR
115 #endif // __WX_COCOA_TOOLBAR_H__