Exemple #1
0
void QClickableLabel::mousePressEvent( QMouseEvent* e )
{
  unsigned int index = matchingRect( e->pos() );
  if ( index < m_Hotspots.size() )
  {
    emit mouseReleased( index );
    emit mouseReleased( m_HotspotNameForIndex[index] );
  }
}
Exemple #2
0
/* Execute a set of widgets for one cycle.
 * Return the id of the widget that was activated, or 0 for none.
 */
UDWORD widgRunScreen(W_SCREEN *psScreen)
{
	W_CONTEXT	sContext;

	psScreen->psRetWidget = NULL;

	// Note which keys have been pressed
	pressed = WKEY_NONE;
	sContext.mx = mouseX();
	sContext.my = mouseY();
	if(getWidgetsStatus())
	{
		if (mousePressed(MOUSE_LMB))
		{
			pressed = WKEY_PRIMARY;
			sContext.mx = mousePressPos(MOUSE_LMB).x;
			sContext.my = mousePressPos(MOUSE_LMB).y;
		}
		else if (mousePressed(MOUSE_RMB))
		{
			pressed = WKEY_SECONDARY;
			sContext.mx = mousePressPos(MOUSE_RMB).x;
			sContext.my = mousePressPos(MOUSE_RMB).y;
		}
		released = WKEY_NONE;
		if (mouseReleased(MOUSE_LMB))
		{
			released = WKEY_PRIMARY;
			sContext.mx = mouseReleasePos(MOUSE_LMB).x;
			sContext.my = mouseReleasePos(MOUSE_LMB).y;
		}
		else if (mouseReleased(MOUSE_RMB))
		{
			released = WKEY_SECONDARY;
			sContext.mx = mouseReleasePos(MOUSE_RMB).x;
			sContext.my = mouseReleasePos(MOUSE_RMB).y;
		}
	}
	/* Initialise the context */
	sContext.psScreen = psScreen;
	sContext.psForm = (W_FORM *)psScreen->psForm;
	sContext.xOffset = 0;
	sContext.yOffset = 0;
	psMouseOverWidget = NULL;

	/* Process the screen's widgets */
	widgProcessForm(&sContext);

	/* Process any user callback functions */
	widgProcessCallbacks(&sContext);

	/* Return the ID of a pressed button or finished edit box if any */
	return psScreen->psRetWidget ? psScreen->psRetWidget->id : 0;
}
Exemple #3
0
VideoView::VideoView(QWidget *parent) :
    QAbstractItemView(parent),
    _view(new VideoGraphicsView),
    _noVideoVideo(Video(new QGraphicsScene(_view), 0)),
    _playBar(new PlayBar(this)),
    _status(new VideoStatus(this))
{
    new QVBoxLayout(viewport());
    viewport()->layout()->addWidget(_status);
    _status->hide();
    viewport()->layout()->addWidget(_view);
    viewport()->layout()->setMargin(0);
    viewport()->layout()->setSpacing(0);
    _view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    _view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    _view->setRenderHint(QPainter::Antialiasing);
    viewport()->layout()->addWidget(_playBar);

    QImage bgImage(":/images/translucent-logo.png");
    _view->setScene(_noVideoVideo.scene);
    _noVideoVideo.bgRect = new QGraphicsRectItem(0);
    _noVideoVideo.bgRect->setRect(QRectF(QPointF(0, 0), bgImage.size()));
    _noVideoVideo.bgRect->setBrush(bgImage);
    _noVideoVideo.bgRect->setPen(Qt::NoPen);
    _noVideoVideo.scene->addItem(_noVideoVideo.bgRect);
    _noVideoVideo.scene->setSceneRect(QRectF(QPointF(0, 0), bgImage.size()));
    QGraphicsItem *noVideoText = _noVideoVideo.scene->addText(tr("No video"));
    noVideoText->moveBy(100, 50);

    connect(_playBar, SIGNAL(newDistanceRequested()), SLOT(beginDistanceCreation()));
    connect(_playBar, SIGNAL(newAngleRequested()), SLOT(beginAngleCreation()));

    connect(_playBar, &PlayBar::frameChanged, [=](int frame)
    {
        QModelIndex currentFrameIndex = model()
                ->index(_currentVideoRow, VideoModel::CurrentFrameColumn);

        if (frame == currentFrameIndex.data().toInt()) {
            return;
        }

        model()->setData(currentFrameIndex, frame);
    });

    connect(_playBar, &PlayBar::newTrajectoryRequested, [=]()
    {
        auto status = new Status::Persistent(_status, tr("Click a point to track"));

        connect(_view, SIGNAL(mouseReleased(QPointF)), SLOT(calculateTrajectory(QPointF)));
        connect(_view, SIGNAL(mouseReleased(QPointF)), status, SLOT(deleteLater()));
    });
}
Exemple #4
0
Controller::Controller(){
    Worker* worker = new Worker;
    worker->moveToThread(&thread);
    connect(&thread, SIGNAL(started()), worker, SLOT(doWork()));
    connect(worker, SIGNAL(finished()), &thread, SLOT(quit()));
    connect(&thread, SIGNAL(finished()), worker, SLOT(deleteLater()));
    connect(&thread, SIGNAL(finished()), QCoreApplication::instance(), SLOT(quit()));
    connect(this, SIGNAL(mouseMove(int,int)), worker, SLOT(mouseMouve(int,int)));
    connect(this, SIGNAL(mousePressed()), worker, SLOT(mousePressed()));
    connect(this, SIGNAL(mouseReleased()), worker, SLOT(mouseReleased()));
    connect(this, SIGNAL(quit()), worker , SLOT(quit()) );

}
Exemple #5
0
TimeSlider::TimeSlider( QWidget * parent ) : MySlider(parent)
{
	dont_update = FALSE;
	setMinimum(0);
#ifdef SEEKBAR_RESOLUTION
	setMaximum(SEEKBAR_RESOLUTION);
#else
	setMaximum(100);
#endif

	setFocusPolicy( Qt::NoFocus );
	setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Fixed );

	connect( this, SIGNAL( sliderPressed() ), this, SLOT( stopUpdate() ) );
	connect( this, SIGNAL( sliderReleased() ), this, SLOT( resumeUpdate() ) );
	connect( this, SIGNAL( sliderReleased() ), this, SLOT( mouseReleased() ) );
	connect( this, SIGNAL( valueChanged(int) ), this, SLOT( valueChanged_slot(int) ) );
