7d226266e6
* Move common init. code to an _Init() function. * Create a layout constructor. * Make _AddView public and rename it to AddView.
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
/*
|
|
* Copyright 2011-2015, Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _TOOLBAR_H
|
|
#define _TOOLBAR_H
|
|
|
|
#include <GroupView.h>
|
|
|
|
|
|
class BButton;
|
|
|
|
namespace BPrivate {
|
|
|
|
class BToolBar : public BGroupView {
|
|
public:
|
|
BToolBar(BRect frame,
|
|
orientation ont = B_HORIZONTAL);
|
|
BToolBar(orientation ont = B_HORIZONTAL);
|
|
virtual ~BToolBar();
|
|
|
|
virtual void Hide();
|
|
|
|
void AddAction(uint32 command, BHandler* target,
|
|
const BBitmap* icon,
|
|
const char* toolTipText = NULL,
|
|
bool lockable = false);
|
|
void AddAction(BMessage* message, BHandler* target,
|
|
const BBitmap* icon,
|
|
const char* toolTipText = NULL,
|
|
bool lockable = false);
|
|
void AddSeparator();
|
|
void AddGlue();
|
|
void AddView(BView* view);
|
|
|
|
void SetActionEnabled(uint32 command, bool enabled);
|
|
void SetActionPressed(uint32 command, bool pressed);
|
|
void SetActionVisible(uint32 command, bool visible);
|
|
|
|
private:
|
|
virtual void Pulse();
|
|
virtual void FrameResized(float width, float height);
|
|
|
|
void _Init();
|
|
BButton* _FindButton(uint32 command) const;
|
|
void _HideToolTips() const;
|
|
|
|
orientation fOrientation;
|
|
};
|
|
|
|
} // namespace BPrivate
|
|
|
|
using BPrivate::BToolBar;
|
|
|
|
#endif // _TOOLBAR_H
|