1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #pragma interface "toolbar.h"
21 #include "wx/tbarbase.h"
22 #include "wx/dynarray.h"
24 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
26 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
28 DECLARE_DYNAMIC_CLASS(wxToolBar
)
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
)
40 Create(parent
, id
, pos
, size
, style
, name
);
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
);
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
= "");
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
61 // The button size is bigger than the bitmap size
62 wxSize
GetToolSize() const;
64 wxSize
GetMaxSize() const;
66 // Add all the buttons
67 virtual bool CreateTools();
68 virtual void LayoutButtons() {}
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
) ;
75 wxArrayPtrVoid m_macToolHandles
;
80 #endif // wxUSE_TOOLBAR