UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_optiontree.cpp File Reference
#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_actions.h"
#include "../ui_font.h"
#include "../ui_data.h"
#include "../ui_sprite.h"
#include "../ui_render.h"
#include "../ui_input.h"
#include "../ui_lua.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 "../../cl_language.h"
#include "../../input/cl_keys.h"
#include "../../../common/scripts_lua.h"

Go to the source code of this file.

Macros

#define EXTRADATA_TYPE   abstractOptionExtraData_t
 
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)
 

Functions

static void UI_OptionTreeNodeUpdateScroll (uiNode_t *node)
 Update the scroll according to the number of items and the size of the node. More...
 
static uiNode_tUI_OptionTreeNodeGetFirstOption (uiNode_t *node)
 Return the first option of the node. More...
 
static void UI_OptionTreeNodeUpdateCache (uiNode_t *node)
 
static uiNode_tUI_OptionTreeNodeGetOptionAtPosition (uiNode_t *node, int x, int y, int *depth)
 
void UI_OptionTree_SelectValue (uiNode_t *node, const char *value)
 
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 uiSprite_tsystemCollapse
 
static uiSprite_tsystemExpand
 
static int mouseScrollX
 
static int mouseScrollY
 

Detailed Description

Todo:
manage disabled option

Definition in file ui_node_optiontree.cpp.

Macro Definition Documentation

#define EXTRADATA_TYPE   abstractOptionExtraData_t

Definition at line 48 of file ui_node_optiontree.cpp.

Referenced by UI_RegisterOptionTreeNode().

Function Documentation

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
Todo:
FIXME it MUST be an option behaviour

Definition at line 103 of file ui_node_optiontree.cpp.

References uiNode_t::behaviour, EXTRADATA, uiNode_t::firstChild, UI_GetDataVersion(), UI_GetOption(), ui_optionBehaviour, UI_OptionTreeNodeUpdateCache(), and v.

Referenced by uiOptionTreeNode::draw(), UI_OptionTree_SelectValue(), UI_OptionTreeNodeGetOptionAtPosition(), and UI_OptionTreeNodeUpdateCache().

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 65 of file ui_node_optiontree.cpp.

References uiNode_t::box, count, EXTRADATA, uiNode_t::padding, uiBox_t::size, UI_ExecuteEventActions(), UI_ExecuteLuaEventScript(), UI_FontGetHeight(), and UI_GetFontFromNode().

Referenced by uiOptionTreeNode::draw(), and UI_OptionTree_SelectValue().

static void UI_OptionTreeSetSelectedValue ( uiNode_t node,
const uiCallContext_t context 
)
static

Variable Documentation

const int COLLAPSEBUTTON_WIDTH = 20
static

Size used for the collapse button

Definition at line 51 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw(), and uiOptionTreeNode::onLeftClick().

const int DEPTH_WIDTH = 25
static

Width between each depth level

Definition at line 52 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw(), and uiOptionTreeNode::onLeftClick().

int mouseScrollX
static
int mouseScrollY
static
uiSprite_t* systemCollapse
static

Definition at line 54 of file ui_node_optiontree.cpp.

Referenced by uiOptionTreeNode::draw().

uiSprite_t* systemExpand
static

Definition at line 55 of file ui_node_optiontree.cpp.