本文整理汇总了C++中EvtMouse::getYPos方法的典型用法代码示例。如果您正苦于以下问题:C++ EvtMouse::getYPos方法的具体用法?C++ EvtMouse::getYPos怎么用?C++ EvtMouse::getYPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvtMouse
的用法示例。
在下文中一共展示了EvtMouse::getYPos方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CtrlSliderCursor::CmdMove::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
// Get the position of the control
const Position *pPos = m_pParent->getPosition();
// Compute the resize factors
float factorX, factorY;
m_pParent->getResizeFactors( factorX, factorY );
// Compute the relative position of the centre of the cursor
float relX = pEvtMouse->getXPos() - pPos->getLeft() - m_pParent->m_xOffset;
float relY = pEvtMouse->getYPos() - pPos->getTop() - m_pParent->m_yOffset;
// Ponderate with the resize factors
int relXPond = (int)(relX / factorX);
int relYPond = (int)(relY / factorY);
// Update the position
if( m_pParent->m_rCurve.getMinDist( relXPond, relYPond ) < RANGE )
{
float percentage = m_pParent->m_rCurve.getNearestPercent( relXPond,
relYPond );
m_pParent->m_rVariable.set( percentage );
}
else
{
m_pParent->m_rVariable.set( m_pParent->m_lastPercentage );
}
}
示例2:
void CtrlRadialSlider::CmdMove::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
// Change the position of the cursor, in blocking mode
m_pParent->setCursor( pEvtMouse->getXPos(), pEvtMouse->getYPos(), true );
}
示例3: transMove
void CtrlSliderCursor::transMove( SkinObject *pCtrl )
{
CtrlSliderCursor *pThis = (CtrlSliderCursor*)pCtrl;
EvtMouse *pEvtMouse = (EvtMouse*)pThis->m_pEvt;
// Get the position of the control
const Position *pPos = pThis->getPosition();
// Compute the resize factors
float factorX, factorY;
pThis->getResizeFactors( factorX, factorY );
// Compute the relative position of the centre of the cursor
float relX = pEvtMouse->getXPos() - pPos->getLeft() - pThis->m_xOffset;
float relY = pEvtMouse->getYPos() - pPos->getTop() - pThis->m_yOffset;
// Ponderate with the resize factors
int relXPond = (int)(relX / factorX);
int relYPond = (int)(relY / factorY);
// Update the position
if( pThis->m_rCurve.getMinDist( relXPond, relYPond ) < RANGE )
{
float percentage = pThis->m_rCurve.getNearestPercent( relXPond,
relYPond );
pThis->m_rVariable.set( percentage );
}
else
{
pThis->m_rVariable.set( pThis->m_lastPercentage );
}
}
示例4:
void CtrlMove::CmdStillMoving::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
m_pParent->m_xPos = pEvtMouse->getXPos();
m_pParent->m_yPos = pEvtMouse->getYPos();
m_pParent->captureMouse();
m_pParent->m_rWindowManager.startMove( m_pParent->m_rWindow );
}
示例5: 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 );
}
}
示例6:
void CtrlResize::CmdStillResize::execute()
{
EvtMouse *pEvtMouse = static_cast<EvtMouse*>(m_pParent->m_pEvt);
// Set the cursor
m_pParent->changeCursor( m_pParent->m_direction );
m_pParent->m_xPos = pEvtMouse->getXPos();
m_pParent->m_yPos = pEvtMouse->getYPos();
m_pParent->captureMouse();
m_pParent->m_width = m_pParent->m_rLayout.getWidth();
m_pParent->m_height = m_pParent->m_rLayout.getHeight();
m_pParent->m_rWindowManager.startResize( m_pParent->m_rLayout,
m_pParent->m_direction);
}
示例7: transOverDown
void CtrlSliderCursor::transOverDown( SkinObject *pCtrl )
{
CtrlSliderCursor *pThis = (CtrlSliderCursor*)pCtrl;
EvtMouse *pEvtMouse = (EvtMouse*)pThis->m_pEvt;
// Compute the resize factors
float factorX, factorY;
pThis->getResizeFactors( factorX, factorY );
// Get the position of the control
const Position *pPos = pThis->getPosition();
// Compute the offset
int tempX, tempY;
pThis->m_rCurve.getPoint( pThis->m_rVariable.get(), tempX, tempY );
pThis->m_xOffset = pEvtMouse->getXPos() - pPos->getLeft()
- (int)(tempX * factorX);
pThis->m_yOffset = pEvtMouse->getYPos() - pPos->getTop()
- (int)(tempY * factorY);
pThis->captureMouse();
pThis->m_pImg = pThis->m_pImgDown;
pThis->notifyLayout();
}