34 #include "../ui_nodes.h"
35 #include "../ui_parse.h"
36 #include "../ui_behaviour.h"
37 #include "../ui_main.h"
38 #include "../ui_actions.h"
39 #include "../ui_render.h"
40 #include "../ui_sound.h"
41 #include "../ui_sprite.h"
42 #include "../ui_lua.h"
48 #include "../../../common/scripts_lua.h"
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";
static void UI_CheckBoxNodeCallActivate(uiNode_t *node, const uiCallContext_t *context)
uiBehaviour_t * behaviour
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)
void UI_PlaySound(const char *soundFile)
Plays a ui sound.
Define common thing for GUI controls which allow to edit a value (scroolbar, spinner, and more)
void UI_CheckBox_Toggle(uiNode_t *node)
void UI_CheckBox_SetIconUncheckedByName(uiNode_t *node, const char *name)
void onLeftClick(uiNode_t *node, int x, int y) override
Handles checkboxes clicks.
int UI_CheckBox_ValueAsInteger(uiNode_t *node)
void UI_CheckBox_SetBackgroundByName(uiNode_t *node, const char *name)
struct uiAction_s * onClick
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
SharedPtr< uiNode > UINodePtr
void onLoading(uiNode_t *node) override
Handled before the begin of the load of the node from the script.
void UI_Node_Activate(uiNode_t *node)
void UI_CheckBox_SetIconUnknownByName(uiNode_t *node, const char *name)
#define UI_EXTRADATA(NODE, TYPE)
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
bool UI_ExecuteLuaEventScript_XY(uiNode_t *node, LUA_EVENT event, int x, int y)
Executes a lua event handler with (x,y) argument.
Atomic structure used to define most of 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_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
Contain the context of the calling of a function.
void UI_CheckBox_SetIconCheckedByName(uiNode_t *node, const char *name)
node behaviour, how a node work
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void onActivate(uiNode_t *node) override
Activate the node. Can be used without the mouse (ie. a button will execute onClick) ...
void UI_RegisterCheckBoxNode(uiBehaviour_t *behaviour)
bool setValue(uiNode_t *node, float value)
void draw(uiNode_t *node) override
void onLoading(uiNode_t *node) override
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.
float getValue(uiNode_t const *node)
bool UI_CheckBox_ValueAsBoolean(uiNode_t *node)
void setRange(uiNode_t *node, float min, float max)
const struct value_s * UI_RegisterNodeMethod(uiBehaviour_t *behaviour, const char *name, uiNodeMethod_t function)
Register a node method to a behaviour.
void toggle(uiNode_t *node)