#ifndef _TOOL_BUTTON_H_
#define _TOOL_BUTTON_H_

#include "../tk/gui/gui.h"

class AppWindow;

/**
 * \brief ToolButton represent toolbutton in application window.
 * 
 * \date 01-29-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class ToolButton:public ButtonPressListener
{
	Ptr<TkRadioButton> button;
	AppWindow* appWindow;
	string name;
public:
	/**
	 * \brief return button name
	 * \return button name
	 */
	const string& getName() const
	{
		return name;
	}
	
	/**
	 * \brief Return shortcut to generated id
	 * \return generated id
	 */
	const string& getGeneratedId() const
	{
		return button->getGeneratedId();
	}
	
	Ptr<TkRadioButton>& getButton()
	{
		return button;
	}

	const Ptr<TkRadioButton>& getButton() const
	{
		return button;
	}

	/**
	 * \brief ctor
	 * \param interp interpret
	 * \param appWindow pointer to application window
	 * \param name Name of tool button. Also should be name of gif-image in the images\ directory
	 */
	ToolButton(Ptr<TclInterp>& interp,AppWindow* appWindow,const char* name);

	void onButtonPress(EHeader& header,int button,const string& state,int x,int y,int x_root,int y_root);
};

#endif/*_TOOL_BUTTON_H_*/
