ToolBar.h revision 58ee42e9
1/*
2 * Copyright 2011-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _TOOLBAR_H
6#define _TOOLBAR_H
7
8#include <GroupView.h>
9
10
11class BButton;
12
13namespace BPrivate {
14
15class BToolBar : public BGroupView {
16public:
17								BToolBar(BRect frame,
18										 orientation ont = B_HORIZONTAL);
19								BToolBar(orientation ont = B_HORIZONTAL);
20	virtual						~BToolBar();
21
22	virtual	void				Hide();
23
24			void				AddAction(uint32 command, BHandler* target,
25									const BBitmap* icon,
26									const char* toolTipText = NULL,
27									const char* text = NULL,
28									bool lockable = false);
29			void				AddAction(BMessage* message, BHandler* target,
30									const BBitmap* icon,
31									const char* toolTipText = NULL,
32									const char* text = NULL,
33									bool lockable = false);
34			void				AddSeparator();
35			void				AddGlue();
36			void				AddView(BView* view);
37
38			void				SetActionEnabled(uint32 command, bool enabled);
39			void				SetActionPressed(uint32 command, bool pressed);
40			void				SetActionVisible(uint32 command, bool visible);
41
42private:
43	virtual	void				Pulse();
44	virtual	void				FrameResized(float width, float height);
45
46			void				_Init();
47			BButton*			_FindButton(uint32 command) const;
48			void				_HideToolTips() const;
49
50			orientation			fOrientation;
51};
52
53} // namespace BPrivate
54
55using BPrivate::BToolBar;
56
57#endif // _TOOLBAR_H
58