Example #1
0
void CBfDrawButton::DrawFocus()
{
	if (IsInFocus())
	{
		CRect WndRect(0, 0, 0, 0), OutRect(0, 0, 0, 0), InRect(0, 0, 0, 0);
		WndRect = m_WndRect;

		OutRect = WndRect;
		OutRect.left++;
		OutRect.top++;
		OutRect.right -= 2;
		OutRect.bottom -= 2;
		Pen Pn1(Color(150, 68, 198, 247));
		RectF GRt = CUiMethod::CRect2RectF(OutRect);
		m_pDoGrap->DrawRectangle(&Pn1, GRt);

		InRect = OutRect;
		InRect.left++;
		InRect.top++;
		InRect.right--;
		InRect.bottom--;
		Pen Pn2(Color(100, 133, 188, 203));
		GRt = CUiMethod::CRect2RectF(InRect);
		m_pDoGrap->DrawRectangle(&Pn2, GRt);
	}
}
Example #2
0
	void MenuItem::Draw(LPDIRECT3DDEVICE9 deviceInterface, int menuItemIndex)
	{
		Drawing::DrawRectangle(deviceInterface, Config::GetNumber("menu_x"), Config::GetNumber("menu_y") + TITLE_BOX_HEIGHT + MENU_MARGIN + (ITEM_HEIGHT + MENU_MARGIN) * menuItemIndex, Config::GetNumber("menu_width"), ITEM_HEIGHT, IsInFocus() ? color1 : color2);
		Drawing::DrawText(fontMenuItem, name.c_str(), Config::GetNumber("menu_x") + 4, Config::GetNumber("menu_y") + TITLE_BOX_HEIGHT + 6 + (ITEM_HEIGHT + MENU_MARGIN) * menuItemIndex, Config::GetNumber("menu_width") - MENU_MARGIN, ITEM_HEIGHT - MENU_MARGIN, IsInFocus() ? color2 : color1);

		if(OnDraw != NULL)
		{
			OnDraw(this, deviceInterface, menuItemIndex);
		}
	}