#if ENABLE_DELAYED_DRAGGING
	connect( this, SIGNAL(draggingPos(int) ), this, SLOT(checkDragging(int)) );
	
	last_pos_to_send = -1;
	timer = new QTimer(this);
	connect( timer, SIGNAL(timeout()), this, SLOT(sendDelayedPos()) );
	timer->start(200);
#endif
}
QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint &pixelCoords, QWidget* parent )
    : QDialog( parent, Qt::Dialog ), mQgisCanvas( qgisCanvas ), mPixelCoords( pixelCoords )
{
  setupUi( this );

  setAttribute( Qt::WA_DeleteOnClose );

  mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/default/mPushButtonPencil.png" ), tr( "From map canvas" ) );
  mPointFromCanvasPushButton->setCheckable( true );
  buttonBox->addButton( mPointFromCanvasPushButton, QDialogButtonBox::ActionRole );
  adjustSize();

  // User can input either DD or DMS coords (from QGis mapcanav we take DD coords)
  QgsDMSAndDDValidator *validator = new QgsDMSAndDDValidator( this );
  leXCoord->setValidator( validator );
  leYCoord->setValidator( validator );

  mToolEmitPoint = new QgsGeorefMapToolEmitPoint( qgisCanvas );
  mToolEmitPoint->setButton( mPointFromCanvasPushButton );

  QSettings s;
  mSnapToBackgroundLayerBox->setChecked( s.value( "/Plugin-GeoReferencer/snapToBackgroundLayers", QVariant( false ) ).toBool() );

  connect( mPointFromCanvasPushButton, SIGNAL( clicked( bool ) ), this, SLOT( setToolEmitPoint( bool ) ) );

  connect( mToolEmitPoint, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
           this, SLOT( maybeSetXY( const QgsPoint&, Qt::MouseButton ) ) );
  connect( mToolEmitPoint, SIGNAL( mouseReleased() ), this, SLOT( setPrevTool() ) );

  connect( leXCoord, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateOK() ) );
  connect( leYCoord, SIGNAL( textChanged( const QString& ) ), this, SLOT( updateOK() ) );
  updateOK();
}
//--------------------------------------------------------------
void ofxMSAInteractiveObject::_mouseReleased(ofMouseEventArgs &e) {
	int x = e.x;
	int y = e.y;
	int button = e.button;
    
    if(doCoordTransformation){
        ofVec2f transformedCoord = screenToCanvas(ofVec2f(x,y));
        x = transformedCoord.x;
        y = transformedCoord.y;
    }
	
	if(verbose) printf("ofxMSAInteractiveObject::_mouseReleased(x: %i, y: %i, button: %i)\n", x, y, button);
	if(!enabled) {
        _isMousePressed[button] = false;
        return;
    }
	
	if(hitTest(x, y)) {
		onRelease(x, y, button);
	} else {
		if(isMousePressed(button)) onReleaseOutside(x, y, button);
	}
	_isMousePressed[button] = false;

    _stateChangeTimestampMillis = ofGetElapsedTimeMillis();
    
    mouseReleased(x, y, button);
}
Exemple #8
0
void View::doMouseReleased(u16 x, u16 y, MouseButton b)
{
  bool handled = false;
  
  if (curButton)
  {
    bool inside = curButton->isInside(x,y);
    if (inside && b == BUTTON_LEFT)
    {
      handled = true;
      curButton->click();
      curButton->release();
      curButton = nullptr;
    }
    else if (!inside)
    {
      curButton->release();
      curButton = nullptr;
    }
  }
  
  for (const auto c : areas)
  {
    if (c && c->isActive() && c->isCorrectButton(b) && c->isInside(x,y))
    {
      c->getAction()();
      handled = true;
    }
  }
  
  if (!handled)
    mouseReleased(x,y,b);
}
void
ValControlSegment::MouseUp(BPoint point)
{
	if (isTracking()) {
		setTracking(false);
		mouseReleased();
	}
}	
Exemple #10
0
void SMTabruler::pbClicked()
{
	if (hasParent_)
	{
		useParentTabs_ = true;
		emit mouseReleased();
	}
}
Exemple #11
0
void Slider::mouseLeftWindow(wxMouseEvent& event)
{
  TraceOp.trc( "slider", TRCLEVEL_DEBUG, __LINE__, 9999, "mouseLeftWindow");
  if(Drag)
    mouseReleased(event);

  if( PrevFocusWindow )
    PrevFocusWindow->SetFocus();
}
Exemple #12
0
void GLWidget::delegateMouseRelease(QMouseEvent *event)
{
    emit mouseReleased(this);

      // if there is no mouse button down, just ignore this
      if(!(mouse_LeftButton_ || mouse_MidButton_ || mouse_RightButton_))
        return;

      // get window coordinates of event
      mouse_Event_X_ = event->x();
      mouse_Event_Y_ = event->y();

      // convert to scene coordinates
      if(isOnly2D_)
      {
          Eigen::Vector3d p = camera2D_.viewMatrixInverse() * Eigen::Vector3d(mouse_Event_X_, mouse_Event_Y_, 0);
          mouse_Event_XScene_ = p[0];
          mouse_Event_YScene_ = p[1];
      }

      // set the mouse button state to false, only if it's the 
      // corresponding button 
      switch(event->button()){
      case Qt::LeftButton:
        if(!mouse_LeftButton_)
          return;
        mouse_LeftButton_ = false;
        break;
      case Qt::MidButton:
        if(!mouse_MidButton_)
          return;
        mouse_MidButton_ = false;
        break;
      case Qt::RightButton:
        if(!mouse_RightButton_)
          return;
        mouse_RightButton_ = false;
        break;
      default:
        event->ignore();
        return;
      }

      // if there is no possible actions, ignore this too
      if(!mouse_ClicAction_ && !mouse_PMRAction_)
        return;

      // Perform the corresponding actions
    if(mouse_ClicAction_)
        ClicEvent(mouse_ClicAction_, mouse_Event_XScene_, mouse_Event_YScene_);
    else
        PMRReleaseEvent(mouse_PMRAction_, mouse_Event_XScene_, mouse_Event_YScene_);

    // Inform that the GLView is not busy anymore
    mouse_ClicAction_ = GLAction::None;
    mouse_PMRAction_ = GLAction::None;
}
Exemple #13
0
//-----------------------------------------------------------------------------
void QGLImageGpuWidget::mouseReleaseEvent(QMouseEvent * event)
{
  if (button_ == Qt::LeftButton)
    emit mouseReleased(floor(event->x()/zoom_), floor(event->y()/zoom_));
  else if (button_ == Qt::MidButton)
    this->setCursor(old_cursor_);

  button_ = Qt::NoButton;
}
void end_lesson(int min,int sec,int eff,int err, int speed)
{
	int change=0,y,x;
	show_summary(min, sec, eff, err, speed);
	draw_3dbox(260,220,320,240,15);
	settextstyle(0,0,1);
	color_text(280,227,"Ok",3);
	showMouse();
	while(1)
	{
		while(1)
		{
			x=getMouseX(); /* get the mouse position*/
			y=getMouseY();
			if(x>=260&&x<=320&&y>=220&&y<=240 && !change)
			{
				change = 1;
				settextstyle(0,0,1);
				hideMouse();
				draw_3dbox(260,220,320,240,6);	/* change the color of the box*/
				/* change the text color*/
				color_text(280,227,"Ok",15);   /*cursor on yes*/
				showMouse();
			}

			if((x<=260||x>=320||y<=220||y>=240)&& change)
			{
				change = 0;
				hideMouse();
				draw_3dbox(260,220,320,240,15);
				/* when mouse moves away change the color to normal one*/
				color_text(280,227,"Ok",3);
				showMouse();         /*cursor on yes/no*/
			}

			if(mouseClicked())
			{
				x=getMouseX();       /*get the position where mouse is clicked*/
				y=getMouseY();
				while(1)
					if(mouseReleased())		/* get the position*/
						break;			/* where mouse is clicked*/
				break;					/* and released */
			}
		}/*end of while 2 which changes color of button*/

		/*check the position of mouse clicked*/
		if(x>=260&&x<=320&&y>=220&&y<=240)  // back
		{
			hideMouse();
			up_down_button(260,220,320,240,280,227,19,15,15,6);
			break;
		}
	}/*end of while 1*/

}
Exemple #15
0
// Check for and process a user request for a new target.
//
void driveProcessAquireButton(void)
{
	if(mouseReleased(MOUSE_RMB) || keyPressed(KEY_S))
	{
//		BASE_OBJECT	*psObj;
//		psObj = targetAquireNearestObjView((BASE_OBJECT*)psDrivenDroid);
//		driveMarkTarget();
//		pie_SetMouse(CURSOR_ATTACK, true);
	}
}
Exemple #16
0
void TupGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
    // SQA: Temporal solution for cases when there's no current frame defined
    if (!currentFrame()) {
        return;
    }

    QGraphicsScene::mouseReleaseEvent(event);
    mouseReleased(event);
}
Exemple #17
0
void SMTabruler::setTabs(QList<ParagraphStyle::TabRecord> Tabs, int unitIndex, bool isParentValue)
{
	disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
	disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
	hasParent_  = true;
	m_unitIndex = unitIndex;
	if (isParentValue)
		parentButton_->hide();
	else
		parentButton_->show();
	Tabruler::setTabs(Tabs, unitIndex);
	Tabruler::repaint();
	first_->setNewUnit(unitIndex);
	left_->setNewUnit(unitIndex);
	right_->setNewUnit(unitIndex);
	tabData->setNewUnit(unitIndex);

	connect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
	connect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
}
// ****************************************************************************
//  Method:  QvisScribbleOpacityBar::mouseReleaseEvent
//
//  Purpose:
//
//
//  Programmer:  Jeremy Meredith
//  Creation:    January 31, 2001
//
// ****************************************************************************
void
QvisScribbleOpacityBar::mouseReleaseEvent(QMouseEvent *e)
{
    int _x = e->x();
    int _y = e->y();
    setValues(lastx, lasty, _x, _y);
    mousedown = false;

    this->repaint();
    emit mouseReleased();
}
void IndigoTabbar::addIndigoPanel(IndigoPanel *panel, int tabIndex ){

    IndigoDropZone * zone = new IndigoDropZone(0);
    zone->addPanel(panel);

    static const QIcon &icon = panel->Icon();

    // new tab
    if (tabIndex == -1){

        this->connect(panel, SIGNAL(mouseReleased()), zone, SLOT(dropPanel()));
        this->connect(panel, SIGNAL(mouseMove()), zone, SLOT(hoverZone()));


        addTab ( zone, icon, "" );


    // exsisting tab
    }else{

        if(tabIndex >= 0 && tabIndex <= this->count() - 1){

            QWidget * widget = this->widget(tabIndex);

            IndigoDropZone *zone = qobject_cast<IndigoDropZone*>(widget);
            if(!zone) return;

            zone->addPanel(panel);

            this->connect(panel, SIGNAL(mouseReleased()), zone, SLOT(dropPanel()));
            this->connect(panel, SIGNAL(mouseMove()), zone, SLOT(hoverZone()));

           // m_activeWidget = this->widget(currentIndex()); // not need for exsisting tabs
        }

    }



}
Exemple #20
0
void SimpleSimulator::processEvents()
{
    SDL_Event event;

    while( SDL_PollEvent( &event ) ) {

        switch( event.type ) {
		case SDL_KEYDOWN:
			if( event.key.keysym.sym == SDLK_ESCAPE ){
				running = false;
				SDL_Quit();
			} else if( event.key.keysym.sym == SDLK_F1 ){
				fullscreen=!fullscreen;
				initWindow();
			} else if( event.key.keysym.sym == SDLK_f ){
				fullupdate=!tuioServer->fullUpdateEnabled();
				if (fullupdate) tuioServer->enableFullUpdate();
				else tuioServer->disableFullUpdate();
			} else if( event.key.keysym.sym == SDLK_p ){
				periodic=!tuioServer->periodicMessagesEnabled();
				if (periodic) tuioServer->enablePeriodicMessages();
				else tuioServer->disablePeriodicMessages();
			} else if( event.key.keysym.sym == SDLK_v ){
				verbose = !verbose;
				tuioServer->setVerbose(verbose);
			} else if( event.key.keysym.sym == SDLK_h ){
				help = !help;
			} else if( event.key.keysym.sym == SDLK_r ){
				tuioServer->resetTuioCursors();
				stickyCursorList.clear();
				jointCursorList.clear();
				activeCursorList.clear();
			}
			break;

		case SDL_MOUSEMOTION:
			if (event.button.button == SDL_BUTTON_LEFT) mouseDragged((float)event.button.x/width, (float)event.button.y/height);
			break;
		case SDL_MOUSEBUTTONDOWN:
			if (event.button.button == SDL_BUTTON_LEFT) mousePressed((float)event.button.x/width, (float)event.button.y/height);
			break;
		case SDL_MOUSEBUTTONUP:
			if (event.button.button == SDL_BUTTON_LEFT) mouseReleased((float)event.button.x/width, (float)event.button.y/height);
			break;
		case SDL_QUIT:
			running = false;
			SDL_ShowCursor(true);
			SDL_Quit();
			break;
        }
    }
}
Exemple #21
0
void SMTabruler::setTabs(QList<ParagraphStyle::TabRecord> Tabs, int unitIndex)
{
	disconnect(this, SIGNAL(tabsChanged()), this, SLOT(slotTabsChanged()));
	disconnect(this, SIGNAL(mouseReleased()), this, SLOT(slotTabsChanged()));
	hasParent_ = false;
	parentButton_->hide();
	Tabruler::setTabs(Tabs, unitIndex);
	Tabruler::repaint();
	first_->setNewUnit(unitIndex);
	left_->setNewUnit(unitIndex);
	right_->setNewUnit(unitIndex);
	tabData->setNewUnit(unitIndex);
}
Exemple #22
0
/* This function does nothing - since it's already been drawn */
void runCreditsScreen( void )
{
	// Check for key presses now.
	if( keyReleased(KEY_ESC)
	   || keyReleased(KEY_SPACE)
	   || mouseReleased(MOUSE_LMB)
	   || gameTime - lastChange > 4000 )
	{
		lastChange = gameTime;
		changeTitleMode(QUIT);
	}
	return;
}
void AMCrosshairOverlayVideoWidget::mouseReleaseEvent(QMouseEvent *e)
{
	AMOverlayVideoWidget::mouseReleaseEvent(e);

	if(e->button() == Qt::LeftButton) {
		if(doubleClickInProgress_) {
			emit mouseDoubleClicked(mapSceneToVideo(mapToScene(e->pos())));
			doubleClickInProgress_ = false;
		}
		else {
			emit mouseReleased(mapSceneToVideo(mapToScene(e->pos())));
		}
	}
}
//------------------ other methods -----------------------------------
void GlutMouseListener::update( int info, int x, int y )
{
    switch ( info & GlutMouseSource::MOUSE_ACTION_MASK )
    {
        case GlutMouseSource::MOUSE_BUTTON_DOWN:
            mousePressed( info & GlutMouseSource::MOUSE_BUTTON_MASK, x, y );
            break;
        case GlutMouseSource::MOUSE_BUTTON_UP:
            mouseReleased( info & GlutMouseSource::MOUSE_BUTTON_MASK, x, y );
            break;
        case GlutMouseSource::MOUSE_MOTION:
            mouseMoved(x, y);
            break;
    }
}
//! Mouse event handler
void QwtPlotCanvas::mouseReleaseEvent(QMouseEvent *e)
{
    if (d_outlineActive)
    {
        QPainter p(this);
        drawOutline(p);
    }

    d_outlineActive = FALSE;
    d_mousePressed = FALSE;

    QMouseEvent m(QEvent::MouseButtonRelease, 
        e->pos() - rect().topLeft(), e->button(), e->state());

    emit mouseReleased(m);
}
Exemple #26
0
	void GenericSkin::mouseMultiDragged(int x, int y) {
		if(mPressedKey) return;

		if( x>=screenRect.x && x<screenRect.x+screenRect.w &&
			y>=screenRect.y && y<screenRect.y+screenRect.h) {
				if(!mTouchedInside) {
					mousePressed(x, y);
					return;
				}

				int xPosition = x - screenRect.x;
				int yPosition = y - screenRect.y;

				// Calculates the delta movement from the mouse
				// and adds the same distance to the mirrored touch event
				mLastKnownMousePosition[1].first +=
							( mLastKnownMousePosition[0].first - xPosition);
				mLastKnownMousePosition[1].second +=
							( mLastKnownMousePosition[0].second - yPosition);

				mListener->onMoSyncPointerDrag(x-screenRect.x,
												y-screenRect.y, 0);

				mListener->onMoSyncPointerDrag(
											mLastKnownMousePosition[1].first,
											mLastKnownMousePosition[1].second,
											1);

				mLastKnownMousePosition[0].first = xPosition;
				mLastKnownMousePosition[0].second = yPosition;

				return;
		} else {
			if(mTouchedInside) {
				if(x<screenRect.x) x = screenRect.x;
				if(y<screenRect.y) y = screenRect.y;
				if(x>=screenRect.x+screenRect.w)
					x = screenRect.x+screenRect.w-1;
				if(y>=screenRect.y+screenRect.h)
					y = screenRect.y+screenRect.h-1;
				mouseReleased(x, y);
				return;
			}
		}
	}
