本文整理汇总了C++中Border::width方法的典型用法代码示例。如果您正苦于以下问题:C++ Border::width方法的具体用法?C++ Border::width怎么用?C++ Border::width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Border
的用法示例。
在下文中一共展示了Border::width方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFrameThickness
void BoxSkin::setFrameThickness( Border frame )
{
bool hadFrame = (m_frame.width() + m_frame.height() > 0 );
bool hasFrame = (frame.width() + frame.height() > 0);
m_frame = frame;
if( hadFrame != hasFrame )
_updateOpaqueFlag();
}
示例2:
BoxSkin::BoxSkin( Color color, Border frame, Color frameColor )
{
m_frame = frame;
for( int i = 0 ; i < StateEnum_Nb ; i++ )
{
m_color[i] = color;
m_frameColor[i] = frameColor;
}
bool hasFrame = (frame.width() + frame.height() > 0 );
if( color.a == 255 && (!hasFrame || frameColor.a == 255) )
m_bOpaque = true;
else
m_bOpaque = false;
}
示例3: _render
void Menubar::_render( GfxDevice * pDevice, const Rect& _canvas, const Rect& _window, const Rect& _clip )
{
Widget::_render(pDevice,_canvas,_window,_clip);
// Take backgrounds content borders into account
Rect window;
Rect clip;
if( m_pSkin )
{
window = m_pSkin->contentRect( _canvas, m_state );
clip.intersection( window, _clip );
}
else
{
window = _canvas;
clip = _clip;
}
// Go throught the MenuBarItems and print their text and render their rectangles.
MenuBarItem * pI = m_items.first();
uint32_t posX = window.x;
Pen pen;
TextAttr attr;
TextTool::addPropAttributes( attr, Base::getDefaultTextprop(), StateEnum::Normal);
TextTool::addPropAttributes( attr, m_pTextProp, StateEnum::Normal);
pen.setAttributes( attr );
pen.setClipRect( clip );
pen.setDevice( pDevice );
uint32_t printPosY = window.y + ( window.h - pen.getLineHeight() )/2 + pen.getBaseline();
uint32_t itemNb = 1;
while( pI )
{
if( pI->isVisible() )
{
State state = StateEnum::Disabled;
if( m_state.isEnabled() && pI->m_bEnabled )
{
state = StateEnum::Normal;
if( itemNb == m_selectedItem )
state = StateEnum::Pressed;
else if( itemNb == m_markedItem )
state = StateEnum::Hovered;
}
Border b = _getEntryBorder();
// ColorsetPtr pTextColors;
// if( m_pSkin )
// pTextColors = m_pSkin->TextColors();
if( m_pEntrySkin )
{
Rect dest( posX, window.y, pI->m_width + b.width(), window.h );
m_pEntrySkin->render( pDevice, dest, state, clip );
// pTextColors = m_pEntrySkin->TextColors();
}
pen.setPos( Coord(posX + b.left, printPosY) );
TextAttr attr;
TextTool::addPropAttributes( attr, Base::getDefaultTextprop(), state );
// TextTool::setAttrColor( attr, pTextColors, mode );
TextTool::addPropAttributes( attr, m_pTextProp, state );
pen.setAttributes( attr );
pDevice->printLine( pen, attr, pI->m_pText );
posX += pI->m_width + b.width();
}
itemNb++;
pI = pI->next();
}
}