本文整理汇总了C++中EvtMouse::getAction方法的典型用法代码示例。如果您正苦于以下问题:C++ EvtMouse::getAction方法的具体用法?C++ EvtMouse::getAction怎么用?C++ EvtMouse::getAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvtMouse
的用法示例。
在下文中一共展示了EvtMouse::getAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processEvent
void VoutWindow::processEvent( EvtMouse &rEvtMouse )
{
int button = -1;
if( rEvtMouse.getButton() == EvtMouse::kLeft )
button = 0;
else if( rEvtMouse.getButton() == EvtMouse::kMiddle )
button = 1;
else if( rEvtMouse.getButton() == EvtMouse::kRight )
button = 2;
if( rEvtMouse.getAction() == EvtMouse::kDown )
vout_window_ReportMousePressed( m_pWnd, button );
else if( rEvtMouse.getAction() == EvtMouse::kUp )
vout_window_ReportMouseReleased( m_pWnd, button );
else if( rEvtMouse.getAction() == EvtMouse::kDblClick )
vout_window_ReportMouseDoubleClick( m_pWnd, button );
showMouse();
}
示例2: processEvent
void TopWindow::processEvent( EvtMouse &rEvtMouse )
{
// Get the control hit by the mouse
CtrlGeneric *pNewHitControl = findHitControl( rEvtMouse.getXPos(),
rEvtMouse.getYPos() );
setLastHit( pNewHitControl );
// Change the focused control
if( rEvtMouse.getAction() == EvtMouse::kDown )
{
// Raise the window
m_rWindowManager.raise( *this );
if( pNewHitControl && pNewHitControl->isFocusable() )
{
// If a new control gains the focus, the previous one loses it
if( m_pFocusControl && m_pFocusControl != pNewHitControl )
{
EvtFocus evt( getIntf(), false );
m_pFocusControl->handleEvent( evt );
}
if( pNewHitControl != m_pFocusControl )
{
m_pFocusControl = pNewHitControl;
EvtFocus evt( getIntf(), false );
pNewHitControl->handleEvent( evt );
}
}
else if( m_pFocusControl )
{
// The previous control loses the focus
EvtFocus evt( getIntf(), false );
m_pFocusControl->handleEvent( evt );
m_pFocusControl = NULL;
}
}
// Send a mouse event to the hit control, or to the control
// that captured the mouse, if any
CtrlGeneric *pActiveControl = pNewHitControl;
if( m_pCapturingControl )
{
pActiveControl = m_pCapturingControl;
}
if( pActiveControl )
{
pActiveControl->handleEvent( rEvtMouse );
}
}