Exemple #27
0
void flatButton::mouseReleaseEvent(QMouseEvent *e)
{
    emit mouseReleased();
    QRect rect=this->geometry();
    QPoint mousePos=this->mapFromGlobal(QCursor::pos());
    if(pressed && (abs(mousePos.x()))<=rect.size().width() &&
            (abs(mousePos.y()))<=rect.size().height())
    {
        if(e->button()==Qt::LeftButton)
        {
            emit clicked();
        }
        else if(e->button()==Qt::RightButton)
        {
            emit rightClicked();
        }
    }
    pressed=false;
}
		void CInputEventsTranslator::deactivateMouseButtonTranslation()
		{

			Messages::MessageType mousePressed("MOUSE_PRESSED");
			Messages::MessageType mouseReleased("MOUSE_RELEASED");
			Messages::MessageType updateMouse("UPDATE_MOUSE");

			CMessageModule* messageModule = CMessageModule::getInstancePtr();
			Messages::Messenger* messageManager = messageModule->getMessageManager();

			try
			{
				/**
				 * Continuous mouse messages
				 */
				messageManager->delListener ( mouseButtonEventsTranslator, mousePressed );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTranslator listener removed for MOUSE_PRESSED" );

				messageManager->delListener ( mouseButtonEventsTranslator, mouseReleased );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTranslator listener removed for MOUSE_RELEASED" );

				messageManager->delListener ( mouseButtonEventsTrigger, updateMouse );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonEventsTrigger listener removed" );

				/**
				 * State based mouse messages
				 */
				messageManager->delListener ( mouseButtonStateTranslator, mousePressed );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonStateTranslator listener removed for MOUSE_PRESSED" );

				messageManager->delListener ( mouseButtonStateTranslator, mouseReleased );
				Gnoll::Log::CLogModule::getInstancePtr()->logMessage ( "mouseButtonStateTranslator listener removed for MOUSE_RELEASED" );
			}
			catch(...)
			{
				throw;
			}

			CTimeModule* timeModule = CTimeModule::getInstancePtr();
			shared_ptr<CMessage>  message (new CMessage(updateMouse, m_periodData ));
			timeModule->delPeriodicEvent(0, message, boost::any_cast<unsigned long int> (*m_periodData) );

		}
