2011-03-20 12:53:38 +00:00
|
|
|
/*
|
2015-02-11 22:54:48 -05:00
|
|
|
* Copyright 2011-2015, Haiku, Inc. All rights reserved.
|
2014-11-07 22:53:18 -05:00
|
|
|
* Distributed under the terms of the MIT License.
|
2011-03-20 12:53:38 +00:00
|
|
|
*/
|
2014-10-30 15:46:36 -04:00
|
|
|
#ifndef _TOOLBAR_H
|
|
|
|
#define _TOOLBAR_H
|
2011-03-20 12:53:38 +00:00
|
|
|
|
|
|
|
#include <GroupView.h>
|
|
|
|
|
|
|
|
|
2014-04-28 18:13:20 +02:00
|
|
|
class BButton;
|
2011-03-20 12:53:38 +00:00
|
|
|
|
2014-11-06 16:43:08 +13:00
|
|
|
namespace BPrivate {
|
2011-03-20 12:53:38 +00:00
|
|
|
|
2015-02-11 22:54:48 -05:00
|
|
|
class BToolBar : public BGroupView {
|
2011-03-20 12:53:38 +00:00
|
|
|
public:
|
2015-02-11 22:54:48 -05:00
|
|
|
BToolBar(BRect frame,
|
|
|
|
orientation ont = B_HORIZONTAL);
|
2015-02-11 23:06:21 -05:00
|
|
|
BToolBar(orientation ont = B_HORIZONTAL);
|
2015-02-11 22:54:48 -05:00
|
|
|
virtual ~BToolBar();
|
2011-03-20 12:53:38 +00:00
|
|
|
|
2011-03-21 10:59:10 +00:00
|
|
|
virtual void Hide();
|
|
|
|
|
2011-03-20 12:53:38 +00:00
|
|
|
void AddAction(uint32 command, BHandler* target,
|
|
|
|
const BBitmap* icon,
|
2014-04-28 22:00:45 +02:00
|
|
|
const char* toolTipText = NULL,
|
2015-07-22 12:16:31 -04:00
|
|
|
const char* text = NULL,
|
2014-04-28 22:00:45 +02:00
|
|
|
bool lockable = false);
|
2011-03-20 12:53:38 +00:00
|
|
|
void AddAction(BMessage* message, BHandler* target,
|
|
|
|
const BBitmap* icon,
|
2014-04-28 22:00:45 +02:00
|
|
|
const char* toolTipText = NULL,
|
2015-07-22 12:16:31 -04:00
|
|
|
const char* text = NULL,
|
2014-04-28 22:00:45 +02:00
|
|
|
bool lockable = false);
|
2011-03-20 12:53:38 +00:00
|
|
|
void AddSeparator();
|
2011-04-08 14:59:54 +00:00
|
|
|
void AddGlue();
|
2015-02-11 23:06:21 -05:00
|
|
|
void AddView(BView* view);
|
2011-03-20 12:53:38 +00:00
|
|
|
|
|
|
|
void SetActionEnabled(uint32 command, bool enabled);
|
|
|
|
void SetActionPressed(uint32 command, bool pressed);
|
2011-04-08 14:59:54 +00:00
|
|
|
void SetActionVisible(uint32 command, bool visible);
|
2011-03-20 12:53:38 +00:00
|
|
|
|
2015-09-02 21:31:09 +02:00
|
|
|
BButton* FindButton(uint32 command) const;
|
|
|
|
|
2011-03-20 12:53:38 +00:00
|
|
|
private:
|
2011-03-21 10:59:10 +00:00
|
|
|
virtual void Pulse();
|
|
|
|
virtual void FrameResized(float width, float height);
|
|
|
|
|
2015-02-11 23:06:21 -05:00
|
|
|
void _Init();
|
2011-03-21 10:59:10 +00:00
|
|
|
void _HideToolTips() const;
|
2015-02-11 22:54:48 -05:00
|
|
|
|
2014-11-07 22:53:18 -05:00
|
|
|
orientation fOrientation;
|
2011-03-20 12:53:38 +00:00
|
|
|
};
|
|
|
|
|
2014-11-06 16:43:08 +13:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
2015-02-11 22:54:48 -05:00
|
|
|
using BPrivate::BToolBar;
|
2014-11-06 16:43:08 +13:00
|
|
|
|
2014-10-30 15:46:36 -04:00
|
|
|
#endif // _TOOLBAR_H
|