本文整理汇总了C++中BaseModHybridButton::DoClick方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseModHybridButton::DoClick方法的具体用法?C++ BaseModHybridButton::DoClick怎么用?C++ BaseModHybridButton::DoClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModHybridButton
的用法示例。
在下文中一共展示了BaseModHybridButton::DoClick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMousePressed
void GameModes::OnMousePressed( vgui::MouseCode code )
{
BaseClass::OnMousePressed( code );
if ( code != MOUSE_LEFT )
return;
if ( IsScrollBusy() )
return;
int iPosX;
int iPosY;
input()->GetCursorPos( iPosX, iPosY );
ScreenToLocal( iPosX, iPosY );
if ( m_nSubPics )
{
bool bRightScroll = false;
bool bLeftScroll = false;
int nSubPic = 0;
if ( ( iPosX >= m_nPicOffsetX && iPosX <= m_nPicOffsetX + m_nPicWidth ) &&
( iPosY >= 0 && iPosY <= m_nPicHeight ) )
{
BaseModHybridButton *pHybridButton = GetHybridButton( m_nActive );
if ( pHybridButton && pHybridButton->GetCurrentState() != BaseModHybridButton::Open )
{
// open it
if ( pHybridButton->IsEnabled() )
{
pHybridButton->DoClick();
}
}
}
else if ( ( iPosX >= m_nLeftArrowX && iPosX <= m_nLeftArrowX + m_nArrowWidth ) &&
( iPosY >= m_nLeftArrowY && iPosY <= m_nLeftArrowY + m_nArrowHeight ) )
{
bLeftScroll = true;
}
else if ( ( iPosX >= m_nRightArrowX && iPosX <= m_nRightArrowX + m_nArrowWidth ) &&
( iPosY >= m_nRightArrowY && iPosY <= m_nRightArrowY + m_nArrowHeight ) )
{
bRightScroll = true;
}
else
{
// determine if sub pic selected
if ( iPosY >= m_nSubPicY && iPosY <= m_nSubPicY + m_nSubPicHeight )
{
int x = m_nSubPicX;
for ( int i = 1; i <= m_nSubPics; i++ )
{
if ( iPosX >= x && iPosX <= x + m_nSubPicWidth )
{
nSubPic = i;
break;
}
x += m_nSubPicWidth + m_nSubPicGap;
}
}
}
if ( bLeftScroll || bRightScroll || nSubPic )
{
// close any active flyout
if ( FlyoutMenu::GetActiveMenu() )
{
FlyoutMenu::CloseActiveMenu( this );
}
if ( bLeftScroll )
{
ScrollLeft();
}
else if ( bRightScroll )
{
ScrollRight();
}
else if ( nSubPic )
{
ScrollRight( nSubPic );
}
}
}
}