コード例 #1
0
ファイル: cdrawcontext.cpp プロジェクト: UIKit0/vstgui
//-----------------------------------------------------------------------------
void CDrawContext::setFont (const CFontRef newFont, const CCoord& size, const int32_t& style)
{
	if (newFont == 0)
		return;
	if ((size > 0 && newFont->getSize () != size) || (style != -1 && newFont->getStyle () != style))
	{
		OwningPointer<CFontDesc> font = (CFontRef)newFont->newCopy ();
		currentState.font = font;
		if (size > 0)
			currentState.font->setSize (size);
		if (style != -1)
			currentState.font->setStyle (style);
	}
	else
	{
		currentState.font = newFont;
	}
}
コード例 #2
0
ファイル: ctabview.cpp プロジェクト: EQ4/vstgui
//-----------------------------------------------------------------------------
void CTabView::setTabFontStyle (const CFontRef font, CCoord fontSize, CColor selectedColor, CColor deselectedColor)
{
	CFontRef tabFont = (CFontRef)font->newCopy ();
	tabFont->setSize (fontSize);
	CTabChildView* v = firstChild;
	while (v)
	{
		CTabButton* button = dynamic_cast<CTabButton*>(v->button);
		if (button)
		{
			button->setTextFont (tabFont);
			button->setActiveTextColor (selectedColor);
			button->setInactiveTextColor (deselectedColor);
		}
		v = v->next;
	}
	tabFont->forget ();
}
コード例 #3
0
ファイル: cdrawcontext.cpp プロジェクト: sa-tsuklog/MyLib
//-----------------------------------------------------------------------------
void CDrawContext::setFont (const CFontRef newFont, const CCoord& size, const int32_t& style)
{
	if (newFont == 0)
		return;
	if (currentState.font)
		currentState.font->forget ();
	if ((size > 0 && newFont->getSize () != size) || (style != -1 && newFont->getStyle () != style))
	{
		currentState.font = (CFontRef)newFont->newCopy ();
		if (size > 0)
			currentState.font->setSize (size);
		if (style != -1)
			currentState.font->setStyle (style);
	}
	else
	{
		currentState.font = newFont;
		currentState.font->remember ();
	}
}