本文整理汇总了C++中CCoolBarItem::Paint方法的典型用法代码示例。如果您正苦于以下问题:C++ CCoolBarItem::Paint方法的具体用法?C++ CCoolBarItem::Paint怎么用?C++ CCoolBarItem::Paint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCoolBarItem
的用法示例。
在下文中一共展示了CCoolBarItem::Paint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoPaint
void CCoolBarCtrl::DoPaint(CDC* pDC, CRect& rcClient, BOOL bTransparent)
{
CRect rcItem( rcClient.left + MARGIN_WIDTH, rcClient.top + 1, rcClient.right - MARGIN_WIDTH, rcClient.bottom - 1 );
CRect rcCopy;
if ( m_bGripper )
{
if ( bTransparent )
{
for ( int nY = rcClient.top + 4 ; nY < rcClient.bottom - 4 ; nY += 2 )
{
pDC->Draw3dRect( rcClient.left + 3, nY, GRIPPER_WIDTH, 1,
CoolInterface.m_crDisabled, CoolInterface.m_crDisabled );
}
}
else
{
for ( int nY = rcClient.top + 4 ; nY < rcClient.bottom - 4 ; nY += 2 )
{
pDC->Draw3dRect( rcClient.left + 3, nY, GRIPPER_WIDTH, 2,
CoolInterface.m_crDisabled, CoolInterface.m_crMidtone );
}
pDC->ExcludeClipRect( rcClient.left + 3, rcClient.top + 4, rcClient.left + GRIPPER_WIDTH + 2, rcClient.bottom - 4 );
}
rcItem.left += GRIPPER_WIDTH;
}
if ( m_pItems.GetCount() == 0 ) return;
CFont* pOldFont = (CFont*)pDC->SelectObject( m_bBold ? &CoolInterface.m_fntBold : &CoolInterface.m_fntNormal );
BOOL bRight = FALSE;
for ( POSITION pos = m_pItems.GetHeadPosition() ; pos ; )
{
CCoolBarItem* pItem = (CCoolBarItem*)m_pItems.GetNext( pos );
if ( pItem->m_nID == ID_RIGHTALIGN && ! bRight )
{
int nRight = 0;
bRight = TRUE;
for ( POSITION pos2 = pos ; pos2 ; )
{
CCoolBarItem* pRight = (CCoolBarItem*)m_pItems.GetNext( pos2 );
if ( pRight->m_bVisible ) nRight += pRight->m_nWidth;
}
if ( rcClient.right - rcItem.left >= nRight + MARGIN_WIDTH )
{
rcItem.left = rcClient.right - nRight - MARGIN_WIDTH;
}
}
else if ( pItem->m_bVisible )
{
rcItem.right = rcItem.left + pItem->m_nWidth;
rcCopy.CopyRect( &rcItem );
CWnd* pCtrl = ( pItem->m_nCtrlID ) ? GetDlgItem( pItem->m_nCtrlID ) : NULL;
pItem->Paint( pDC, rcCopy, m_pDown == pItem,
m_pHot == pItem || ( pCtrl && pCtrl == GetFocus() ),
m_bMenuGray, bTransparent );
if ( ! bTransparent ) pDC->ExcludeClipRect( &rcItem );
if ( pCtrl ) SmartMove( pCtrl, &rcCopy );
rcItem.OffsetRect( rcItem.Width(), 0 );
}
else if ( pItem->m_nCtrlID )
{
CWnd* pCtrl = GetDlgItem( pItem->m_nCtrlID );
if ( pCtrl && pCtrl->IsWindowVisible() ) pCtrl->ShowWindow( SW_HIDE );
}
}
pDC->SelectObject( pOldFont );
}