当前位置: 首页>>代码示例>>C++>>正文


C++ EvtMouse::getYPos方法代码示例

本文整理汇总了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 );
    }
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:30,代码来源:ctrl_slider.cpp

示例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 );
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:7,代码来源:ctrl_radialslider.cpp

示例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 );
    }
}
开发者ID:sdelmas,项目名称:SDesk,代码行数:31,代码来源:ctrl_slider.cpp

示例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 );
}
开发者ID:mstorsjo,项目名称:vlc,代码行数:11,代码来源:ctrl_move.cpp

示例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 );
    }
}
开发者ID:forthyen,项目名称:SDesk,代码行数:49,代码来源:top_window.cpp

示例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);
}
开发者ID:0xheart0,项目名称:vlc,代码行数:18,代码来源:ctrl_resize.cpp

示例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();
}
开发者ID:sdelmas,项目名称:SDesk,代码行数:24,代码来源:ctrl_slider.cpp


注:本文中的EvtMouse::getYPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。