Example #1
0
bool CursorCtrl::handleMousePress( MouseEvent& e ) 
{ 
	if( e.isLeft() && ( e.isNoKey() || e.isAlt() ) ||
		e.isRight() && e.isShift() )
	{
		Allocation a;
		allocation( a );
		ViewAreaMdl* area = d_view->getArea();
		if( d_do[ DimX ] && d_do[ DimY ] && area->getDimCount() == 2 )
		{
			PPM x = area->toPpm( e.getX(), a.getLeft(), DimX );
			PPM y = area->toPpm( e.getY(), a.getTop(), DimY );
			d_view->getModel()->setPos( d_view->getDim( DimX ), x, 
				d_view->getDim( DimY ), y, d_mouseVeto );
		}else if( d_do[ DimX ] && area->inUse( DimX ) )
		{
			PPM x = area->toPpm( e.getX(), a.getLeft(), DimX );
			d_view->getModel()->setPos( d_view->getDim( DimX ), x, d_mouseVeto );
		}else if( d_do[ DimY ] && area->inUse( DimY ) )
		{
			PPM y = area->toPpm( e.getY(), a.getTop(), DimY );
			d_view->getModel()->setPos( d_view->getDim( DimY ), y, d_mouseVeto );
		}
		return d_swallow;	// Der Click soll nicht immer gefressen werden.
	}else
		return false;
}
Example #2
0
bool SelectRulerCtr::handleMousePress( MouseEvent& e ) 
{ 
	if( e.isLeft() && e.isShift() && !e.isAlt() && !e.isCtrl() )
	{
		return installCommand( new _SelectRulerCmd( this, d_mdl ), &e ); 
	}else
		return false;
}
Example #3
0
bool PeakSelectCtrl::handleMousePress( MouseEvent& e ) 
{ 
	if( d_eatDrag && e.isLeft() && e.isShift() && !e.isAlt() && !e.isCtrl() )
	{
		return installCommand( new _SelectPeakCmd( this, d_view ), &e ); 
	}else if( e.isLeft() && !e.isAlt() && !e.isCtrl() )
	{
		assert( d_view->getBuf() );
		ViewAreaMdl* mdl = d_view->getBuf()->getViewArea();
		d_view->selectPeak( mdl->toPpm( e.getX(), mdl->getAllocation().getLeft(), DimX ), 
			mdl->toPpm( e.getY(), mdl->getAllocation().getTop(), DimY ), !e.isShift() );	
		// Nicht immer true zurück, damit Cursor funktioniert.
		notifySelection( d_view );
		return d_swallow;
	}
	// else
		return false;
}
Example #4
0
bool SelectZoomCtrl::handleMousePress( Viewport& v, const Allocation& a, const MouseEvent& e ) 
{ 
	if( e.isLeft() && e.isCtrl() && e.isShift() && !e.isAlt() )
	{
		return installCommand( new _SelectZoomCmd( this, d_viewer->getViewArea(), 
			d_do[ DimX ], d_do[ DimY ] ) ); 
	}else
		return false;
}
Example #5
0
bool ScrollCtrl::handleMousePress(MouseEvent& e ) 
{ 
	if( e.isLeft() && e.isCtrl() && !e.isShift() && !e.isAlt() )
	{
		getViewport()->grab( this );
		d_lastX = e.getX();
		d_lastY = e.getY();
		Viewport::pushCursor( Viewport::CurHand );
		return true;
	}else
		return false;
}
Example #6
0
bool PointSelectCtrl::handleMousePress( Viewport& v, const Allocation& a, const MouseEvent& e ) 
{ 
	if( e.isLeft() && e.isShift() && !e.isAlt() && !e.isCtrl() )
	{
		return installCommand( new _SelectPointCmd( this, d_view ) ); // && d_swallow; 
	}else if( e.isLeft() && e.isNoKey() )
	{
		ViewAreaMdl* mdl = d_view->getViewArea();
		d_view->selectPeak( mdl->toPpm( e.getX(), a.getLeft(), DimX ), 
			mdl->toPpm( e.getY(), a.getTop(), DimY ) );	
		// Nicht immer true zurück, damit Cursor funktioniert.
		notifySelection( d_view, SpinPointView::PairIdLabelSysOrResi );
		return d_swallow;
	}
	// else
		return false;
}