예제 #1
0
/**
 * @brief Handles selectboxes clicks
 */
void uiOptionListNode::onLeftClick (uiNode_t* node, int x, int y)
{
	uiNode_t* option;

	if (UI_AbstractOption_GetCurrentValue(node) == nullptr)
		return;

	/* select the right option */
	option = UI_OptionListNodeGetOptionAtPosition(node, x, y);

	/* update the status */
	if (option)
		UI_AbstractOption_SetCurrentValue(node, OPTIONEXTRADATA(option).value);
}
예제 #2
0
파일: ui_node_tab.cpp 프로젝트: yason/ufoai
/**
 * @brief Handles tab clicks
 */
void uiTabNode::onLeftClick (uiNode_t* node, int x, int y)
{
	uiNode_t* option;

	if (UI_AbstractOption_GetCurrentValue(node) == nullptr)
		return;

	option = UI_TabNodeTabAtPosition(node, x, y);
	if (option == nullptr)
		return;

	if (option->disabled)
		return;

	/* only execute the click stuff if the selectbox is active */
	if (node->state)
		UI_AbstractOption_SetCurrentValue(node, OPTIONEXTRADATA(option).value);

	UI_PlaySound("click1");
}