/******************************************************************************
 JXToolBarButton.h

	Interface for the JXToolBarButton class

	Copyright © 1998 by Glenn W. Bach.  All rights reserved.
	
	Base code generated by Codemill v0.1.0

 *****************************************************************************/

#ifndef _H_JXToolBarButton
#define _H_JXToolBarButton

#include <JXButton.h>
#include <JString.h>
#include <JFontStyle.h>

class JXTextMenu;
class JXImage;
class JXHintsDir;

class JXToolBarButton : public JXButton
{
public:

	enum Type
	{
		kImage = 1,
		kText,
		kBoth
	};
	
public:

	JXToolBarButton(JXTextMenu*	menu, const JIndex index,
					const Type type, JXContainer* enclosure,
				  	const HSizingOption hSizing, const VSizingOption vSizing,
				  	const JCoordinate x, const JCoordinate y,
				  	const JCoordinate h);
	virtual ~JXToolBarButton();

	JXTextMenu*		GetMenu() const;
	JIndex 			GetMenuItem() const;
	
	virtual void	Activate();
	virtual void	Deactivate();

	JBoolean		NeedsGeometryAdjustment();

protected:

	virtual void	Draw(JXWindowPainter& p, const JRect& rect);
	virtual void	DrawBorder(JXWindowPainter& p, const JRect& frame);

private:

	JXTextMenu*	itsMenu;
	JIndex		itsMenuItem;

	Type		itsType;

	JXImage*	itsImage;	// we don't own this

	JString		itsLabel;
	JColorIndex	itsTrueLabelColor;
	JString		itsFontName;
	JSize 		itsFontSize;
	JFontStyle	itsFontStyle;

	JBoolean	itsIsDown;
	JBoolean	itsIsPushed;

private:

	void	CloseHints();

	// not allowed

	JXToolBarButton(const JXToolBarButton& source);
	const JXToolBarButton& operator=(const JXToolBarButton& source);

};

/******************************************************************************
 GetMenu

 ******************************************************************************/

inline JXTextMenu*	
JXToolBarButton::GetMenu()
	const
{
	return itsMenu;
}

/******************************************************************************
 GetMenuItem

 ******************************************************************************/

inline JIndex
JXToolBarButton::GetMenuItem()
	const
{
	return itsMenuItem;
}

#endif
