/*!
	@file
	@author		Albert Semenov
	@date		01/2008
	@module
*/
#include "MyGUI_Sheet.h"
#include "MyGUI_Tab.h"

namespace MyGUI
{

	Sheet::Sheet(const IntCoord& _coord, char _align, const WidgetSkinInfoPtr _info, CroppedRectanglePtr _parent, const Ogre::String & _name) :
		Widget(_coord, _align, _info, _parent, _name),
		mOwner(null)
	{
	}

	void Sheet::setPosition(const IntPoint& _pos) {Widget::setPosition(_pos);}
	void Sheet::setPosition(const IntCoord& _coord) {Widget::setPosition(_coord);}
	void Sheet::setSize(const IntSize& _size) {Widget::setSize(_size);}

	void Sheet::show() {Widget::show();}
	void Sheet::hide() {Widget::hide();}

	void Sheet::setCaption(const Ogre::DisplayString & _caption)
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		mOwner->setSheetName(this, _caption);
	}

	const Ogre::DisplayString & Sheet::getCaption()
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		return mOwner->getSheetName(this);
	}

	const Ogre::DisplayString & Sheet::getSheetName()
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		return mOwner->getSheetName(this);
	}

	void Sheet::setSheetName(const Ogre::DisplayString & _name, int _width)
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		mOwner->setSheetName(this, _name, _width);
	}

	int Sheet::getSheetButtonWidth()
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		return mOwner->getSheetButtonWidth(this);
	}

	void Sheet::setSheetButtonWidth(int _width)
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		mOwner->setSheetButtonWidth(this, _width);
	}

	void Sheet::selectSheet(bool _smooth)
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		mOwner->selectSheet(this, _smooth);
	}

	void Sheet::removeSheet()
	{
		MYGUI_ASSERT(null != mOwner, "Sheet must create only in Tab");
		mOwner->removeSheet(this);
	}

} // namespace MyGUI
