ui_node_button.c File Reference

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"
Include dependency graph for ui_node_button.c:

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

Detailed Description

button is a node to define a button with a random size. It is skinned with a special image template (see the image property).

Todo:

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 Documentation

#define CORNER_SIZE   17
#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
#define MID_SIZE   1
#define TILE_SIZE   64

Function Documentation

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

Variable Documentation

const value_t properties[] [static]
Initial value:

Definition at line 155 of file ui_node_button.c.


Generated by  doxygen 1.6.2