The bar node display a graphical horizontal slider. We can use it to allow the user to select a value in a range. Or we can use it do only display a value (in this case, you must disable it). More...
#include "../ui_nodes.h"
#include "../ui_parse.h"
#include "../ui_main.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "../ui_actions.h"
#include "ui_node_bar.h"
#include "ui_node_abstractvalue.h"
#include "ui_node_abstractnode.h"
#include "../../input/cl_keys.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE barExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
Functions | |
static void | UI_BarNodeDraw (uiNode_t *node) |
static void | UI_BarNodeCapturedMouseMove (uiNode_t *node, int x, int y) |
Called when the node is captured by the mouse. | |
static void | UI_BarNodeMouseDown (uiNode_t *node, int x, int y, int button) |
static void | UI_BarNodeMouseUp (uiNode_t *node, int x, int y, int button) |
static void | UI_BarNodeLoading (uiNode_t *node) |
Called before loading. Used to set default attribute values. | |
void | UI_RegisterBarNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
Valid properties for a bar node. |
The bar node display a graphical horizontal slider. We can use it to allow the user to select a value in a range. Or we can use it do only display a value (in this case, you must disable it).
Definition in file ui_node_bar.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 41 of file ui_node_bar.c.
#define EXTRADATA_TYPE barExtraData_t |
Definition at line 40 of file ui_node_bar.c.
static void UI_BarNodeCapturedMouseMove | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Called when the node is captured by the mouse.
Definition at line 90 of file ui_node_bar.c.
References ALIGN_CL, ALIGN_CR, ALIGN_LC, ALIGN_UC, Com_Printf(), EXTRADATA, MAX_VAR, uiNode_s::onChange, pos, Q_strncpyz(), uiNode_s::size, uiBehaviour_s::super, UI_ExecuteEventActions(), UI_GetNodeAbsPos(), UI_GetReferenceFloat(), UI_NodeAbsoluteToRelativePos(), and UI_SetCvar().
Referenced by UI_BarNodeMouseDown(), and UI_RegisterBarNode().
static void UI_BarNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 43 of file ui_node_bar.c.
References ALIGN_CL, ALIGN_CR, ALIGN_LC, ALIGN_UC, uiNode_s::color, Com_Printf(), EXTRADATA, uiNode_s::size, uiNode_s::state, uiBehaviour_s::super, UI_DrawFill(), UI_GetNodeAbsPos(), UI_GetReferenceFloat(), Vector4Copy, and VectorScale.
Referenced by UI_RegisterBarNode().
static void UI_BarNodeLoading | ( | uiNode_t * | node | ) | [static] |
Called before loading. Used to set default attribute values.
Definition at line 160 of file ui_node_bar.c.
References ALIGN_CR, uiNode_s::color, EXTRADATA, and Vector4Set.
Referenced by UI_RegisterBarNode().
static void UI_BarNodeMouseDown | ( | uiNode_t * | node, | |
int | x, | |||
int | y, | |||
int | button | |||
) | [static] |
Definition at line 140 of file ui_node_bar.c.
References uiNode_s::disabled, EXTRADATA, K_MOUSE1, UI_BarNodeCapturedMouseMove(), and UI_SetMouseCapture().
Referenced by UI_RegisterBarNode().
static void UI_BarNodeMouseUp | ( | uiNode_t * | node, | |
int | x, | |||
int | y, | |||
int | button | |||
) | [static] |
Definition at line 151 of file ui_node_bar.c.
References K_MOUSE1, and UI_MouseRelease().
Referenced by UI_RegisterBarNode().
void UI_RegisterBarNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 182 of file ui_node_bar.c.
References uiBehaviour_s::capturedMouseMove, uiBehaviour_s::draw, uiBehaviour_s::extends, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::loading, uiBehaviour_s::mouseDown, uiBehaviour_s::mouseUp, uiBehaviour_s::name, uiBehaviour_s::properties, UI_BarNodeCapturedMouseMove(), UI_BarNodeDraw(), UI_BarNodeLoading(), UI_BarNodeMouseDown(), and UI_BarNodeMouseUp().
const value_t properties[] [static] |
{ {"direction", V_UI_ALIGN, UI_EXTRADATA_OFFSETOF(barExtraData_t, orientation), MEMBER_SIZEOF(barExtraData_t, orientation)}, {"readonly", V_BOOL, UI_EXTRADATA_OFFSETOF(barExtraData_t, readOnly), MEMBER_SIZEOF(barExtraData_t, readOnly)}, {NULL, V_NULL, 0, 0} }
Valid properties for a bar node.
Definition at line 169 of file ui_node_bar.c.