当前位置: 首页>>代码示例>>C++>>正文


C++ Layer::GetFontHeight方法代码示例

本文整理汇总了C++中Layer::GetFontHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Layer::GetFontHeight方法的具体用法?C++ Layer::GetFontHeight怎么用?C++ Layer::GetFontHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Layer的用法示例。


在下文中一共展示了Layer::GetFontHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FontChanged

void BlueDecorator::FontChanged()
{
    Layer* pcView = GetLayer();
    m_sFontHeight = pcView->GetFontHeight();
    CalculateBorderSizes();
    pcView->Invalidate();
    Layout();
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:8,代码来源:BlueDecorator.cpp

示例2: DrawButton

void DefaultDecorator::DrawButton( uint32 nButton, const Color32_s & sFillColor )
{
	Layer *pcView = GetLayer();

	nButton = CheckIndex( nButton );
	Rect cFrame = m_cObjectFrame[nButton];
	bool bState = m_bObjectState[nButton];
	font_height fh;

	fh = pcView->GetFontHeight();
	Rect r;
	Point cScale( cFrame.Size() );

	if( cFrame.Width() < 1 )
		return;

	pcView->FillRect( cFrame, sFillColor );
	pcView->DrawFrame( cFrame, FRAME_TRANSPARENT | ( bState ? FRAME_RECESSED : FRAME_RAISED ) );

	switch ( nButton )
	{
	case WindowDecorator::HIT_DRAG:
		pcView->SetFgColor( 255, 255, 255, 0 );
		pcView->SetBgColor( sFillColor );
		pcView->MovePenTo( cFrame.left + 5, ( cFrame.Height() + 1.0f ) / 2 - ( fh.ascender + fh.descender ) / 2 + fh.ascender );
		pcView->DrawString( m_cTitle.c_str(), -1 );
		break;
	case WindowDecorator::HIT_CLOSE:
		SetRect( 0.33, 0.33, 0.67, 0.67 );
		pcView->DrawFrame( r, FRAME_TRANSPARENT | ( bState ? FRAME_RAISED : FRAME_RECESSED ) );
		break;
	case WindowDecorator::HIT_MINIMIZE:
		SetRect( 0.2, 0.2, 0.8, 0.8 );
		pcView->DrawFrame( r, FRAME_TRANSPARENT | ( bState ? FRAME_RAISED : FRAME_RECESSED ) );
		SetRect( 0.2, 0.6, 0.4, 0.8 );
		r.left++;
		r.right += 2;
		r.top--;
		r.bottom -= 2;
		pcView->DrawFrame( r, FRAME_TRANSPARENT | ( bState ? FRAME_RECESSED : FRAME_RAISED ) );
		break;
	case WindowDecorator::HIT_DEPTH:
		if( bState )
		{
			SetRect( 0.2, 0.2, 0.6, 0.6 );
			pcView->DrawFrame( r, FRAME_TRANSPARENT | ( FRAME_RAISED ) );
			SetRect( 0.4, 0.4, 0.8, 0.8 );
			pcView->FillRect( r, sFillColor );
			pcView->DrawFrame( r, FRAME_TRANSPARENT | ( FRAME_RAISED ) );
		}
		else
		{
			SetRect( 0.4, 0.4, 0.8, 0.8 );
			pcView->DrawFrame( r, FRAME_TRANSPARENT | ( FRAME_RECESSED ) );
			SetRect( 0.2, 0.2, 0.6, 0.6 );
			pcView->FillRect( r, sFillColor );
			pcView->DrawFrame( r, FRAME_TRANSPARENT | ( FRAME_RECESSED ) );
		}
		break;
	case WindowDecorator::HIT_ZOOM:
		SetRect( 0.2, 0.2, 0.8, 0.8 );
		pcView->DrawFrame( r, FRAME_TRANSPARENT | ( bState ? FRAME_RAISED : FRAME_RECESSED ) );
		SetRect( 0.2, 0.2, 0.6, 0.6 );
		r.left += 2;
		r.top += 2;
		pcView->DrawFrame( r, FRAME_TRANSPARENT | ( bState ? FRAME_RECESSED : FRAME_RAISED ) );
		break;
	}
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:69,代码来源:defaultdecorator.cpp


注:本文中的Layer::GetFontHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。