]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/toolbar.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolBar class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TOOLBAR_H_
13 #define _WX_TOOLBAR_H_
16 #pragma interface "toolbar.h"
19 #include "wx/tbarbase.h"
21 WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr
;
23 class WXDLLEXPORT wxToolBar
: public wxToolBarBase
25 DECLARE_DYNAMIC_CLASS(wxToolBar
)
33 inline wxToolBar(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
34 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
35 const wxString
& name
= wxToolBarNameStr
):
36 m_widgets(wxKEY_INTEGER
)
39 Create(parent
, id
, pos
, size
, style
, name
);
43 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
44 long style
= wxNO_BORDER
|wxTB_HORIZONTAL
,
45 const wxString
& name
= wxToolBarNameStr
);
47 // If pushedBitmap is NULL, a reversed version of bitmap is
48 // created and used as the pushed/toggled image.
49 // If toggle is TRUE, the button toggles between the two states.
50 wxToolBarTool
*AddTool(int toolIndex
, const wxBitmap
& bitmap
, const wxBitmap
& pushedBitmap
= wxNullBitmap
,
51 bool toggle
= FALSE
, long xPos
= -1, long yPos
= -1, wxObject
*clientData
= NULL
,
52 const wxString
& helpString1
= "", const wxString
& helpString2
= "");
54 // Set default bitmap size
55 void SetToolBitmapSize(const wxSize
& size
);
56 void EnableTool(int toolIndex
, bool enable
); // additional drawing on enabling
57 void ToggleTool(int toolIndex
, bool toggle
); // toggle is TRUE if toggled on
60 // The button size is bigger than the bitmap size
61 wxSize
GetToolSize() const;
63 wxSize
GetMaxSize() const;
65 // Add all the buttons
66 virtual bool CreateTools();
67 virtual void Layout() {}
69 // The post-tool-addition call. TODO: do here whatever's
70 // necessary for completing the toolbar construction.
71 bool Realize() { return CreateTools(); };
74 void DestroyPixmaps();
75 int FindIndexForWidget(WXWidget w
);
76 WXWidget
FindWidgetForIndex(int index
);
78 WXWidget
GetTopWidget() const;
79 WXWidget
GetClientWidget() const;
80 WXWidget
GetMainWidget() const;
83 // List of widgets in the toolbar, indexed by tool index
86 // List of pixmaps to destroy when tools are recreated or
87 // or toolbar is destroyed.