本文整理汇总了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();
}
示例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;
}
}