button
is a node to define a button with a random size. It is skinned with a special image template (see the image
property).
More...
#include "../ui_main.h"
#include "../ui_actions.h"
#include "../ui_parse.h"
#include "../ui_font.h"
#include "../ui_render.h"
#include "../ui_icon.h"
#include "ui_node_button.h"
#include "ui_node_custombutton.h"
#include "ui_node_abstractnode.h"
#include "ui_node_panel.h"
#include "../../client.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE buttonExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
#define | TILE_SIZE 64 |
#define | CORNER_SIZE 17 |
#define | MID_SIZE 1 |
#define | MARGE 3 |
Functions | |
static void | UI_ButtonNodeClick (uiNode_t *node, int x, int y) |
Handles Button clicks. | |
static void | UI_ButtonNodeDraw (uiNode_t *node) |
Handles Button draw. | |
static void | UI_ButtonNodeLoading (uiNode_t *node) |
Handles Button before loading. Used to set default attribute values. | |
static void | UI_ButtonNodeLoaded (uiNode_t *node) |
Handled after the end of the load of the node from script (all data and/or child are set). | |
void | UI_RegisterButtonNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t | properties [] |
button
is a node to define a button with a random size. It is skinned with a special image template (see the image
property).
add an icon if possible.
implement clicked button when its possible.
allow auto size (use the size need looking string, problem when we change language)
Definition in file ui_node_button.c.
#define CORNER_SIZE 17 |
Definition at line 48 of file ui_node_button.c.
Referenced by UI_ButtonNodeDraw(), UI_ButtonNodeLoaded(), UI_KeyBindingNodeDraw(), UI_OptionListNodeDraw(), UI_OptionTreeNodeDraw(), UI_PanelNodeDraw(), UI_PanelNodeLoaded(), and UI_TextEntryNodeDraw().
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 42 of file ui_node_button.c.
#define EXTRADATA_TYPE buttonExtraData_t |
Definition at line 41 of file ui_node_button.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 43 of file ui_node_button.c.
#define MARGE 3 |
Definition at line 50 of file ui_node_button.c.
Referenced by UI_ButtonNodeDraw(), UI_KeyBindingNodeDraw(), UI_OptionListNodeDraw(), UI_OptionTreeNodeDraw(), UI_PanelNodeDraw(), and UI_TextEntryNodeDraw().
#define MID_SIZE 1 |
Definition at line 49 of file ui_node_button.c.
Referenced by UI_ButtonNodeDraw(), UI_ButtonNodeLoaded(), UI_KeyBindingNodeDraw(), UI_OptionListNodeDraw(), UI_OptionTreeNodeDraw(), UI_PanelNodeDraw(), UI_PanelNodeLoaded(), and UI_TextEntryNodeDraw().
#define TILE_SIZE 64 |
Definition at line 47 of file ui_node_button.c.
Referenced by UI_ButtonNodeDraw(), UI_KeyBindingNodeDraw(), UI_SpinnerNodeDraw(), UI_TabNodeDrawJunction(), UI_TabNodeDrawPlain(), and UI_TextEntryNodeDraw().
static void UI_ButtonNodeClick | ( | uiNode_t * | node, | |
int | x, | |||
int | y | |||
) | [static] |
Handles Button clicks.
Definition at line 55 of file ui_node_button.c.
References uiNode_s::onClick, and UI_ExecuteEventActions().
Referenced by UI_RegisterButtonNode().
static void UI_ButtonNodeDraw | ( | uiNode_t * | node | ) | [static] |
Handles Button draw.
Definition at line 65 of file ui_node_button.c.
References _, uiNode_s::color, CORNER_SIZE, uiNode_s::disabled, EXTRADATA, ICON_STATUS_DISABLED, ICON_STATUS_HOVER, ICON_STATUS_NORMAL, uiNode_s::image, LONGLINES_PRETTYCHOP, MARGE, MID_SIZE, uiNode_s::onClick, uiNode_s::padding, pos, R_Color(), uiNode_s::selectedColor, uiNode_s::size, uiNode_s::state, uiNode_s::text, uiNode_s::textalign, TILE_SIZE, UI_DrawIconInBox(), UI_DrawPanel(), UI_DrawStringInBox(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), and UI_GetReferenceString().
Referenced by UI_RegisterButtonNode().
static void UI_ButtonNodeLoaded | ( | uiNode_t * | node | ) | [static] |
Handled after the end of the load of the node from script (all data and/or child are set).
Definition at line 142 of file ui_node_button.c.
References Com_DPrintf(), CORNER_SIZE, DEBUG_CLIENT, MID_SIZE, uiNode_s::padding, uiNode_s::size, UI_FontGetHeight(), UI_GetFontFromNode(), and UI_GetPath().
Referenced by UI_RegisterButtonNode().
static void UI_ButtonNodeLoading | ( | uiNode_t * | node | ) | [static] |
Handles Button before loading. Used to set default attribute values.
Definition at line 131 of file ui_node_button.c.
References ALIGN_CC, uiNode_s::color, uiNode_s::padding, uiNode_s::selectedColor, uiNode_s::textalign, and Vector4Set.
Referenced by UI_RegisterButtonNode().
void UI_RegisterButtonNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 172 of file ui_node_button.c.
References uiBehaviour_s::draw, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::leftClick, uiBehaviour_s::loaded, uiBehaviour_s::loading, uiBehaviour_s::name, uiBehaviour_s::properties, UI_ButtonNodeClick(), UI_ButtonNodeDraw(), UI_ButtonNodeLoaded(), and UI_ButtonNodeLoading().
const value_t properties[] [static] |
{ {"icon", V_UI_ICONREF, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, icon), MEMBER_SIZEOF(EXTRADATA_TYPE, icon)}, {NULL, V_NULL, 0, 0} }
Definition at line 155 of file ui_node_button.c.