Exemplo n.º 1
0
void SceneViewWidget::leaveEvent(QEvent* e)
{
	if (isActiveWindow())
	{
		clearFocus();
	}
	emit mouseLeft();
}
void RatioLayoutedFrame::mousePressEvent(QMouseEvent * mouseEvent)
{
  if(mouseEvent->button() == Qt::LeftButton)
  {
    emit mouseLeft(mouseEvent->x(), mouseEvent->y());
  }
  QFrame::mousePressEvent(mouseEvent);
}
Exemplo n.º 3
0
void AbstractMargin::leaveEvent( QEvent* event )
{
    QWidget::leaveEvent( event );
    
    const int line = -1;
    
    if ( line == d->line ) {
        return;
    }
    
    if ( d->line != -1 ) {
        emit mouseLeft( d->line );
    }
    
    d->line = line;
}
Exemplo n.º 4
0
    std::queue<Event> SFMLInputBackend::fetchEvents()
    {
        sf::Event event;
        std::queue<Event> result;

        while (mWindow.pollEvent(event))
        {
            if(event.type == sf::Event::Closed)
                result.push(closed());
            else if(event.type == sf::Event::Resized)
                result.push(resized(event));
            else if(event.type == sf::Event::LostFocus)
                result.push(lostFocus());
            else if(event.type == sf::Event::GainedFocus)
                result.push(gainedFocus());
            else if(event.type == sf::Event::TextEntered)
                result.push(textEntered(event));
            else if(event.type == sf::Event::KeyPressed)
                result.push(keyPressed(event));
            else if(event.type == sf::Event::KeyReleased)
                result.push(keyReleased(event));
            else if(event.type == sf::Event::MouseWheelMoved)
                result.push(mouseWheelMoved(event));
            else if(event.type == sf::Event::MouseButtonPressed)
                result.push(mouseButtonPressed(event));
            else if(event.type == sf::Event::MouseButtonReleased)
                result.push(mouseButtonReleased(event));
            else if(event.type == sf::Event::MouseMoved)
                result.push(mouseMoved(event));
            else if(event.type == sf::Event::MouseEntered)
                result.push(mouseEntered());
            else if(event.type == sf::Event::MouseLeft)
                result.push(mouseLeft());
            else if(event.type == sf::Event::JoystickButtonPressed)
                result.push(gamepadButtonPressed(event));
            else if(event.type == sf::Event::JoystickButtonReleased)
                result.push(gamepadButtonReleased(event));
            else if(event.type == sf::Event::JoystickMoved)
                result.push(gamepadMoved(event));
            else if(event.type == sf::Event::JoystickConnected)
                result.push(gamepadConnected(event));
            else if(event.type == sf::Event::JoystickDisconnected)
                result.push(gamepadDisconnected(event));
        }

        return result;
    }
