#ifndef _BUTTON_BAR_H
#define _BUTTON_BAR_H

#include <Box.h>

#include "BmapButton.h"

struct BBDivider;

class ButtonBar : public BBox {
public:
	ButtonBar(BRect frame, const char *name, uint8 enabledOffset,
		uint8 disabledOffset, uint8 rollOffset, uint8 pressedOffset,
		float Hmargin, float Vmargin, 
		uint32 resizeMask = B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
		int32 flags = B_NAVIGABLE_JUMP | B_FRAME_EVENTS | B_WILL_DRAW,
		border_style border = B_FANCY_BORDER);
	virtual ~ButtonBar( void );
		
	// Hooks
	virtual void GetPreferredSize(float *width, float *height);
	virtual void AttachedToWindow(void);
	virtual void Draw(BRect updateRect);
		
	void ShowLabels(bool show);
	void Arrange(bool fixedWidth = true);
	BmapButton *AddButton(const char *label, int32 baseID, BMessage *msg);
	void AddDivider(float vmargin);
		
protected:
	float fMaxHeight;
	float fMaxWidth;
	float fNextXOffset;
	float fHMargin;
	float fVMargin;
	uint8 fEnabledOffset;
	uint8 fDisabledOffset;
	uint8 fRollOffset;
	uint8 fPressedOffset;
	BList fButtonList;
	BBDivider *fDividerArray;
	int32 fDividers;
	bool fShowLabels;
};

#endif // #ifndef _BUTTON_BAR_H