void
ValControlSegment::MouseDown(BPoint point)
{
	if (!parent()->IsEnabled())
		return;

	parent()->MakeFocus();

	// not left button?
	uint32 nButton;
	GetMouse(&point, &nButton);
	if (!(nButton & B_PRIMARY_MOUSE_BUTTON))
		return;

	// double click?
	bigtime_t doubleClickInterval;
	if (get_click_speed(&doubleClickInterval) < B_OK) {
		PRINT(("* ValControlSegment::MouseDown():\n"
			"  get_click_speed() failed."));
		return;
	}

	bigtime_t now = system_time();
	if (now - fLastClickTime < doubleClickInterval) {
		if(isTracking()) {
			setTracking(false);
			mouseReleased();
		}

		// hand off to parent control
		parent()->showEditField();
		fLastClickTime = 0LL;
		return;
	}
	else
		fLastClickTime = now;

		
	// engage tracking
	trackMouse(point, TRACK_VERTICAL);
}
Exemple #30
0
/* The video playback loop */
void videoLoop()
{
	bool videoFinished;

	ASSERT(videoMode == 1, "videoMode out of sync");

	// display a frame of the FMV
	videoFinished = !seq_UpdateFullScreenVideo(nullptr);
	pie_ScreenFlip(CLEAR_BLACK);

	// should we stop playing?
	if (videoFinished || keyPressed(KEY_ESC) || mouseReleased(MOUSE_LMB))
	{
		seq_StopFullScreenVideo();

		//set the next video off - if any
		if (videoFinished && seq_AnySeqLeft())
		{
			seq_StartNextFullScreenVideo();
		}
		else
		{
			// remove the intelligence screen if necessary
			if (messageIsImmediate())
			{
				intResetScreen(true);
				setMessageImmediate(false);
			}
			//don't do the callback if we're playing the win/lose video
			if (!getScriptWinLoseVideo())
			{
				eventFireCallbackTrigger((TRIGGER_TYPE)CALL_VIDEO_QUIT);
			}
			else if (!bMultiPlayer)
			{
				displayGameOver(getScriptWinLoseVideo() == PLAY_WIN, false);
			}
			triggerEvent(TRIGGER_VIDEO_QUIT);
		}
	}
}