UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_radiobutton.cpp File Reference

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_sprite.h"
#include "../ui_parse.h"
#include "../ui_behaviour.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "../ui_lua.h"
#include "ui_node_radiobutton.h"
#include "ui_node_abstractnode.h"
#include "../../../common/scripts_lua.h"

Go to the source code of this file.

Macros

#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 bool UI_RadioButtonNodeIsSelected (uiNode_t *node)
 
void UI_RadioButton_SetValue (uiNode_t *node, const char *value)
 
void UI_RadioButton_SetValue (uiNode_t *node, float value)
 
void UI_RadioButton_SetBackgroundByName (uiNode_t *node, const char *name)
 
void UI_RadioButton_SetIconByName (uiNode_t *node, const char *name)
 
void UI_RegisterRadioButtonNode (uiBehaviour_t *behaviour)
 

Detailed Description

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:foobar"
value 4
icon boo
}

Definition in file ui_node_radiobutton.cpp.

Macro Definition Documentation

#define EPSILON   0.001f

Definition at line 55 of file ui_node_radiobutton.cpp.

Referenced by UI_RadioButtonNodeIsSelected().

#define EXTRADATA_TYPE   radioButtonExtraData_t

Definition at line 51 of file ui_node_radiobutton.cpp.

Referenced by UI_RegisterRadioButtonNode().

#define EXTRADATACONST (   node)    UI_EXTRADATACONST(node, EXTRADATA_TYPE)

Definition at line 53 of file ui_node_radiobutton.cpp.

#define UI_4STATUS_TEX_HEIGHT   64

Height of a status in a 4 status 256*256 texture

Definition at line 58 of file ui_node_radiobutton.cpp.

Referenced by uiRadioButtonNode::draw().

Function Documentation

void UI_RadioButton_SetBackgroundByName ( uiNode_t node,
const char *  name 
)

Definition at line 184 of file ui_node_radiobutton.cpp.

References EXTRADATA, and UI_GetSpriteByName().

Referenced by uiRadioButtonNode_t_set_background().

void UI_RadioButton_SetIconByName ( uiNode_t node,
const char *  name 
)

Definition at line 189 of file ui_node_radiobutton.cpp.

References EXTRADATA, and UI_GetSpriteByName().

Referenced by uiRadioButtonNode_t_set_icon().

void UI_RadioButton_SetValue ( uiNode_t node,
float  value 
)
static bool UI_RadioButtonNodeIsSelected ( uiNode_t node)
static