void uiLocatedNode::onMiddleClick (uiNode_t* node, int x, int y) { if (node->onMiddleClick != nullptr) { UI_ExecuteEventActions(node, node->onMiddleClick); UI_PlaySound("click1"); } else if (node->lua_onMiddleClick != LUA_NOREF) { UI_ExecuteLuaEventScript_XY(node, node->lua_onMiddleClick, x, y); UI_PlaySound("click1"); } }
void uiLocatedNode::onMiddleClick (uiNode_t* node, int x, int y) { if (node->onMiddleClick != nullptr) { UI_ExecuteEventActions(node, node->onMiddleClick); UI_PlaySound("click1"); } }
/** * @brief Handles checkboxes clicks */ void uiCheckBoxNode::onLeftClick (uiNode_t * node, int x, int y) { if (node->onClick) UI_ExecuteEventActions(node, node->onClick); UI_PlaySound("click1"); onActivate(node); }
void uiLocatedNode::onRightClick(uiNode_t* node, int x, int y) { if (node->onRightClick != NULL) { UI_ExecuteEventActions(node, node->onRightClick); UI_PlaySound("click1"); } }
/** * @brief Private function to initialize a the start of a DND * @sa UI_DNDDragItem * @sa UI_DNDDrop * @sa UI_DNDAbort */ static void UI_DNDDrag (uiNode_t* node) { assert(!UI_DNDIsDragging()); objectType = DND_SOMETHING; sourceNode = node; UI_PlaySound("item-drag"); }
/** * @brief Handles tab clicks */ void uiTabNode::onLeftClick (uiNode_t * node, int x, int y) { uiNode_t* option; if (UI_AbstractOptionGetCurrentValue(node) == NULL) return; option = UI_TabNodeTabAtPosition(node, x, y); if (option == NULL) return; if (option->disabled) return; /* only execute the click stuff if the selectbox is active */ if (node->state) UI_AbstractOptionSetCurrentValue(node, OPTIONEXTRADATA(option).value); UI_PlaySound("click1"); }
/** * @brief Drop the object at the current position * @sa UI_DNDStartDrag * @sa UI_DNDAbort */ void UI_DNDDrop (void) { bool result = false; assert(UI_DNDIsDragging()); assert(objectType != DND_NOTHING); assert(sourceNode != nullptr); if (!positionAcceptDND) { UI_DNDAbort(); return; } if (targetNode) { result = UI_Node_DndDrop(targetNode, mousePosX, mousePosY); } UI_Node_DndFinished(sourceNode, result); UI_PlaySound("item-drop"); UI_DNDCleanup(); UI_InvalidateMouse(); }