void CTripleLinkageOpt::SetTicsArray(vector<int>& szTics)
{
    m_szTicMarks = &szTics;
    //	m_szTicMarks->clear();
    //	m_szTicMarks->insert(m_szTicMarks->end(), szTics.begin(), szTics.end());
    InitThumb(m_bHorizontal, m_szThumb[0]->GetWidth(), m_rcChannel);
}
Ejemplo n.º 2
0
UISlider::UISlider(const Rect & rect)
:	UIControl(rect)
,	bgMin(0)
,	bgMax(0)
{
	inputEnabled = true;
	isEventsContinuos = true;
	
#if 0
	thumbButton = new UIControl(Rect(0, 0, 40.f, 40.f));
	thumbButton->SetInputEnabled(false);
	
	thumbButton->relativePosition.y -= Abs(rect.dy - thumbButton->size.y) / 2.0f; 
#endif
	
	
	leftInactivePart = 0;
	rightInactivePart = 0;
	minValue = 0.0f;
	maxValue = 1.0f;
	currentValue = 0.5f;

#if 0
	AddControl(thumbButton);

	SetValue(currentValue);
#endif
	
	InitThumb();
	
//	thumbButton->SetDebugDraw(TRUE);
//	SetDebugDraw(true);
}
Ejemplo n.º 3
0
void UISlider::LoadFromYamlNode(YamlNode * node, UIYamlLoader * loader)
{
	UIControl::LoadFromYamlNode(node, loader);
	
	InitThumb();
	
	YamlNode * thumbSpriteNode = node->Get("thumbSprite");

	if (thumbSpriteNode)
	{
		YamlNode * spriteNode = thumbSpriteNode->Get(0);
		YamlNode * frameNode = thumbSpriteNode->Get(1);
		
		if (spriteNode)
			SetThumbSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	YamlNode * minSpriteNode = node->Get("minSprite");
	
	if (minSpriteNode)
	{
		YamlNode * spriteNode = minSpriteNode->Get(0);
		YamlNode * frameNode = minSpriteNode->Get(1);
		
		if (spriteNode)
			SetMinSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	YamlNode * maxSpriteNode = node->Get("maxSprite");
	
	if (maxSpriteNode)
	{
		YamlNode * spriteNode = maxSpriteNode->Get(0);
		YamlNode * frameNode = maxSpriteNode->Get(1);
		
		if (spriteNode)
			SetMaxSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	YamlNode * valueNode = node->Get("value");
	
	if (valueNode)
		SetValue(valueNode->AsFloat());
}
Ejemplo n.º 4
0
UISlider::UISlider(const Rect & rect)
    :	UIControl(rect)
    ,	minBackground(NULL)
    ,	maxBackground(NULL)
    ,	thumbButton(NULL)
    ,   spritesEmbedded(false)
{
    SetInputEnabled(true, false);
    isEventsContinuos = true;

    leftInactivePart = 0;
    rightInactivePart = 0;
    minValue = 0.0f;
    maxValue = 1.0f;
    currentValue = 0.5f;

    minBackground = new UIControlBackground();
    maxBackground = new UIControlBackground();
    InitThumb();
}
Ejemplo n.º 5
0
void UISlider::LoadFromYamlNode(YamlNode * node, UIYamlLoader * loader)
{
	UIControl::LoadFromYamlNode(node, loader);
	
	InitThumb();
	
	YamlNode * thumbSpriteNode = node->Get("thumbSprite");

	if (thumbSpriteNode)
	{
		YamlNode * spriteNode = thumbSpriteNode->Get(0);
		YamlNode * frameNode = thumbSpriteNode->Get(1);
		
		if (spriteNode)
			SetThumbSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	YamlNode * minSpriteNode = node->Get("minSprite");
	
	if (minSpriteNode)
	{
		YamlNode * spriteNode = minSpriteNode->Get(0);
		YamlNode * frameNode = minSpriteNode->Get(1);
		
		if (spriteNode)
			SetMinSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	YamlNode * maxSpriteNode = node->Get("maxSprite");
	
	if (maxSpriteNode)
	{
		YamlNode * spriteNode = maxSpriteNode->Get(0);
		YamlNode * frameNode = maxSpriteNode->Get(1);
		
		if (spriteNode)
			SetMaxSprite(spriteNode->AsString(), frameNode->AsInt());
		//SetMinSprite("/XGfx/Options/slider_bg", 1);
		//SetMaxSprite("/XGfx/Options/slider_bg", 0);
	}
	
	// Values
	YamlNode * valueNode = node->Get("value");
	
	if (valueNode)
		SetValue(valueNode->AsFloat());
		
	YamlNode * minValueNode= node->Get("minValue");
	
	if (minValueNode)
		SetMinValue(minValueNode->AsFloat());
		
	YamlNode * maxValueNode= node->Get("maxValue");
	
	if (maxValueNode)
		SetMaxValue(maxValueNode->AsFloat());
	
	// Min/Max draw type
	YamlNode * minDrawTypeNode = node->Get("minDrawType");

	if(minDrawTypeNode)
	{
		UIControlBackground::eDrawType type = (UIControlBackground::eDrawType)loader->GetDrawTypeFromNode(minDrawTypeNode);
		SetMinDrawType(type);
	}
	
	YamlNode * maxDrawTypeNode = node->Get("maxDrawType");

	if(maxDrawTypeNode)
	{
		UIControlBackground::eDrawType type = (UIControlBackground::eDrawType)loader->GetDrawTypeFromNode(maxDrawTypeNode);
		SetMaxDrawType(type);
	}		
}