mirror of
https://review.haiku-os.org/haiku
synced 2025-02-02 03:36:14 +01:00
58ee42e9df
For defining the text that appears alongside the icon. This function really has too many parameters; we probably should break it out into a BAction class...
58 lines
1.4 KiB
C++
58 lines
1.4 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,
|
|
const char* text = NULL,
|
|
bool lockable = false);
|
|
void AddAction(BMessage* message, BHandler* target,
|
|
const BBitmap* icon,
|
|
const char* toolTipText = NULL,
|
|
const char* text = 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
|