本文整理汇总了C++中CMouse::GetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ CMouse::GetPos方法的具体用法?C++ CMouse::GetPos怎么用?C++ CMouse::GetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMouse
的用法示例。
在下文中一共展示了CMouse::GetPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
//--------------------------------------------------------------------------------------
void CProgressBarVertical::Draw ( void )
{
if ( !m_bVisible )
return;
CMouse *pMouse = m_pDialog->GetMouse ();
if ( pMouse &&
m_bPressed &&
m_rBoundingBox.ContainsPoint ( pMouse->GetPos () ) &&
!m_timer.Running() )
{
if ( pMouse->GetPos ().m_nY > m_rProgress.m_pos.m_nY + m_rProgress.m_size.cx )
{
m_timer.Start ( PROGRESSBAR_ARROWCLICK_START );
SetValue ( m_fValue + m_fStep );
}
else if ( pMouse->GetPos ().m_nY < m_rProgress.m_pos.m_nY + m_rProgress.m_size.cx )
{
m_timer.Start ( PROGRESSBAR_ARROWCLICK_START );
SetValue ( m_fValue - m_fStep );
}
}
m_pDialog->DrawBox ( m_rBoundingBox, m_sControlColor.d3dColorBoxBack, m_sControlColor.d3dColorOutline, m_bAntAlias );
m_pDialog->DrawBox ( m_rProgress, m_sControlColor.d3dColorBoxSel, m_sControlColor.d3dColorOutline, m_bAntAlias );
}
示例2: Draw
//--------------------------------------------------------------------------------------
void CProgressBarHorizontal::Draw ( void )
{
if ( !m_bVisible )
return;
CMouse *pMouse = m_pDialog->GetMouse ();
assert ( pMouse && "Invalid mouse pointer" );
if ( pMouse &&
m_bPressed &&
m_rBoundingBox.InControlArea ( pMouse->GetPos () ) &&
!m_timer.Running() )
{
if ( pMouse->GetPos ().GetX () > m_rProgress.pos.GetX () + m_rProgress.size.cx )
{
m_timer.Start ( PROGRESSBAR_ARROWCLICK_REPEAT );
SetValue ( m_fValue + m_fStep );
}
else if ( pMouse->GetPos ().GetX () < m_rProgress.pos.GetX () + m_rProgress.size.cx )
{
m_timer.Start ( PROGRESSBAR_ARROWCLICK_REPEAT );
SetValue ( m_fValue - m_fStep );
}
}
m_pDialog->DrawBox ( m_rBoundingBox, m_sControlColor.d3dColorBoxBack, m_sControlColor.d3dColorOutline, m_bAntAlias );
m_pDialog->DrawBox ( m_rProgress, m_sControlColor.d3dColorBoxSel, m_sControlColor.d3dColorOutline, m_bAntAlias );
}