예제 #1
0
//----------------------------------------------------------------------------//
void Scrollbar::onMouseButtonDown(MouseEventArgs& e)
{
    // base class processing
    Window::onMouseButtonDown(e);

    if (e.button != LeftButton)
        return;

    const float adj = getAdjustDirectionFromPoint(e.position);

    if (adj > 0)
        scrollForwardsByPage();
    else if (adj < 0)
        scrollBackwardsByPage();

    ++e.handled;
}
예제 #2
0
//----------------------------------------------------------------------------//
void Scrollbar::onMouseButtonDown(MouseEventArgs& e)
{
    // base class processing
    Window::onMouseButtonDown(e);

    if (e.button == LeftButton)
    {
        const float adj = getAdjustDirectionFromPoint(e.position);

        // adjust scroll bar position in whichever direction as required.
        if (adj != 0)
            setScrollPosition(
                d_position + ((d_pageSize - d_overlapSize) * adj));

        ++e.handled;
    }
}
예제 #3
0
/*************************************************************************
	Handler for when a mouse button is pressed
*************************************************************************/
void Slider::onMouseButtonDown(MouseEventArgs& e)
{
	// base class processing
	Window::onMouseButtonDown(e);

	if (e.button == LeftButton)
	{
		float adj = getAdjustDirectionFromPoint(e.position);

		// adjust slider position in whichever direction as required.
		if (adj != 0)
		{
			setCurrentValue(d_value + (adj * d_step));
		}

		e.handled = true;
	}

}