#ifndef TOOL_BUTTONBARBUTTON_INCLUDED
#define TOOL_BUTTONBARBUTTON_INCLUDED
///////////////////////////////////////////////////////////////////////////
//
// File: ToolButtonBarButton.h
//
// Description: Helper class for tool (mode) buttons
//
// Copyright 2010 Autodesk, Inc. All rights reserved.
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy
// form.
//
///////////////////////////////////////////////////////////////////////////
#include <xsi_toolcontext.h>
#ifndef linux
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // Needed for OpenGL on windows
#endif
#include <string.h>
#ifndef linux
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // Needed for OpenGL on windows
#endif

#include "GL/glew.h"
using namespace XSI; 

////////////////////////////////////////////////////////////////////////////////
//
// ToolButtonBarButton class
//
////////////////////////////////////////////////////////////////////////////////

class ToolButtonBarButton {
public:
	ToolButtonBarButton();
	~ToolButtonBarButton();
	void Setup( const wchar_t *basename, LONG in_index, LONG in_count );
	void Cleanup();
	bool IsSelected() const { return m_bSelected; }
	void SetSelected( bool in_bSelected ) { m_bSelected = in_bSelected; }
	bool IsPointInside( ToolContext &in_ctxt, LONG x, LONG y ) const;
	void Draw( ToolContext &in_ctxt );
	void LoadTextures( ToolContext &in_ctxt );

	//Added 21.01.2012
	CString GetTooltip() const {return m_tooltip;}
	void SetTooltip(CString in_str) { m_tooltip = in_str;}

	CStatus GetButtonPosition( ToolContext &in_ctxt, LONG out_rect[] ) const;
private: // Implementation
	
	void PremultiplyAlpha( GLubyte *pixel );
private: // Data
	CString		m_basename;			// Base texture name
	GLuint		m_textureID[2];		// OpenGL texture IDs
	LONG		m_buttonSize[2];	// Button size
	LONG		m_buttonIndex;		// Index of button
	LONG		m_buttonCount;		// Total number of buttons
	bool		m_bSelected;		// Selected state

	//Added 21.01.2012
	CString		m_tooltip;
};

#endif // TOOL_BUTTONBARBUTTON_INCLUDED
