ui_node_optiontree.c File Reference

#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"
Include dependency graph for ui_node_optiontree.c:

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_tUI_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_tUI_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_tsystemCollapse
static uiIcon_tsystemExpand
static const value_t properties []

Detailed Description

Todo:
manage disabled option

Definition in file ui_node_optiontree.c.


Define Documentation

#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.


Function Documentation

static void UI_OptionTreeNodeClick ( uiNode_t node,
int  x,
int  y 
) [static]
static void UI_OptionTreeNodeDraw ( uiNode_t node  )  [static]
static uiNode_t * UI_OptionTreeNodeGetFirstOption ( uiNode_t node  )  [static]

Return the first option of the node.

Todo:
we should remove this call loop
Todo:
check versionId and update cached data, and fire events

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]
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().

static void UI_OptionTreeNodeMouseWheel ( uiNode_t node,
qboolean  down,
int  x,
int  y 
) [static]
static void UI_OptionTreeNodeUpdateCache ( uiNode_t node  )  [static]
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]
void UI_RegisterOptionTreeNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

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]
Initial value:
 {
    
    {"setselectedvalue", V_UI_NODEMETHOD, ((size_t) UI_OptionTreeSetSelectedValue), 0},

    {NULL, V_NULL, 0, 0}
}

Definition at line 352 of file ui_node_optiontree.c.

Definition at line 50 of file ui_node_optiontree.c.

Definition at line 51 of file ui_node_optiontree.c.


Generated by  doxygen 1.6.2