Esempio n. 1
0
void CG_DrawDemoControls(int x, int y, int w, vec4_t borderColor, vec4_t bgColor, int tSpacing, vec4_t bgColorTitle, vec4_t borderColorTitle, float hScale, float hScaleY, vec4_t hdrColor, int hStyle, fontHelper_t *hFont)
{
	static panel_button_text_t demoControlTxt;
	int                        i;

	demoControlTxt.scalex = hScale;
	demoControlTxt.scaley = hScaleY;
	Vector4Copy(hdrColor, demoControlTxt.colour);
	demoControlTxt.style = ITEM_ALIGN_CENTER;
	demoControlTxt.align = 0;
	demoControlTxt.font  = hFont;

	CG_FillRect(x, y, w, 50, bgColor);
	CG_DrawRect(x, y, w, 50, 1, borderColor);

	y += 1;

	// Header
	CG_FillRect(x + 1, y, w - 2, tSpacing + 4, bgColorTitle);
	CG_DrawRect(x + 1, y, w - 2, tSpacing + 4, 1, borderColorTitle);
	CG_Text_Paint_Ext(x + 4, y + tSpacing, hScale, hScaleY, hdrColor, CG_TranslateString("DEMO STATUS"), 0.0f, 0, hStyle, hFont);

	for (i = 0; i < 4; i++)
	{
		if (i)
		{
			RectangleSet(demoControlButtons[i]->rect, (x + (i * (w / 4)) - 15), y + 30, 30, 15);
		}
		else
		{
			RectangleSet(demoControlButtons[i]->rect, x + 2, y + 15, w - 4, 12);
		}

		demoControlButtons[i]->font = &demoControlTxt;
	}
	BG_PanelButtonsRender(demoControlButtons);

	if (cg.time < cgs.cursorUpdate)
	{
		// render cursor
		trap_R_SetColor(NULL);
		CG_DrawPic(cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon);
	}
}
Esempio n. 2
0
void DrawTable(const struct CGUIConstItem *Table)
{
	assert(Table);
	assert(Table->Kind==IDK_TABLE);

	TableCtrlSpec=((struct CTableCtrl *)(Table->Specific));

	tLeft   = Table->Left;
	tTop    = Table->Top;
	tWidth  = Table->Width;
	tHeight = Table->Height;

	ClearBox(tLeft,tTop,tWidth,tHeight);
	RectangleSet(tLeft,tTop,tWidth,tHeight);
	hLine(tLeft+1,tTop+tHeight-2,tWidth-2);
	vLine(tLeft+tWidth-2,tTop+1,tHeight-3);


	Cols = TableCtrlSpec->ColCount;
	Rows = TableCtrlSpec->RowCount;

	Cell = Table->Contained;
	AddToDequeTail((void *)Cell,&DrawQueue);
	// Заголовок таблиці
	vLine(Cell->Width+Cell->Left-4,tTop+1,tHeight-3);

	for (i=1;i<Cols;i++)
	{
		++Cell;
		vLine(Cell->Left-2,tTop+1,tHeight-3);
	}

	++Cell;
	hLine(tLeft+1,Cell->Top-3,tWidth-3);

	// друк по рядках
	for (j=1;j<Rows;j++)
	{
		hLine(tLeft+1,Cell->Top-2,tWidth-3);
		Cell+=Cols;
/*		for (i=1;i<Cols;i++)
		{
			++Cell;
			if (Cell->Additional->IsEnabled)
				DrawLimitedString(Cell->Left+4,Cell->Top+2,Cell->Width-4,Cell->Height-2,
					((struct CEditBoxItem *)(Cell->Specific))->Text,guiNormalFont);
			else
				DrawLimitedString(Cell->Left+4,Cell->Top+2,Cell->Width-4,Cell->Height-2,
					((struct CEditBoxItem *)(Cell->Specific))->Text,guiDisabledFont);

		}
		++Cell;*/
	}
}