Exemplo n.º 1
0
bool UIWidget::propagateOnMouseEvent(const Point& mousePos, UIWidgetList& widgetList)
{
    bool ret = false;
    if(containsPaddingPoint(mousePos)) {
        for(auto it = m_children.rbegin(); it != m_children.rend(); ++it) {
            const UIWidgetPtr& child = *it;
            if(child->isExplicitlyEnabled() && child->isExplicitlyVisible() && child->containsPoint(mousePos)) {
                if(child->propagateOnMouseEvent(mousePos, widgetList)) {
                    ret = true;
                    break;
                }
            }
        }
    }

    widgetList.push_back(static_self_cast<UIWidget>());

    if(!isPhantom())
        ret = true;
    return ret;
}
Exemplo n.º 2
0
bool UIWidget::propagateOnMouseMove(const Point& mousePos, const Point& mouseMoved)
{
    // do a backup of children list, because it may change while looping it
    UIWidgetList children;
    for(const UIWidgetPtr& child : m_children) {
        // events on hidden or disabled widgets are discarded
        if(!child->isExplicitlyEnabled() || !child->isExplicitlyVisible())
            continue;

        // mouse move events go to all children
        children.push_back(child);
    }

    for(const UIWidgetPtr& child : children) {
        if(child->propagateOnMouseMove(mousePos, mouseMoved))
            return true;
    }

    if(!isPhantom())
        return onMouseMove(mousePos, mouseMoved);
    else
        return false;
}
LLSD LLPathfindingLinkset::encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const
{
	LLSD itemData;

	if (!isTerrain() && (pLinksetUse != kUnknown) && (getLinksetUse() != pLinksetUse) &&
		(canBeVolume() || ((pLinksetUse != kMaterialVolume) && (pLinksetUse != kExclusionVolume))))
	{
		if (isModifiable())
		{
			itemData[LINKSET_PHANTOM_FIELD] = static_cast<bool>(isPhantom(pLinksetUse));
		}

		itemData[LINKSET_CATEGORY_FIELD] = convertCategoryToLLSD(getNavMeshGenerationCategory(pLinksetUse));
	}

	if (mWalkabilityCoefficientA != pA)
	{
		itemData[LINKSET_WALKABILITY_A_FIELD] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
	}

	if (mWalkabilityCoefficientB != pB)
	{
		itemData[LINKSET_WALKABILITY_B_FIELD] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
	}

	if (mWalkabilityCoefficientC != pC)
	{
		itemData[LINKSET_WALKABILITY_C_FIELD] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
	}

	if (mWalkabilityCoefficientD != pD)
	{
		itemData[LINKSET_WALKABILITY_D_FIELD] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE);
	}

	return itemData;
}
Exemplo n.º 4
0
bool UIWidget::propagateOnMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direction)
{
    // do a backup of children list, because it may change while looping it
    UIWidgetList children;
    for(const UIWidgetPtr& child : m_children) {
        // events on hidden or disabled widgets are discarded
        if(!child->isExplicitlyEnabled() || !child->isExplicitlyVisible())
            continue;

        // mouse wheel events only go to children that contains the mouse position
        if(child->containsPoint(mousePos) && child == getChildByPos(mousePos))
            children.push_back(child);
    }

    for(const UIWidgetPtr& child : children) {
        if(child->propagateOnMouseWheel(mousePos, direction))
            return true;
    }

    if(!isPhantom())
        return onMouseWheel(mousePos, direction);
    else
        return false;
}
Exemplo n.º 5
0
bool UIWidget::propagateOnMousePress(const Point& mousePos, Fw::MouseButton button)
{
    // do a backup of children list, because it may change while looping it
    UIWidgetPtr clickedChild;
    for(const UIWidgetPtr& child : m_children) {
        // events on hidden or disabled widgets are discarded
        if(!child->isExplicitlyEnabled() || !child->isExplicitlyVisible())
            continue;

        // mouse press events only go to children that contains the mouse position
        if(child->containsPoint(mousePos) && child == getChildByPos(mousePos)) {
            clickedChild = child;
            break;
        }
    }

    if(clickedChild) {
        // focusable child gains focus when clicked
        if(clickedChild->isFocusable())
            focusChild(clickedChild, Fw::MouseFocusReason);

        // stop propagating if the child accept the event
        if(clickedChild->propagateOnMousePress(mousePos, button))
            return true;
    }

    // only non phatom widgets receives mouse press events
    if(!isPhantom()) {
        bool ret = onMousePress(mousePos, button);
        if(button == Fw::MouseLeftButton && !isPressed())
            setPressed(true);
        return ret;
    }

    return false;
}
bool LLPathfindingLinkset::isShowPhantomToggleWarning(ELinksetUse pLinksetUse) const
{
	return (isModifiable() && (isPhantom() != isPhantom(pLinksetUse)));
}
BOOL LLPathfindingLinkset::isPhantom() const
{
	return isPhantom(getLinksetUse());
}