Esempio n. 1
0
/**
 * @brief force edition of a textentry node
 * @note the textentry must be on the active window
 */
static void UI_TextEntryNodeFocus (uiNode_t *node, const uiCallContext_t *context)
{
    /* remove the focus to show changes */
    if (!UI_HasFocus(node)) {
        UI_RequestFocus(node);
    }
}
Esempio n. 2
0
/**
 * @brief Called when the user click with the right mouse button
 */
static void UI_TextEntryNodeClick (uiNode_t *node, int x, int y)
{
    if (node->disabled)
        return;

    /* no cvar */
    if (!node->text)
        return;
    if (!Q_strstart(node->text, "*cvar"))
        return;

    if (!UI_HasFocus(node)) {
        if (node->onClick) {
            UI_ExecuteEventActions(node, node->onClick);
        }
        UI_RequestFocus(node);
    }
}
Esempio n. 3
0
/**
 * @brief Called when the user click with the right mouse button
 */
static void UI_KeyBindingNodeClick (uiNode_t *node, int x, int y)
{
	if (node->disabled)
		return;

	/* no binding given */
	if (!node->text)
		return;

	if (!Q_strstart(node->text, "*binding"))
		return;

	if (!UI_HasFocus(node)) {
		if (node->onClick)
			UI_ExecuteEventActions(node, node->onClick);
		UI_RequestFocus(node);
	}
}
Esempio n. 4
0
/**
 * @brief Called when the user click with the right mouse button
 */
void uiTextEntryNode::onLeftClick (uiNode_t* node, int x, int y)
{
	if (node->disabled)
		return;

	/* no cvar */
	if (!node->text)
		return;
	if (!Q_strstart(node->text, "*cvar:"))
		return;

	if (!UI_HasFocus(node)) {
		if (node->onClick) {
			UI_ExecuteEventActions(node, node->onClick);
		}
		if (node->lua_onClick != LUA_NOREF) {
			UI_ExecuteLuaEventScript_XY(node, node->lua_onClick, x, y);
		}
		UI_RequestFocus(node);
	}
}