예제 #1
0
CGUIButton::CGUIButton(CGUIDialog * parent, float x, float y, float w, float h, CImage2D * img)
:CGUIControl(parent, x, y, w, h)
{
	m_img = img;
	if (m_img)
	{
		float cliph = m_img->TextureHeight / 3.0f;
		m_rtNormal = MakeBounds(0, 0, m_img->TextureWidth, (int)(cliph + 0.5f));
		m_rtFocus  = MakeBounds(0, (int)(cliph + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f));
		m_rtPush   = MakeBounds(0, (int)(cliph * 2 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f));
	}
	m_fadeSpeed = 5;
	m_counter = 0;
	m_bPushed = false;
    m_bClicked = false;
}
예제 #2
0
static void BuildStack()
{
// Get log data

	vector<CLog>	vL;
	int				nL = ReadLogs( vL, gArgs.zmin, gArgs.zmax );

	if( gArgs.table )
		Tabulate( vL, nL );

	if( !nL )
		return;

// Make layer TForms

	vector<TAffine>	vT( nL );

	MakeTAffines( vT, vL );

// Calculate bounds

	DBox	B;

	MakeBounds( B, vL, vT );

// Write

	WriteTrakEM2( "LowRes.xml", B, vL, vT );
}
예제 #3
0
CGUICheckBox::CGUICheckBox(CGUIDialog * parent, float x, float y, float w, float h, CImage2D * img)
:CGUIControl(parent, x, y, w, h)
{
    m_img = img;
    if (m_img)
    {
        float cliph = m_img->TextureHeight / 4.0f;
        m_rtUncheck = MakeBounds(0, 0, m_img->TextureWidth, (int)(cliph + 0.5f));
        m_rtCheck = MakeBounds(0, (int)(cliph + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f));
        m_rtFocusUncheck = MakeBounds(0, (int)(cliph * 2 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f));
        m_rtFocusCheck = MakeBounds(0, (int)(cliph * 3 + 0.5f), m_img->TextureWidth, (int) (cliph + 0.5f));
    }
    m_fadeSpeed = 15;
    m_counter = 0;
    m_bChecked = false;
    m_bChanged = false;
}
예제 #4
0
void CGUIList::Draw(CGame2D* g2d)
{
	if (m_imgBk)
	{
		SetEffect(fxBlend);
		g2d->DrawImageScale(m_imgBk, X + Parent->GetX(), Y + Parent->GetY(), Width, Height);
	}

	for (int i = m_topline; i < (int)Items.size() && i < m_topline + m_lines; i++)
	{
		RECT rt = MakeBounds((int)(X + Parent->GetX() + m_offsetX + 10), 
							(int)(Y + Parent->GetY() + m_offsetY + m_itemHeight * (i - m_topline)),
							 (int)(Width + 0.5f - m_offsetX * 2), (int)(m_itemHeight + 0.5f));
		if (m_index != i)
		{
			g2d->DrawString(m_font, Items[i].c_str(), &rt, m_textColor, DT_VCENTER);
		}else
		{
			g2d->DrawImageScale(m_imgSel, (float)rt.left - 10, (float)rt.top, Width - m_offsetX * 2, m_itemHeight);
			g2d->DrawString(m_font, Items[i].c_str(), &rt, m_selColor, DT_VCENTER);
		}
		
	}
}
예제 #5
0
void CGUIControl::Draw(CGame2D* g2d)
{
	RECT rt = MakeBounds((int)(X + Parent->GetX()), (int)(Y + Parent->GetY()), (int) Width, (int) Height);
	g2d->DrawRect(&rt, 0xFFFFFFFF);
}