50#define EXTRADATA_TYPE checkboxExtraData_t
51#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
63 }
else if (node->
state) {
72 }
else if (value > 0) {
102 float value = (last > 0) ? 0 : 1;
167 return ((
int)(b->
getValue(node)) != 0);
172 return (
int)(b->
getValue(node) != 0 ? 1 : 0);
177 behaviour->
name =
"checkbox";
178 behaviour->
extends =
"abstractvalue";
float getValue(uiNode_t const *node)
void onLoading(uiNode_t *node) override
bool setValue(uiNode_t *node, float value)
void setRange(uiNode_t *node, float min, float max)
void onActivate(uiNode_t *node) override
Activate the node. Can be used without the mouse (ie. a button will execute onClick).
void toggle(uiNode_t *node)
void onLeftClick(uiNode_t *node, int x, int y) override
Handles checkboxes clicks.
void draw(uiNode_t *node) override
void onLoading(uiNode_t *node) override
Handled before the begin of the load of the node from the script.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Header for lua script functions.
node behaviour, how a node work
Contain the context of the calling of a function.
Atomic structure used to define most of the UI.
uiBehaviour_t * behaviour
struct uiAction_s * onClick
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
const struct value_s * UI_RegisterNodeMethod(uiBehaviour_t *behaviour, const char *name, uiNodeMethod_t function)
Register a node method to a behaviour.
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
bool UI_ExecuteLuaEventScript_XY(uiNode_t *node, LUA_EVENT event, int x, int y)
Executes a lua event handler with (x,y) argument.
Basic lua initialization for the ui.
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_Node_Activate(uiNode_t *node)
void UI_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
SharedPtr< uiNode > UINodePtr
Define common thing for GUI controls which allow to edit a value (scroolbar, spinner,...
int UI_CheckBox_ValueAsInteger(uiNode_t *node)
void UI_CheckBox_Toggle(uiNode_t *node)
void UI_RegisterCheckBoxNode(uiBehaviour_t *behaviour)
void UI_CheckBox_SetIconUnknownByName(uiNode_t *node, const char *name)
void UI_CheckBox_SetIconCheckedByName(uiNode_t *node, const char *name)
bool UI_CheckBox_ValueAsBoolean(uiNode_t *node)
void UI_CheckBox_SetBackgroundByName(uiNode_t *node, const char *name)
void UI_CheckBox_SetIconUncheckedByName(uiNode_t *node, const char *name)
static void UI_CheckBoxNodeCallActivate(uiNode_t *node, const uiCallContext_t *context)
#define UI_EXTRADATA(NODE, TYPE)
void UI_PlaySound(const char *soundFile)
Plays a ui sound.
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.