本文整理汇总了C++中CBCGPGridRow::GetSpinWnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPGridRow::GetSpinWnd方法的具体用法?C++ CBCGPGridRow::GetSpinWnd怎么用?C++ CBCGPGridRow::GetSpinWnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPGridRow
的用法示例。
在下文中一共展示了CBCGPGridRow::GetSpinWnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnVScroll
//******************************************************************************************
void CCxNDArrayDimGrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (m_nDraggedColumn >= 0 || m_bTracking || m_bSelecting)
{
return;
}
CBCGPGridRow* pSel = GetCurSel ();
// if (pSel && pSel->IsInPlaceEditing())
// {
// return;
// }
if (pSel != NULL &&
pScrollBar->GetSafeHwnd () != NULL)
{
CSpinButtonCtrl* pWndSpin = pSel->GetSpinWnd ();
if (pWndSpin != NULL &&
pWndSpin->GetSafeHwnd () == pScrollBar->GetSafeHwnd ())
{
return;
}
}
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;
}
}
}
//.........这里部分代码省略.........