コード例 #1
0
BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
{
	// Route future Mouse messages here preemptively.  (Release on mouse up.)
	gFocusMgr.setMouseCapture( this );

	if (hasTabStop() && !getIsChrome())
	{
		setFocus(TRUE);
	}

	if (mMouseDownCallback)
	{
		(*mMouseDownCallback)(mCallbackUserData);
	}

	mMouseDownTimer.start();
	mMouseDownFrame = (S32) LLFrameTimer::getFrameCount();
	
	if (getSoundFlags() & MOUSE_DOWN)
	{
		make_ui_sound("UISndClick");
	}

	return TRUE;
}
コード例 #2
0
ファイル: llslider.cpp プロジェクト: 1234-/SingularityViewer
BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask)
{
	// only do sticky-focus on non-chrome widgets
	if (!getIsChrome())
	{
		setFocus(TRUE);
	}
	if (mMouseDownSignal)
		(*mMouseDownSignal)( this, getValueF32() );

	if (MASK_CONTROL & mask) // if CTRL is modifying
	{
		setValueAndCommit(mInitialValue);
	}
	else
	{
		// Find the offset of the actual mouse location from the center of the thumb.
		if (mThumbRect.pointInRect(x,y))
		{
			mMouseOffset = (mThumbRect.mLeft + mThumbImage->getWidth()/2) - x;
		}
		else
		{
			mMouseOffset = 0;
		}

		// Start dragging the thumb
		// No handler needed for focus lost since this class has no state that depends on it.
		gFocusMgr.setMouseCapture( this );  
		mDragStartThumbRect = mThumbRect;				
	}
	make_ui_sound("UISndClick");

	return TRUE;
}
コード例 #3
0
ファイル: llbutton.cpp プロジェクト: otwstephanie/hpa2oar
BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
{
	if (!childrenHandleMouseDown(x, y, mask))
	{
		// Route future Mouse messages here preemptively.  (Release on mouse up.)
		gFocusMgr.setMouseCapture( this );

		if (hasTabStop() && !getIsChrome())
		{
			setFocus(TRUE);
		}

		/*
		 * ATTENTION! This call fires another mouse down callback.
		 * If you wish to remove this call emit that signal directly
		 * by calling LLUICtrl::mMouseDownSignal(x, y, mask);
		 */
		LLUICtrl::handleMouseDown(x, y, mask);

		if(mMouseDownSignal) (*mMouseDownSignal)(this, LLSD());

		mMouseDownTimer.start();
		mMouseDownFrame = (S32) LLFrameTimer::getFrameCount();
		mMouseHeldDownCount = 0;

		
		if (getSoundFlags() & MOUSE_DOWN)
		{
			make_ui_sound("UISndClick");
		}
	}
	return TRUE;
}
コード例 #4
0
BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask)
{
    // only do sticky-focus on non-chrome widgets
    if (!getIsChrome())
    {
        setFocus(TRUE);
    }
    if( mMouseDownCallback )
    {
        mMouseDownCallback( this, mCallbackUserData );
    }

    if (MASK_CONTROL & mask) // if CTRL is modifying
    {
        setCurSliderValue(mInitialValue);
        onCommit();
    }
    else
    {
        // scroll through thumbs to see if we have a new one selected and select that one
        std::map<std::string, LLRect>::iterator mIt = mThumbRects.begin();
        for(; mIt != mThumbRects.end(); mIt++) {

            // check if inside.  If so, set current slider and continue
            if(mIt->second.pointInRect(x,y)) {
                mCurSlider = mIt->first;
                break;
            }
        }

        // Find the offset of the actual mouse location from the center of the thumb.
        if (mThumbRects[mCurSlider].pointInRect(x,y))
        {
            mMouseOffset = (mThumbRects[mCurSlider].mLeft + MULTI_THUMB_WIDTH/2) - x;
        }
        else
        {
            mMouseOffset = 0;
        }

        // Start dragging the thumb
        // No handler needed for focus lost since this class has no state that depends on it.
        gFocusMgr.setMouseCapture( this );
        mDragStartThumbRect = mThumbRects[mCurSlider];
    }
    make_ui_sound("UISndClick");

    return TRUE;
}
コード例 #5
0
ファイル: llbutton.cpp プロジェクト: otwstephanie/hpa2oar
BOOL	LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
	if (!childrenHandleRightMouseDown(x, y, mask))
	{
		// Route future Mouse messages here preemptively.  (Release on mouse up.)
		gFocusMgr.setMouseCapture( this );

		if (hasTabStop() && !getIsChrome())
		{
			setFocus(TRUE);
		}

//		if (pointInView(x, y))
//		{
//		}
	}
	// send the mouse down signal
	LLUICtrl::handleRightMouseDown(x,y,mask);
	// *TODO: Return result of LLUICtrl call above?  Should defer to base class
	// but this might change the mouse handling of existing buttons in a bad way
	// if they are not mouse opaque.
	return TRUE;
}