本文整理汇总了C++中CBCGPDrawManager::DrawFocusRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPDrawManager::DrawFocusRect方法的具体用法?C++ CBCGPDrawManager::DrawFocusRect怎么用?C++ CBCGPDrawManager::DrawFocusRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPDrawManager
的用法示例。
在下文中一共展示了CBCGPDrawManager::DrawFocusRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDraw
//.........这里部分代码省略.........
CRect rectThumb;
GetThumbRect (rectThumb);
int nTicSize = max(3, (bVert ? rectThumb.Height() : rectThumb.Width()) / 3);
int nTicOffset = 2;
int nNumTics = GetNumTics();
for (int i = 0; i < nNumTics; i++)
{
int nTicPos = GetTicPos(i);
if (nTicPos < 0)
{
if (i == nNumTics - 2)
{
if (bVert)
{
nTicPos = rectChannel.top + rectThumb.Height() / 2;
}
else
{
nTicPos = rectChannel.left + rectThumb.Width() / 2;
}
}
else if (i == nNumTics - 1)
{
if (bVert)
{
nTicPos = rectChannel.bottom - rectThumb.Height() / 2 - 1;
}
else
{
nTicPos = rectChannel.right - rectThumb.Width() / 2 - 1;
}
}
}
if (nTicPos >= 0)
{
CRect rectTic1(0, 0, 0, 0);
CRect rectTic2(0, 0, 0, 0);
if (bVert)
{
if (bLeftTop)
{
rectTic1 = CRect(rectThumb.left - nTicOffset - nTicSize, nTicPos, rectThumb.left - nTicOffset, nTicPos + 1);
}
if (bRightBottom)
{
rectTic2 = CRect(rectThumb.right + nTicOffset, nTicPos, rectThumb.right + nTicOffset + nTicSize, nTicPos + 1);
}
}
else
{
if (bLeftTop)
{
rectTic1 = CRect(nTicPos, rectThumb.top - nTicOffset - nTicSize, nTicPos + 1, rectThumb.top - nTicOffset);
}
if (bRightBottom)
{
rectTic2 = CRect(nTicPos, rectThumb.bottom + nTicOffset, nTicPos + 1, rectThumb.bottom + nTicOffset + nTicSize);
}
}
if (!rectTic1.IsRectEmpty())
{
CBCGPVisualManager::GetInstance ()->OnDrawSliderTic(pDC, this, rectTic1, bVert, TRUE, m_bOnGlass);
}
if (!rectTic2.IsRectEmpty())
{
CBCGPVisualManager::GetInstance ()->OnDrawSliderTic(pDC, this, rectTic2, bVert, FALSE, m_bOnGlass);
}
}
}
CBCGPVisualManager::GetInstance ()->OnDrawSliderThumb (
pDC, this, rectThumb, m_bIsThumbHighligted || bIsFocused,
m_bIsThumPressed, !IsWindowEnabled (),
bVert, bLeftTop, bRightBottom, m_bOnGlass);
if (bIsFocused && m_bDrawFocus)
{
CRect rectFocus;
GetClientRect (rectFocus);
if (m_bOnGlass)
{
CBCGPDrawManager dm (*pDC);
dm.DrawFocusRect(rectFocus);
}
else
{
pDC->DrawFocusRect (rectFocus);
}
}
}