本文整理汇总了C++中CBCGPGridRow::AdjustButtonRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPGridRow::AdjustButtonRect方法的具体用法?C++ CBCGPGridRow::AdjustButtonRect怎么用?C++ CBCGPGridRow::AdjustButtonRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPGridRow
的用法示例。
在下文中一共展示了CBCGPGridRow::AdjustButtonRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnVScroll
//.........这里部分代码省略.........
SetEndEditReason (EndEdit_Cancel | EndEdit_Layout);
EndEditItem (TRUE);
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
info.fMask = SIF_TRACKPOS;
if (nSBCode == SB_THUMBTRACK || nSBCode == SB_THUMBPOSITION)
{
GetScrollInfo(SB_VERT, &info);
nPos = info.nTrackPos;
}
int nPrevOffset = m_nVertScrollOffset;
int nVertScrollPage = m_nVertScrollPage;
if (m_bVirtualMode)
{
int nItemsCount = max (1, m_nVertScrollPage / m_nRowHeight);
nVertScrollPage = nItemsCount * m_nRowHeight;
}
switch (nSBCode)
{
case SB_LINEUP:
m_nVertScrollOffset -= m_nRowHeight;
break;
case SB_LINEDOWN:
m_nVertScrollOffset += m_nRowHeight;
break;
case SB_TOP:
m_nVertScrollOffset = 0;
break;
case SB_BOTTOM:
m_nVertScrollOffset = m_nVertScrollTotal;
break;
case SB_PAGEUP:
m_nVertScrollOffset -= nVertScrollPage;
break;
case SB_PAGEDOWN:
m_nVertScrollOffset += nVertScrollPage;
break;
case SB_THUMBPOSITION:
case SB_THUMBTRACK:
m_nVertScrollOffset = nPos;
break;
default:
return;
}
m_nVertScrollOffset = max (0, min (m_nVertScrollOffset,
m_nVertScrollTotal - nVertScrollPage + 1));
if (m_bVirtualMode)
{
// row alignment
int nResidue = m_nVertScrollOffset % m_nRowHeight;
if (nResidue > 0)
{
m_nVertScrollOffset -= nResidue;
if (m_nVertScrollOffset + m_nVertScrollPage < m_nVertScrollTotal)
{
m_nVertScrollOffset += m_nRowHeight;
}
}
}
if (m_nVertScrollOffset == nPrevOffset)
{
return;
}
OnUpdateVScrollPos (m_nVertScrollOffset, nPrevOffset);
SetScrollPos (SB_VERT, m_nVertScrollOffset);
int dy = nPrevOffset - m_nVertScrollOffset;
ShiftItems (0, dy);
OnPosSizeChanged ();
m_rectTrackSel = OnGetSelectionRect ();
ScrollWindow (0, dy, m_rectList, m_rectList);
ScrollWindow (0, dy, m_rectRowHeader, m_rectRowHeader);
pSel = GetCurSel ();
if (pSel != NULL)
{
pSel->AdjustButtonRect ();
}
OnAfterVScroll (m_nVertScrollOffset, nPrevOffset);
UpdateWindow ();
}