コード例 #1
0
  void MainWindow::onLeftMouseUp(SkScalar x, SkScalar y) {

    // Forward the event to a container control
    if (isPointInsideRect(x, y, m_tabCtrl.getRect()))
      m_tabCtrl.onLeftMouseUp(x, y);
    else if (m_codeEditCtrl.isTrackingActive() || isPointInsideRect(x, y, m_codeEditCtrl.getRect()))
      m_codeEditCtrl.onLeftMouseUp(x, y);

    // [] Other controls' tests should go here
  }
コード例 #2
0
void AParameterUIObjectSliderFloat::mouseUp( int _x, int _y, int _button )
{

	
	// update child objects
	AParameterUIObjectBase* tmpObj;
	for( unsigned int i = 0; i < uiObjects.size(); i++ )
	{
		tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
		tmpObj->mouseUp( _x, _y, _button );
	}	
	
	if( isPointInsideRect( _x, _y, posx, posy, width, height ) )
	{
		int insideX = _x - posx;
		int insideY = _y - posy;

		// update child objects
		AParameterUIObjectBase* tmpObj;
		for( unsigned int i = 0; i < uiObjects.size(); i++ )
		{
			tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
			tmpObj->mouseUp( insideX, insideY, _button );
		}

	}

	slider.isBeingDragged = false;
}
コード例 #3
0
bool AParameterUIAssetDraggableSlider::pointIsInsideSlider( int _x, int _y )
{
tmpX = _x - posx;
tmpY = _y - posy;
	//cout << _x << ", " << _y << "   " << posx << ", " << posy << "   " << width << ", " << height << endl;

	if( isPointInsideRect( _x, _y, posx, posy, width, height ) ) { return true; } else { return false; }
}
コード例 #4
0
void AParameterUIObjectSliderFloat::mouseMotion( int _x, int _y )
{

	int insideX = _x - posx;
	int insideY = _y - posy;

	// update child objects
	AParameterUIObjectBase* tmpObj;
	for( unsigned int i = 0; i < uiObjects.size(); i++ )
	{
		tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
		tmpObj->mouseMotion( _x, _y );
	}
	
	
	
	if( slider.isBeingDragged )
	{
		slider.setPos( slider.posFracInsideSlider( insideX, insideY ) );
		currVal = fracToVal( slider.currFrac );

		ostringstream buffer; buffer << currVal; 
		titlePlusValue = paramTitle + ": " + buffer.str();

		if( funcPointerSet )
		{
			changedParameterCallback( currVal, arg1, arg2, arg3 );
		}
	}

	if( isPointInsideRect( _x, _y, posx, posy, width, height ) )
	//if( isPointInsideMe( _x, _y ) )
	{


		// update child objects
		AParameterUIObjectBase* tmpObj;
		for( unsigned int i = 0; i < uiObjects.size(); i++ )
		{
			tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
			tmpObj->mouseMotion( insideX, insideY );
		}

		outlineColor[0] = 0.5f; outlineColor[1] = 0.5f; outlineColor[2] = 1.0f;
	}
	else
	{
		outlineColor[0] = 1.0f; outlineColor[1] = 1.0f; outlineColor[2] = 1.0f;	
	}
}
コード例 #5
0
void AParameterUIObjectSliderFloat::mouseDown( int _x, int _y, int _button )
{
	
	// update child objects
	AParameterUIObjectBase* tmpObj;
	for( unsigned int i = 0; i < uiObjects.size(); i++ )
	{
		tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
		//tmpObj->mouseDown( insideX, insideY, _button );
		tmpObj->mouseDown( _x, _y, _button );
	}	

	if( isPointInsideRect( _x, _y, posx, posy, width, height ) )
	{
		int insideX = _x - posx;
		int insideY = _y - posy;

		if( slider.pointIsInsideSlider( insideX, insideY ) ) 
		{
			//cout << _button;
			slider.isBeingDragged = true;
			mouseMotion( _x, _y ); // generate a dragged event to move the slider into this position

			// update child objects
			AParameterUIObjectBase* tmpObj;
			for( unsigned int i = 0; i < uiObjects.size(); i++ )
			{
				tmpObj = (AParameterUIObjectBase*) uiObjects.at( i );
				tmpObj->mouseDown( insideX, insideY, _button );
			}

		}
		else
		{
			slider.isBeingDragged = false;
		}
		
	}
	else
	{
		slider.isBeingDragged = false;
	}
}