Example #1
0
UIList::UIList(const Rect &rect, eListOrientation requiredOrientation, bool rectInAbsoluteCoordinates/* = FALSE*/)
	:	UIControl(rect, rectInAbsoluteCoordinates)
	,	delegate(NULL)
	,	orientation(requiredOrientation)
{
		InitAfterYaml();
}
Example #2
0
void UIList::LoadFromYamlNode(YamlNode * node, UIYamlLoader * loader)
{
	UIControl::LoadFromYamlNode(node, loader);
		
	YamlNode * orientNode = node->Get("orientation");
	if (orientNode)
	{
		if (orientNode->AsString() == "ORIENTATION_VERTICAL")
			orientation = ORIENTATION_VERTICAL;
		else if (orientNode->AsString() == "ORIENTATION_HORIZONTAL")
			orientation = ORIENTATION_HORIZONTAL;
		else 
		{
			DVASSERT(0 && "Orientation constant is wrong");
		}
	}
		
		
		
		// TODO
	InitAfterYaml();
}
Example #3
0
UIList::UIList() : delegate(NULL), orientation(ORIENTATION_VERTICAL), scrollContainer(NULL), scroll(NULL)
{
	InitAfterYaml();
}
void UITextField::LoadFromYamlNode(YamlNode * node, UIYamlLoader * loader)
{
	UIControl::LoadFromYamlNode(node, loader);

    YamlNode * textNode = node->Get("text");
	if (textNode)
    {
        SetText(textNode->AsWString());
    }

    YamlNode * fontNode = node->Get("font");
    if (fontNode)
    {
        Font * font = loader->GetFontByName(fontNode->AsString());
        if (font)
            SetFont(font);
    }

    if(staticText)
    {
        staticText->SetRect(Rect(0,0,GetRect().dx, GetRect().dy));
		
		YamlNode * textColorNode = node->Get("textcolor");
		YamlNode * shadowColorNode = node->Get("shadowcolor");
		YamlNode * shadowOffsetNode = node->Get("shadowoffset");
		YamlNode * textAlignNode = node->Get("textalign");
		
		if(textColorNode)
		{
			Vector4 c = textColorNode->AsVector4();
			SetTextColor(Color(c.x, c.y, c.z, c.w));
		}

		if(shadowColorNode)
		{
			Vector4 c = shadowColorNode->AsVector4();
			SetShadowColor(Color(c.x, c.y, c.z, c.w));
		}

		if(shadowOffsetNode)
		{
			SetShadowOffset(shadowOffsetNode->AsVector2());
		}

		if(textAlignNode)
		{
			SetTextAlign(loader->GetAlignFromYamlNode(textAlignNode));
		}
    }
    //InitAfterYaml();

#if 0
	YamlNode * orientNode = node->Get("orientation");
	if (orientNode)
	{
		if (orientNode->AsString() == "Vertical")
			orientation = ORIENTATION_VERTICAL;
		else if (orientNode->AsString() == "Horizontal")
			orientation = ORIENTATION_HORIZONTAL;
	}



		// TODO
	InitAfterYaml();
#endif
}