Exemplo n.º 5
0
void iMouse(int button, int state, int mx, int my)
{
	mouseX = mx;
	mouseY = my;
	upArrow=0;
	downArrow=0;		//set arrow flags off

	if(button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
	{	
		mouseLeft();					//mouse left button function
	}
	if(button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
	{
		menuflag = 0;
		fOpen = 0;
		fsave = 0;			//sets off the flags
	}	
}
Exemplo n.º 6
0
bool GUIListGadget::update()
{
    updateScrollBars(&HorzScroll_, &VertScroll_);
    
    if (hasFocus() && GlbGUIMngr->MouseWheel_)
        VertScroll_.scroll(-GlbGUIMngr->MouseWheel_ * 30);
    
    if (!checkDefaultUpdate())
        return false;
    
    if (isEnabled_ && mouseOver(Rect_) && !foreignUsage())
    {
        if (mouseLeft())
        {
            focus();
            
            GUIListColumn* Column;
            bool isEdgePick;
            
            if (pickColumn(Column, isEdgePick))
            {
                FocusedColumn_ = Column;
                
                if (isEdgePick)
                    useFocus(USAGE_RESIZE_COLUMN);
                else
                    ; // !TODO!
            }
        }
    }
    
    dim::point2di Pos(getItemsStartPos());
    
    for (std::list<GUIListItem*>::iterator it = ItemList_.begin(); it != ItemList_.end(); ++it)
        updateItem(*it, Pos);
    
    if (usage(USAGE_RESIZE_COLUMN) && FocusedColumn_)
        FocusedColumn_->setColumnSize(GlbGUIMngr->CursorPos_.X - FocusedColumnPosHorz_);
    
    updateChildren();
    
    return true;
}
Exemplo n.º 7
0
void AbstractMargin::mouseMoveEvent( QMouseEvent* event )
{
    QWidget::mouseMoveEvent( event );
    
    const int line = d->lineAt( event->pos() );
    
    if ( line == d->line ) {
        return;
    }
    
    if ( d->line != -1 ) {
        emit mouseLeft( d->line );
    }
    
    d->line = line;
    
    if ( d->line != -1 ) {
        emit mouseEntered( d->line );
    }
}
bool GUIScrollbarGadget::update()
{
    if (hasFocus() && GlbGUIMngr->MouseWheel_)
        scroll(-GlbGUIMngr->MouseWheel_ * 30);
    
    if (!checkDefaultUpdate())
        return false;
    
    if (isEnabled_ && mouseOver(Rect_) && !foreignUsage())
    {
        if (mouseLeft())
        {
            focus();
            
            CursorPosBias_ = GlbGUIMngr->CursorPos_ - dim::point2di(Rect_.Left, Rect_.Top + 1) - dim::point2di(BarPos_);
            
            dim::rect2di BarRect, ButtonARect, ButtonBRect, PageARect, PageBRect;
            getButtonRects(BarRect, ButtonARect, ButtonBRect, PageARect, PageBRect);
            
            if (mouseOver(BarRect))
                useFocus(USAGE_DRAG);
            else if (mouseOver(ButtonARect))
                useFocus(USAGE_FORWARDS);
            else if (mouseOver(ButtonBRect))
                useFocus(USAGE_BACKWARDS);
            else if (mouseOver(PageARect))
                scroll(-PageSize_);
            else if (mouseOver(PageBRect))
                scroll(PageSize_);
        }
    }
    
    if (usage(USAGE_DRAG))
        updateDrag();
    else if (usage(USAGE_FORWARDS))
        scroll(-3);
    else if (usage(USAGE_BACKWARDS))
        scroll(3);
    
    return true;
}
Exemplo n.º 9
0
bool MyScene::event(QEvent* event)
{
    switch(event->type())
    {
        case QEvent::Leave:
            emit mouseLeft();
            break;
        case QEvent::GraphicsSceneMouseMove:
            x = (int)(static_cast<QGraphicsSceneMouseEvent*>(event)->scenePos().x());
            y = (int)(static_cast<QGraphicsSceneMouseEvent*>(event)->scenePos().y());
            emit mouseMoved();
            break;
        case QEvent::GraphicsSceneMousePress:
            emit mousePressed();;
            break;
        case QEvent::GraphicsSceneMouseRelease:
            emit mouseReleased();
            break;
        default:
            return false;
    }
    return false;
}
Exemplo n.º 10
0
VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent):
        QToolButton(parent),
        mPlugin(plugin),
        m_panel(plugin->panel()),
        m_showOnClick(true),
        m_muteOnMiddleClick(true)
{
    // initial icon for button. It will be replaced after devices scan.
    // In the worst case - no soundcard/pulse - is found it remains
    // in the button but at least the button is not blank ("invisible")
    handleStockIconChanged("dialog-error");
    m_volumePopup = new VolumePopup();

    m_popupHideTimer.setInterval(1000);
    connect(this, SIGNAL(clicked()), this, SLOT(toggleVolumeSlider()));
    connect(&m_popupHideTimer, SIGNAL(timeout()), this, SLOT(hideVolumeSlider()));

    connect(m_volumePopup, SIGNAL(mouseEntered()), &m_popupHideTimer, SLOT(stop()));
    connect(m_volumePopup, SIGNAL(mouseLeft()), &m_popupHideTimer, SLOT(start()));

    connect(m_volumePopup, SIGNAL(launchMixer()), this, SLOT(handleMixerLaunch()));
    connect(m_volumePopup, SIGNAL(stockIconChanged(QString)), this, SLOT(handleStockIconChanged(QString)));
}
Exemplo n.º 11
0
void GUIListGadget::updateItem(GUIListItem* Item, dim::point2di &Pos)
{
    if (!Item || !Item->getVisible())
        return;
    
    dim::rect2di Rect(
        Rect_.Left, Pos.Y, Rect_.Right, Pos.Y + Item->getItemSize()
    );
    
    if (VertScroll_.getVisible())
        Rect.Right -= SCROLLBAR_SIZE;
    if (HorzScroll_.getVisible() && Rect.Bottom > Rect_.Bottom - SCROLLBAR_SIZE)
        Rect.Bottom = Rect_.Bottom - SCROLLBAR_SIZE;
    
    Pos.Y += Item->getItemSize();
    
    /* Update current item */
    if (mouseOver(Rect))
    {
        Item->isPicked_ = true;
        
        if (mouseLeft())
        {
            SelectedItem_ = Item;
            
            SGUIEvent Event;
            {
                Event.Object    = EVENT_GADGET;
                Event.Type      = EVENT_ACTIVATE;
                Event.Gadget    = this;
                Event.SubData   = Item;
            }
            sendEvent(Event);
        }
    }
}
Exemplo n.º 12
0
void ClickableImage::leaveEvent(QEvent* eve)
{
	emit mouseLeft(this);
}
Exemplo n.º 13
0
void Column::leaveEvent(QEvent *)
{
    emit mouseLeft(m_number);
}
Exemplo n.º 14
0
void VolumePopup::leaveEvent(QEvent *event)
{
    // qDebug("leaveEvent");
    emit mouseLeft();
}
Exemplo n.º 15
0
void GLWidget::leaveEvent(QEvent * /*event*/)
{
    emit mouseLeft(this);
}
Exemplo n.º 16
0
MainWindow::MainWindow( QWidget * parent)
	: QMainWindow(parent)
{
    setupUi(this);

    version = "2015-08-28";

    inimage = false;
    x1drag = false;
    x2drag = false;
    y1drag = false;
    y2drag = false;

    image = QImage();
    pixmap = scene.addPixmap(QPixmap());
    pixmap->setZValue(0);

    QPen pen;
    pen.setColor(QColor(255,255,0));
    pen.setStyle(Qt::DashLine);
    // limit lines
    x1line = scene.addLine(QLineF(), pen);
    x1line->setZValue(1);
    x2line = scene.addLine(QLineF(), pen);
    x2line->setZValue(1);
    y1line = scene.addLine(QLineF(), pen);
    y1line->setZValue(1);
    y2line = scene.addLine(QLineF(), pen);
    y2line->setZValue(1);

    pen.setColor(QColor(255,0,0));
    pen.setStyle(Qt::SolidLine);
    // projections, beam profile, centroid
    xprojection = scene.addPath(QPainterPath(), pen);
    xprojection->setZValue(2);
    yprojection = scene.addPath(QPainterPath(), pen);
    yprojection->setZValue(2);
    ellipse = scene.addEllipse(0,0,0,0, pen);
    ellipse->setZValue(2);
    centerAline = scene.addLine(QLineF(), pen);
    centerAline->setZValue(2);
    centerBline = scene.addLine(QLineF(), pen);
    centerBline->setZValue(2);

    QObject::connect(&scene, SIGNAL(mouseMoved()), this, SLOT(mouseMovedOnScene()));
    QObject::connect(&scene, SIGNAL(mousePressed()), this, SLOT(mousePressedOnScene()));
    QObject::connect(&scene, SIGNAL(mouseReleased()), this, SLOT(mouseReleasedOnScene()));
    QObject::connect(&scene, SIGNAL(mouseLeft()), this, SLOT(mouseLeftScene()));

    graphicsView->setScene(&scene);
    graphicsView->setContextMenuPolicy(Qt::CustomContextMenu);

    X1SpinBox->setRange(0, MAX_HEIGHT-1);
    X2SpinBox->setRange(0, MAX_HEIGHT-1);
    Y1SpinBox->setRange(0, MAX_WIDTH-1);
    Y2SpinBox->setRange(0, MAX_WIDTH-1);

    scaleLabel->setScaledContents(true);

    AllocateMemory();

    dataloaded = false;
    refloaded = false;
    RestoreSession();

    LoadRef(reffile);
    LoadData(datafile);

    // Scale image
    scale = QImage(20, 256, QImage::Format_Indexed8);
    SetColorTable();
    for(int i=0; i<20; i++)
	for(int j=0; j<=255; j++)
	    scale.setPixel(i, j, 255-j);
    scaleLabel->setPixmap(QPixmap::fromImage(scale));

    graphicsView->scale(pow(2,zoom/2), pow(2,zoom/2));

    InitializeShortcuts();
    UpdateVisibility();
}
Exemplo n.º 17
0
void
LEDButton::leaveEvent(QEvent *)
{
    emit mouseLeft();
}
Exemplo n.º 18
0
 void ContactAvatarWidget::leaveEvent(QEvent* /*_event*/)
 {
     emit mouseLeft();
     update();
 }
Exemplo n.º 19
0
void
Thumbwheel::leaveEvent(QEvent *)
{
    emit mouseLeft();
}