本文整理汇总了C++中Rect::IsPosInRect方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::IsPosInRect方法的具体用法?C++ Rect::IsPosInRect怎么用?C++ Rect::IsPosInRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::IsPosInRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Transition
void VSliderControl::Transition(ControlTransitionEnum eTrans,
Pos *pPos)
{
Rect oRect;
if (m_eCurrentState == CS_Dragging && eTrans == CT_SetValue)
return;
switch(eTrans)
{
case CT_MouseEnter:
m_pParent->SendControlMessage(this, CM_MouseEnter);
break;
case CT_MouseLeave:
m_pParent->SendControlMessage(this, CM_MouseLeave);
break;
case CT_SetValue:
{
int iNewPos;
if (m_iValue < 0 || m_iValue > 100)
return;
m_oMutex.Acquire();
if (m_bInUpdate)
{
m_oMutex.Release();
return;
}
m_bInUpdate = true;
iNewPos = ((100 - m_iValue) * m_iRange) / 100;
if (iNewPos == m_iCurrentPos)
{
m_bInUpdate = false;
m_oMutex.Release();
return;
}
m_iCurrentPos = iNewPos;
m_bInUpdate = false;
m_oMutex.Release();
if (!m_pPanel->IsHidden())
MoveThumb(iNewPos);
return;
}
default:
break;
}
if (m_pPanel->IsHidden())
return;
oRect.x1 = m_oRect.x1;
oRect.x2 = m_oRect.x2;
oRect.y1 = m_oRect.y1 + m_iCurrentPos;
oRect.y2 = oRect.y1 + m_iThumbHeight;
m_oMutex.Acquire();
if (m_eCurrentState != CS_Dragging &&
m_eLastState == CS_Dragging)
{
if (m_oOrigin.y != -1)
{
Rect oRect;
m_oMutex.Release();
m_pParent->GetWindowPosition(oRect);
m_oMutex.Acquire();
m_oOrigin.y = m_oRect.y1 + m_iCurrentPos + (m_iThumbHeight / 2);
m_oOrigin.y += oRect.y1;
m_oOrigin.x += oRect.x1;
m_oMutex.Release();
m_pParent->EndMouseCapture();
m_pParent->HideMouse(false);
m_oMutex.Acquire();
m_oOrigin.y = -1;
}
m_iValue = 100 - ((m_iCurrentPos * 100) / m_iRange);
m_oMutex.Release();
m_pParent->SendControlMessage(this, CM_ValueChanged);
m_oMutex.Acquire();
}
if (m_eCurrentState == CS_Dragging &&
m_eLastState != CS_Dragging)
m_bIsDrag = oRect.IsPosInRect(*pPos);
m_oMutex.Release();
int iThumbNumber = m_iNumThumbStates * (1 - m_iCurrentPos / m_iRange);
iThumbNumber = min(m_iNumThumbStates - 1, iThumbNumber);
//.........这里部分代码省略.........