#include "tk_frame.h"

const Ptr<TkOptionDef> TkFrame::OPT_BORDERWIDTH=new TkOptionDef("borderwidth",TkIntOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_CLASS=0;
const Ptr<TkOptionDef> TkFrame::OPT_RELIEF=new TkOptionDef("relief",TkReliefOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_BACKGROUND=new TkOptionDef("background",TkColorOption::type) ;
const Ptr<TkOptionDef> TkFrame::OPT_COLORMAP=0;
const Ptr<TkOptionDef> TkFrame::OPT_CONTAINER=0;
const Ptr<TkOptionDef> TkFrame::OPT_CURSOR=0;
const Ptr<TkOptionDef> TkFrame::OPT_HEIGHT=new TkOptionDef("height",TkIntOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_HIGHLIGHTBACKGROUND=new TkOptionDef("highlightbackground",TkColorOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_HIGHLIGHTCOLOR=new TkOptionDef("highlightcolor",TkColorOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_HIGHLIGHTTHICKNESS ;
const Ptr<TkOptionDef> TkFrame::OPT_PADX=new TkOptionDef("padx",TkIntOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_PADY=new TkOptionDef("pady",TkIntOption::type);
const Ptr<TkOptionDef> TkFrame::OPT_VISUAL=0;
const Ptr<TkOptionDef> TkFrame::OPT_WIDTH=new TkOptionDef("width",TkIntOption::type);

const Ptr<TkOptionDef> TkFrame::optAll[]=
{
	TkFrame::OPT_BORDERWIDTH,
	TkFrame::OPT_CLASS,
	TkFrame::OPT_RELIEF,
	TkFrame::OPT_BACKGROUND,
	TkFrame::OPT_COLORMAP,
	TkFrame::OPT_CONTAINER,
	TkFrame::OPT_CURSOR,
	TkFrame::OPT_HEIGHT,
	TkFrame::OPT_HIGHLIGHTBACKGROUND,
	TkFrame::OPT_HIGHLIGHTCOLOR,
	TkFrame::OPT_HIGHLIGHTTHICKNESS,
	TkFrame::OPT_PADX,
	TkFrame::OPT_PADY,
	TkFrame::OPT_VISUAL,
	TkFrame::OPT_WIDTH
};

const char* TkFrame::type="TkFrame";
const char* TkFrame::tkClass="frame";

const Ptr<TkOptionDef>* TkFrame::getOptionAll() const
{
	return TkFrame::optAll;
}

const char* TkFrame::getType() const
{
	return TkFrame::type;
}

const char* TkFrame::getTkClass() const
{
	return TkFrame::tkClass;
}

void TkFrame::doSerialize(TiXmlElement& element) const
{
	TkContainer::doSerialize(element);
}

void TkFrame::doDeserialize(const TiXmlElement& element)
{
	TkContainer::doDeserialize(element);
}

TObject* TkFrame::clone()
{
	TkBase* obj=new TkFrame(interp);

	baseClone(obj);

	return obj;
}

void TkFrame::setBackgroundColor(TkColorOption* color)
{
	setOption(OPT_BACKGROUND,color);
}

Ptr<TkColorOption>& TkFrame::getBackgroundColor() const
{
	TkColorOption* colorOption=new TkColorOption();
	
	colorOption->fromObject(getOption(OPT_BACKGROUND));
	return *(new Ptr<TkColorOption>(colorOption));
}

