void GUI::SlideBar::handleEvent(const sf::Event &event) {
    if (event.type==sf::Event::MouseButtonPressed){
        if (contains(event.mouseButton.x, event.mouseButton.y)){
            mouseAt(event.mouseButton.x, event.mouseButton.y);
            mMouseClickHolded = true;
        }
    }
    else if (mMouseClickHolded && event.type==sf::Event::MouseMoved){
            mouseAt(event.mouseMove.x, event.mouseMove.y);
    }
    else if (mMouseClickHolded && event.type==sf::Event::MouseButtonReleased){
        mMouseClickHolded = false;
    }
}
Beispiel #2
0
void TVHBox::mouseMoveEvent(QMouseEvent *e)
{
    if (hasMouseTracking())
        emit mouseAt(e->pos());
}