The radiobutton is a clickable widget. Commonly, with use it in a group of radiobuttons; the user is allowed to choose only one button from this set. The current implementation share the value of the group with a cvar, and each button use is own value. When the cvar equals to a button value, this button is selected. More...
#include "../ui_main.h"
#include "../ui_actions.h"
#include "../ui_icon.h"
#include "../ui_parse.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "ui_node_radiobutton.h"
#include "ui_node_abstractnode.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE radioButtonExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
#define | EPSILON 0.001f |
#define | UI_4STATUS_TEX_HEIGHT 64 |
Functions | |
static void | UI_RadioButtonNodeDraw (uiNode_t *node) |
Handles RadioButton draw. | |
static void | UI_RadioButtonNodeActivate (uiNode_t *node) |
Activate the node. Can be used without the mouse (ie. a button will execute onClick). | |
static void | UI_RadioButtonNodeClick (uiNode_t *node, int x, int y) |
Handles radio button clicks. | |
void | UI_RegisterRadioButtonNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
The radiobutton is a clickable widget. Commonly, with use it in a group of radiobuttons; the user is allowed to choose only one button from this set. The current implementation share the value of the group with a cvar, and each button use is own value. When the cvar equals to a button value, this button is selected.
radiobutton foo {
cvar "*cvar:mn_serverday"
value 4
icon boo
}
Definition in file ui_node_radiobutton.c.
#define EPSILON 0.001f |
Definition at line 50 of file ui_node_radiobutton.c.
Referenced by UI_RadioButtonNodeActivate(), and UI_RadioButtonNodeDraw().
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 47 of file ui_node_radiobutton.c.
#define EXTRADATA_TYPE radioButtonExtraData_t |
Definition at line 46 of file ui_node_radiobutton.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 48 of file ui_node_radiobutton.c.
#define UI_4STATUS_TEX_HEIGHT 64 |
Height of a status in a 4 status 256*256 texture
Definition at line 53 of file ui_node_radiobutton.c.
Referenced by UI_RadioButtonNodeDraw().
static void UI_RadioButtonNodeActivate | ( | uiNode_t * | node | ) | [static] |
Activate the node. Can be used without the mouse (ie. a button will execute onClick).
Definition at line 99 of file ui_node_radiobutton.c.
References Com_Printf(), EPSILON, EXTRADATA, uiNode_s::onChange, UI_ExecuteEventActions(), UI_GetPath(), UI_GetReferenceFloat(), and UI_SetCvar().
Referenced by UI_RadioButtonNodeClick(), and UI_RegisterRadioButtonNode().
static void UI_RadioButtonNodeClick | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Handles radio button clicks.
Definition at line 130 of file ui_node_radiobutton.c.
References uiNode_s::onClick, UI_ExecuteEventActions(), and UI_RadioButtonNodeActivate().
Referenced by UI_RegisterRadioButtonNode().
static void UI_RadioButtonNodeDraw | ( | uiNode_t * | node | ) | [static] |
Handles RadioButton draw.
Definition at line 59 of file ui_node_radiobutton.c.
References uiNode_s::disabled, EPSILON, EXTRADATA, ICON_STATUS_CLICKED, ICON_STATUS_DISABLED, ICON_STATUS_HOVER, ICON_STATUS_NORMAL, uiNode_s::image, uiNode_s::parent, pos, uiNode_s::size, uiNode_s::state, UI_4STATUS_TEX_HEIGHT, UI_DrawIconInBox(), UI_DrawNormImageByName(), UI_GetNodeAbsPos(), UI_GetReferenceFloat(), and UI_GetReferenceString().
Referenced by UI_RegisterRadioButtonNode().
void UI_RegisterRadioButtonNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 149 of file ui_node_radiobutton.c.
References uiBehaviour_s::activate, uiBehaviour_s::draw, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::leftClick, uiBehaviour_s::name, uiBehaviour_s::properties, UI_RadioButtonNodeActivate(), UI_RadioButtonNodeClick(), and UI_RadioButtonNodeDraw().
const value_t properties[] [static] |
{ {"value", V_FLOAT, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, value), MEMBER_SIZEOF(EXTRADATA_TYPE, value)}, {"cvar", V_UI_CVAR, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, cvar), 0}, {"icon", V_UI_ICONREF, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, icon), MEMBER_SIZEOF(EXTRADATA_TYPE, icon)}, {NULL, V_NULL, 0, 0} }
Definition at line 138 of file ui_node_radiobutton.c.