/** * @brief Return the first visible node at a position */ uiNode_t *UI_GetNodeAtPosition (int x, int y) { int pos; /* find the first window under the mouse */ for (pos = ui_global.windowStackPos - 1; pos >= 0; pos--) { uiNode_t *window = ui_global.windowStack[pos]; uiNode_t *find; /* update the layout */ UI_Validate(window); find = UI_GetNodeInTreeAtPosition(window, x, y); if (find) return find; /* we must not search anymore */ if (UI_WindowIsDropDown(window)) break; if (UI_WindowIsModal(window)) break; if (UI_WindowIsFullScreen(window)) break; } return NULL; }
static void UI_OptionDoLayout (uiNode_t *node) { uiNode_t *child = node->firstChild; int count = 0; while(child && child->behaviour == ui_optionBehaviour) { UI_Validate(child); if (!child->invis) { if (EXTRADATA(child).collapsed) count += 1 + EXTRADATA(child).childCount; else count += 1; } child = child->next; } EXTRADATA(node).childCount = count; node->invalidated = qfalse; }
void uiAbstractOptionNode::doLayout (uiNode_t *node) { uiNode_t *option = node->firstChild; if (EXTRADATA(node).dataId == 0) { int count = 0; while (option && option->behaviour == ui_optionBehaviour) { UI_Validate(option); if (!option->invis) count++; option = option->next; } EXTRADATA(node).count = count; } node->invalidated = false; }