ui_node_radiobutton.c 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_icon.h"
#include "../ui_parse.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "ui_node_radiobutton.h"
#include "ui_node_abstractnode.h"
Include dependency graph for ui_node_radiobutton.c:

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 []

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

Definition in file ui_node_radiobutton.c.


Define Documentation

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


Function Documentation

static void UI_RadioButtonNodeActivate ( uiNode_t node  )  [static]

Activate the node. Can be used without the mouse (ie. a button will execute onClick).

Todo:
the parser should already check that the property value is a right cvar

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]
void UI_RegisterRadioButtonNode ( uiBehaviour_t behaviour  ) 

Variable Documentation

const value_t properties[] [static]
Initial value:

Definition at line 138 of file ui_node_radiobutton.c.


Generated by  doxygen 1.6.2