本文整理汇总了C++中CDCHandle::IntersectClipRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CDCHandle::IntersectClipRect方法的具体用法?C++ CDCHandle::IntersectClipRect怎么用?C++ CDCHandle::IntersectClipRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDCHandle
的用法示例。
在下文中一共展示了CDCHandle::IntersectClipRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoPaint
void CTuotuoTabCtrl::DoPaint(CDCHandle dc, const RECT &rcClip) const
{
RECT rcClient;
GetClientRect(&rcClient);
dc.SetBkMode(TRANSPARENT);
s()->Toolbar()->DrawRebarBackPart(dc, rcClient, m_hWnd);
int iOffSetTop = rcClient.bottom - s()->Tab()->GetTabHeight();
if (iOffSetTop < 0)
iOffSetTop = 0;
rcClient.top += iOffSetTop;
// draw scroll button
if (m_bOverflowLeft || m_bOverflowRight || (m_bClosingTabs && m_iLastLayout == 2))
{
if (m_bOverflowLeft)
{
s()->Tab()->DrawTabScrollButton(dc, m_rcScrollLLeft, m_ePosition == POS_ScrollLLeftBtn ? m_eButtonStatus : Btn_MouseOut, 0);
}
else
{
s()->Tab()->DrawTabScrollButton(dc, m_rcScrollLLeft, Btn_Disabled, 0);
}
if (m_bOverflowRight)
s()->Tab()->DrawTabScrollButton(dc, m_rcScrollRRight, m_ePosition == POS_ScrollRRightBtn ? m_eButtonStatus : Btn_MouseOut, 1);
else
s()->Tab()->DrawTabScrollButton(dc, m_rcScrollRRight, Btn_Disabled, 1);
}
// draw sidebar button
// draw "new tab" button
//s()->Tab()->DrawNewTabButton(dc, m_rcNewTabBtn, m_ePosition == POS_NewTabBtn ? m_eButtonStatus : Btn_MouseOut);
// draw tabs
if (GetItemCountInDraggingMode() == 0)
return;
dc.IntersectClipRect(&m_rcTabItemAreaDraw);
dc.SetViewportOrg(m_iScrollOffsetAni + m_rcTabItemArea.left, 0);
// we draw the selected item at the last
dc.SelectFont(s()->Common()->GetDefaultFont());
ButtonStatus eTabCloseBtnStatus = m_ePosition == POS_TabItemClose ? m_eButtonStatus : Btn_MouseOut;
int iRightBorder = m_rcTabItemArea.right - m_rcTabItemArea.left - m_iScrollOffsetAni;
size_t nScrollLeft = - m_iScrollOffsetAni / m_iCurrentWidth;
size_t nScrollRight = iRightBorder / m_iCurrentWidth + (iRightBorder % m_iCurrentWidth == 0 ? 0 : 1);
size_t nPaintRight = min(nScrollRight, m_TabItems.size() - 1);
if (m_nDragToPos == -2)
{
for (size_t i = nScrollLeft == 0 ? 0 : nScrollLeft - 1; i <= nPaintRight; i++)
if (m_TabItems[i] != m_pSelectedItem)
m_TabItems[i]->DoPaint(dc, m_TabItems[i] == m_pHotItem ? Btn_MouseOver : Btn_MouseOut, m_TabItems[i] == m_pHotItem ? m_ePosition : POS_TabItem, m_eButtonStatus, m_eTabCloseButton == CloseBtn_AlwaysDisplay, iOffSetTop, false);
dc.SelectFont(s()->Common()->GetBoldFont());
if (m_pSelectedItem && TAB_MATCH_INTERVAL(nScrollLeft, m_pSelectedItem->GetIndex(), nScrollRight))
m_pSelectedItem->DoPaint(dc, Btn_MouseDown, m_pSelectedItem == m_pHotItem ? m_ePosition : POS_TabItem, m_eButtonStatus, m_eTabCloseButton != CloseBtn_AlwaysHide, iOffSetTop, false);
dc.SelectClipRgn(NULL);
dc.SetViewportOrg(0, 0);
}
else // 拖动状态
{
if (m_bDraggingSource) // 正常状态显示 || 在自己的框架里面拖动
{
for (size_t i = nScrollLeft; i <= nPaintRight; i++)
if (m_TabItems[i] != m_pSelectedItem)
m_TabItems[i]->DoPaint(dc, Btn_MouseOut, POS_TabItem, Btn_MouseOut, m_eTabCloseButton != CloseBtn_AlwaysHide, iOffSetTop, false);
dc.SelectClipRgn(NULL);
dc.SetViewportOrg(0, 0);
dc.SelectFont(s()->Common()->GetBoldFont());
if (m_pDraggingItem)
m_pSelectedItem->DoPaint(dc, Btn_MouseDown, POS_TabItem, Btn_MouseOut, m_eTabCloseButton != CloseBtn_AlwaysHide, iOffSetTop, false);
}
else // 拖到别人的框架里面了
{
for (size_t i = nScrollLeft; i <= nPaintRight; i++)
m_TabItems[i]->DoPaint(dc, Btn_MouseOut, POS_TabItem, Btn_MouseOut, m_eTabCloseButton == CloseBtn_AlwaysDisplay, iOffSetTop, false);
dc.SelectClipRgn(NULL);
dc.SetViewportOrg(0, 0);
dc.SelectFont(s()->Common()->GetBoldFont());
if (m_pDraggingItem)
m_pDraggingItem->DoPaint(dc, Btn_MouseDown, POS_TabItem, Btn_MouseOut, m_eTabCloseButton != CloseBtn_AlwaysHide, iOffSetTop, false);
}
}
}