]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/toolbar.h
Rotated text patch from Hans-Joachim Baader (with some corrections)
[wxWidgets.git] / include / wx / mac / toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: toolbar.h
3 // Purpose: wxToolBar class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
14
15 #ifdef __GNUG__
16 #pragma interface "toolbar.h"
17 #endif
18
19 #if wxUSE_TOOLBAR
20
21 #include "wx/tbarbase.h"
22 #include "wx/dynarray.h"
23
24 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
25
26 class WXDLLEXPORT wxToolBar: public wxToolBarBase
27 {
28 DECLARE_DYNAMIC_CLASS(wxToolBar)
29 public:
30 /*
31 * Public interface
32 */
33
34 wxToolBar();
35
36 inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
37 long style = wxNO_BORDER|wxTB_HORIZONTAL,
38 const wxString& name = wxToolBarNameStr)
39 {
40 Create(parent, id, pos, size, style, name);
41 }
42 ~wxToolBar();
43
44 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
45 long style = wxNO_BORDER|wxTB_HORIZONTAL,
46 const wxString& name = wxToolBarNameStr);
47
48 // If pushedBitmap is NULL, a reversed version of bitmap is
49 // created and used as the pushed/toggled image.
50 // If toggle is TRUE, the button toggles between the two states.
51 wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
52 bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
53 const wxString& helpString1 = "", const wxString& helpString2 = "");
54
55 // Set default bitmap size
56 void SetToolBitmapSize(const wxSize& size);
57 void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
58 void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
59 void ClearTools();
60
61 // The button size is bigger than the bitmap size
62 wxSize GetToolSize() const;
63
64 wxSize GetMaxSize() const;
65
66 // Add all the buttons
67 virtual bool CreateTools();
68 virtual void LayoutButtons() {}
69
70 // The post-tool-addition call. TODO: do here whatever's
71 // necessary for completing the toolbar construction.
72 bool Realize() { return CreateTools(); };
73 virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
74 protected:
75 wxArrayPtrVoid m_macToolHandles ;
76
77 DECLARE_EVENT_TABLE()
78 };
79
80 #endif // wxUSE_TOOLBAR
81
82 #endif
83 // _WX_TOOLBAR_H_