]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/classic/toolbar.h
wxHelpController now wxCHMHelpController on Windows
[wxWidgets.git] / include / wx / mac / classic / toolbar.h
CommitLineData
52479aef
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: 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
65571936 9// Licence: wxWindows licence
52479aef
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_TOOLBAR_H_
13#define _WX_TOOLBAR_H_
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16#pragma interface "toolbar.h"
17#endif
18
19#if wxUSE_TOOLBAR
20
21#include "wx/tbarbase.h"
22#include "wx/dynarray.h"
23
24WXDLLEXPORT_DATA(extern const wxChar*) wxToolBarNameStr;
25
26class WXDLLEXPORT wxToolBar: public wxToolBarBase
27{
28 DECLARE_DYNAMIC_CLASS(wxToolBar)
29 public:
30 /*
31 * Public interface
32 */
33
34 wxToolBar() { Init(); }
35
36
37 inline wxToolBar(wxWindow *parent, wxWindowID id,
38 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
39 long style = wxNO_BORDER|wxTB_HORIZONTAL,
40 const wxString& name = wxToolBarNameStr)
41 {
42 Init();
43 Create(parent, id, pos, size, style, name);
44 }
45 ~wxToolBar();
46
47 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
48 long style = wxNO_BORDER|wxTB_HORIZONTAL,
49 const wxString& name = wxToolBarNameStr);
50
51 // override/implement base class virtuals
52 virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
53
54 virtual bool Realize();
55
56 virtual void SetToolBitmapSize(const wxSize& size);
57 virtual wxSize GetToolSize() const;
58
59 virtual void SetRows(int nRows);
60
61 // Add all the buttons
62
63 virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
64 virtual wxString MacGetToolTipString( wxPoint &where ) ;
65 void OnPaint(wxPaintEvent& event) ;
66 void OnMouse(wxMouseEvent& event) ;
67 virtual void MacSuperChangedPosition() ;
68protected:
69 // common part of all ctors
70 void Init();
71
72 // implement base class pure virtuals
73 virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
74 virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
75
76 virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
77 virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
78 virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
79
80 virtual wxToolBarToolBase *CreateTool(int id,
81 const wxString& label,
82 const wxBitmap& bmpNormal,
83 const wxBitmap& bmpDisabled,
84 wxItemKind kind,
85 wxObject *clientData,
86 const wxString& shortHelp,
87 const wxString& longHelp);
88 virtual wxToolBarToolBase *CreateTool(wxControl *control);
89
90 DECLARE_EVENT_TABLE()
91};
92
93#endif // wxUSE_TOOLBAR
94
95#endif
96 // _WX_TOOLBAR_H_