#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_actions.h"
#include "../ui_font.h"
#include "../ui_data.h"
#include "../ui_icon.h"
#include "../ui_render.h"
#include "ui_node_abstractoption.h"
#include "ui_node_abstractnode.h"
#include "ui_node_optiontree.h"
#include "ui_node_option.h"
#include "ui_node_panel.h"
#include "../../client.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA(node) UI_EXTRADATA(node, abstractOptionExtraData_t) |
#define | CORNER_SIZE 25 |
#define | MID_SIZE 1 |
#define | MARGE 3 |
Functions | |
static void | UI_OptionTreeNodeUpdateScroll (uiNode_t *node) |
Update the scroll according to the number of items and the size of the node. | |
static uiNode_t * | UI_OptionTreeNodeGetFirstOption (uiNode_t *node) |
Return the first option of the node. | |
static void | UI_OptionTreeNodeUpdateCache (uiNode_t *node) |
static void | UI_OptionTreeNodeDraw (uiNode_t *node) |
static uiNode_t * | UI_OptionTreeNodeGetOptionAtPosition (uiNode_t *node, int x, int y, int *depth) |
static void | UI_OptionTreeNodeClick (uiNode_t *node, int x, int y) |
Handles selectboxes clicks. | |
static void | UI_OptionTreeNodeMouseWheel (uiNode_t *node, qboolean down, int x, int y) |
Auto scroll the list. | |
static void | UI_OptionTreeNodeLoading (uiNode_t *node) |
Called before loading. Used to set default attribute values. | |
static void | UI_OptionTreeNodeLoaded (uiNode_t *node) |
static void | UI_OptionTreeSetSelectedValue (uiNode_t *node, const uiCallContext_t *context) |
void | UI_RegisterOptionTreeNode (uiBehaviour_t *behaviour) |
Variables | |
static const int | COLLAPSEBUTTON_WIDTH = 20 |
static const int | DEPTH_WIDTH = 25 |
static uiIcon_t * | systemCollapse |
static uiIcon_t * | systemExpand |
static const value_t | properties [] |
Definition in file ui_node_optiontree.c.
#define CORNER_SIZE 25 |
Definition at line 43 of file ui_node_optiontree.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, abstractOptionExtraData_t) |
Definition at line 41 of file ui_node_optiontree.c.
#define MARGE 3 |
Definition at line 45 of file ui_node_optiontree.c.
#define MID_SIZE 1 |
Definition at line 44 of file ui_node_optiontree.c.
static void UI_OptionTreeNodeClick | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Handles selectboxes clicks.
Definition at line 242 of file ui_node_optiontree.c.
References COLLAPSEBUTTON_WIDTH, DEPTH_WIDTH, uiNode_s::firstChild, OPTIONEXTRADATA, UI_AbstractOptionGetCurrentValue(), UI_AbstractOptionSetCurrentValue(), UI_NodeAbsoluteToRelativePos(), UI_OptionTreeNodeGetOptionAtPosition(), and UI_OptionTreeNodeUpdateCache().
Referenced by UI_RegisterOptionTreeNode().
static void UI_OptionTreeNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 106 of file ui_node_optiontree.c.
References _, ALIGN_UL, COLLAPSEBUTTON_WIDTH, uiNode_s::color, CORNER_SIZE, count, DEPTH_WIDTH, uiOptionIterator_t::depthPos, uiNode_s::disabled, EXTRADATA, uiNode_s::firstChild, ICON_STATUS_DISABLED, ICON_STATUS_NORMAL, uiNode_s::image, uiIcon_s::image, LONGLINES_PRETTYCHOP, MARGE, MID_SIZE, OPTIONEXTRADATA, uiNode_s::padding, pos, qfalse, R_Color(), uiNode_s::selectedColor, uiIcon_s::size, uiNode_s::size, UI_AbstractOptionGetCurrentValue(), UI_DrawFill(), UI_DrawIconInBox(), UI_DrawPanel(), UI_DrawString(), UI_FontGetHeight(), UI_GetFontFromNode(), UI_GetIconByName(), UI_GetNodeAbsPos(), UI_GetReferenceString(), UI_InitOptionIteratorAtIndex(), UI_OptionIteratorNextOption(), UI_OptionTreeNodeGetFirstOption(), and UI_OptionTreeNodeUpdateScroll().
Referenced by UI_RegisterOptionTreeNode().
Return the first option of the node.
FIXME it MUST be an option behaviour
Definition at line 89 of file ui_node_optiontree.c.
References uiNode_s::behaviour, EXTRADATA, uiNode_s::firstChild, UI_GetDataVersion(), UI_GetOption(), ui_optionBehaviour, and UI_OptionTreeNodeUpdateCache().
Referenced by UI_OptionTreeNodeDraw(), UI_OptionTreeNodeGetOptionAtPosition(), UI_OptionTreeNodeUpdateCache(), and UI_OptionTreeSetSelectedValue().
static uiNode_t* UI_OptionTreeNodeGetOptionAtPosition | ( | uiNode_t * | node, | |
int | x, | |||
int | y, | |||
int * | depth | |||
) | [static] |
Definition at line 217 of file ui_node_optiontree.c.
References count, uiOptionIterator_t::depthPos, EXTRADATA, uiNode_s::padding, UI_FontGetHeight(), UI_GetFontFromNode(), UI_InitOptionIteratorAtIndex(), UI_NodeAbsoluteToRelativePos(), and UI_OptionTreeNodeGetFirstOption().
Referenced by UI_OptionTreeNodeClick().
static void UI_OptionTreeNodeLoaded | ( | uiNode_t * | node | ) | [static] |
Definition at line 298 of file ui_node_optiontree.c.
Referenced by UI_RegisterOptionTreeNode().
static void UI_OptionTreeNodeLoading | ( | uiNode_t * | node | ) | [static] |
Called before loading. Used to set default attribute values.
Definition at line 291 of file ui_node_optiontree.c.
References uiNode_s::color, EXTRADATA, uiNode_s::padding, and Vector4Set.
Referenced by UI_RegisterOptionTreeNode().
Auto scroll the list.
Definition at line 273 of file ui_node_optiontree.c.
References EXTRADATA, uiNode_s::onWheel, uiNode_s::onWheelDown, uiNode_s::onWheelUp, UI_ExecuteEventActions(), and UI_SetScroll().
Referenced by UI_RegisterOptionTreeNode().
static void UI_OptionTreeNodeUpdateCache | ( | uiNode_t * | node | ) | [static] |
Definition at line 78 of file ui_node_optiontree.c.
References EXTRADATA, UI_OptionTreeNodeGetFirstOption(), and UI_OptionUpdateCache().
Referenced by UI_OptionTreeNodeClick(), UI_OptionTreeNodeGetFirstOption(), and UI_OptionTreeSetSelectedValue().
static void UI_OptionTreeNodeUpdateScroll | ( | uiNode_t * | node | ) | [static] |
Update the scroll according to the number of items and the size of the node.
Definition at line 57 of file ui_node_optiontree.c.
References count, EXTRADATA, uiNode_s::padding, uiNode_s::size, UI_ExecuteEventActions(), UI_FontGetHeight(), UI_GetFontFromNode(), and UI_SetScroll().
Referenced by UI_OptionTreeNodeDraw(), and UI_OptionTreeSetSelectedValue().
static void UI_OptionTreeSetSelectedValue | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 302 of file ui_node_optiontree.c.
References Com_Printf(), uiOptionIterator_t::depthCache, uiOptionIterator_t::depthPos, EXTRADATA, i, OPTIONEXTRADATA, pos, qfalse, uiOptionIterator_t::skipCollapsed, UI_AbstractOptionSetCurrentValue(), UI_ExecuteEventActions(), UI_FindOptionByValue(), UI_FindOptionPosition(), UI_GetParam(), UI_GetParamNumber(), UI_InitOptionIteratorAtIndex(), UI_OptionTreeNodeGetFirstOption(), UI_OptionTreeNodeUpdateCache(), UI_OptionTreeNodeUpdateScroll(), and UI_SetScroll().
void UI_RegisterOptionTreeNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 359 of file ui_node_optiontree.c.
References uiBehaviour_s::draw, uiBehaviour_s::drawItselfChild, uiBehaviour_s::extends, uiBehaviour_s::leftClick, uiBehaviour_s::loaded, uiBehaviour_s::loading, uiBehaviour_s::mouseWheel, uiBehaviour_s::name, uiBehaviour_s::properties, qtrue, UI_OptionTreeNodeClick(), UI_OptionTreeNodeDraw(), UI_OptionTreeNodeLoaded(), UI_OptionTreeNodeLoading(), and UI_OptionTreeNodeMouseWheel().
const int COLLAPSEBUTTON_WIDTH = 20 [static] |
Size used for the collapse button
Definition at line 47 of file ui_node_optiontree.c.
Referenced by UI_OptionTreeNodeClick(), and UI_OptionTreeNodeDraw().
const int DEPTH_WIDTH = 25 [static] |
Width between each depth level
Definition at line 48 of file ui_node_optiontree.c.
Referenced by UI_OptionTreeNodeClick(), and UI_OptionTreeNodeDraw().
const value_t properties[] [static] |
{ {"setselectedvalue", V_UI_NODEMETHOD, ((size_t) UI_OptionTreeSetSelectedValue), 0}, {NULL, V_NULL, 0, 0} }
Definition at line 352 of file ui_node_optiontree.c.
uiIcon_t* systemCollapse [static] |
Definition at line 50 of file ui_node_optiontree.c.
uiIcon_t* systemExpand [static] |
Definition at line 51 of file ui_node_optiontree.c.