#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_render.h"
#include "../ui_actions.h"
#include "ui_node_abstractnode.h"
#include "ui_node_panel.h"
#include "../../../common/scripts.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE panelExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | CORNER_SIZE 25 |
#define | MID_SIZE 1 |
#define | MARGE 3 |
Functions | |
static void | UI_PanelNodeDraw (uiNode_t *node) |
Handles Button draw. | |
static void | UI_TopDownFlowLayout (uiNode_t *node, int margin) |
Create a top-down flow layout with child of the node. Child position is automatically set, child height don't change and child width is set according to node width and padding. | |
static void | UI_BorderLayout (uiNode_t *node, int margin) |
Create a border layout with child of the node. Child with BORDERLAYOUT_TOP and BORDERLAYOUT_BOTTOM num are first positioned, there height do not change but the width fill the parent node. Then child with BORDERLAYOUT_LEFT and BORDERLAYOUT_RIGHT are positioned between positioned nodes. Finally BORDERLAYOUT_MIDDLE is filled into available free space. | |
static void | UI_PackLayout (uiNode_t *node, int margin) |
Create a pack layout with child of the node. Set position and size of nodes one by one. It is a usefull layout manager because it can create nice layout without sub panel. | |
void | UI_StarLayout (uiNode_t *node) |
Do a star layout with child according to there num. | |
static void | UI_ClientLayout (uiNode_t *node) |
static void | UI_ColumnLayout (uiNode_t *node) |
Do column layout. A grid layout according to a fixed number of column. Check to first row to see the needed size of columns, and the height. All rows will use the same row. | |
static void | UI_PanelNodeDoLayout (uiNode_t *node) |
static void | UI_PanelNodeLoaded (uiNode_t *node) |
Handled after the end of the load of the node from script (all data and/or child are set). | |
static void | UI_PanelNodeGetClientPosition (uiNode_t *node, vec2_t position) |
static void | UI_PanelPropertyChanged (uiNode_t *node, const value_t *property) |
void | UI_RegisterPanelNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t * | propertyLayoutMargin |
static const value_t * | propertyLayoutColumns |
static const value_t * | propertyPadding |
static const uiBehaviour_t const * | localBehaviour |
static const value_t | properties [] |
Valid properties for a panel node. |
Definition in file ui_node_panel.c.
#define CORNER_SIZE 25 |
Definition at line 36 of file ui_node_panel.c.
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 34 of file ui_node_panel.c.
#define EXTRADATA_TYPE panelExtraData_t |
Definition at line 33 of file ui_node_panel.c.
#define MARGE 3 |
Definition at line 38 of file ui_node_panel.c.
#define MID_SIZE 1 |
Definition at line 37 of file ui_node_panel.c.
static void UI_BorderLayout | ( | uiNode_t * | node, | |
int | margin | |||
) | [static] |
Create a border layout with child of the node. Child with BORDERLAYOUT_TOP and BORDERLAYOUT_BOTTOM num are first positioned, there height do not change but the width fill the parent node. Then child with BORDERLAYOUT_LEFT and BORDERLAYOUT_RIGHT are positioned between positioned nodes. Finally BORDERLAYOUT_MIDDLE is filled into available free space.
[in,out] | node | The panel node to render the children for |
[in] | margin | The margin between all children nodes in their y-position of the panel |
Definition at line 102 of file ui_node_panel.c.
References uiNode_s::align, uiNode_s::firstChild, uiNode_s::invis, LAYOUTALIGN_BOTTOM, LAYOUTALIGN_LEFT, LAYOUTALIGN_MIDDLE, LAYOUTALIGN_RIGHT, LAYOUTALIGN_TOP, uiNode_s::next, uiNode_s::padding, uiNode_s::pos, uiNode_s::size, and UI_NodeSetSize().
Referenced by UI_PanelNodeDoLayout().
static void UI_ClientLayout | ( | uiNode_t * | node | ) | [static] |
Update the client zone
Definition at line 287 of file ui_node_panel.c.
References EXTRADATA, uiNode_s::firstChild, uiNode_s::next, uiNode_s::padding, uiNode_s::pos, uiNode_s::size, UI_ExecuteEventActions(), and UI_SetScroll().
Referenced by UI_PanelNodeDoLayout().
static void UI_ColumnLayout | ( | uiNode_t * | node | ) | [static] |
Do column layout. A grid layout according to a fixed number of column. Check to first row to see the needed size of columns, and the height. All rows will use the same row.
Definition at line 319 of file ui_node_panel.c.
References uiNode_s::behaviour, Com_Printf(), uiBehaviour_s::doLayout, EXTRADATA, uiNode_s::firstChild, i, uiNode_s::next, uiNode_s::padding, uiNode_s::pos, uiNode_s::size, UI_ExecuteEventActions(), UI_GetPath(), and UI_SetScroll().
Referenced by UI_PanelNodeDoLayout().
static void UI_PackLayout | ( | uiNode_t * | node, | |
int | margin | |||
) | [static] |
Create a pack layout with child of the node. Set position and size of nodes one by one. It is a usefull layout manager because it can create nice layout without sub panel.
[in,out] | node | The panel node to render the children for |
[in] | margin | The margin between all children nodes |
Definition at line 191 of file ui_node_panel.c.
References uiNode_s::align, uiNode_s::firstChild, uiNode_s::invis, LAYOUTALIGN_BOTTOM, LAYOUTALIGN_FILL, LAYOUTALIGN_LEFT, LAYOUTALIGN_RIGHT, LAYOUTALIGN_TOP, uiNode_s::next, uiNode_s::padding, uiNode_s::pos, uiNode_s::size, and UI_NodeSetSize().
Referenced by UI_PanelNodeDoLayout().
static void UI_PanelNodeDoLayout | ( | uiNode_t * | node | ) | [static] |
Definition at line 384 of file ui_node_panel.c.
References Com_Printf(), uiBehaviour_s::doLayout, EXTRADATA, uiNode_s::invalidated, LAYOUT_BORDER, LAYOUT_CLIENT, LAYOUT_COLUMN, LAYOUT_NONE, LAYOUT_PACK, LAYOUT_STAR, LAYOUT_TOP_DOWN_FLOW, uiBehaviour_s::super, UI_BorderLayout(), UI_ClientLayout(), UI_ColumnLayout(), UI_PackLayout(), UI_StarLayout(), and UI_TopDownFlowLayout().
Referenced by UI_RegisterPanelNode().
static void UI_PanelNodeDraw | ( | uiNode_t * | node | ) | [static] |
Handles Button draw.
Definition at line 49 of file ui_node_panel.c.
References CORNER_SIZE, uiNode_s::image, uiIcon_s::image, MARGE, MID_SIZE, pos, uiNode_s::size, UI_DrawPanel(), UI_GetNodeAbsPos(), and UI_GetReferenceString().
Referenced by UI_RegisterPanelNode().
Definition at line 430 of file ui_node_panel.c.
References EXTRADATA.
Referenced by UI_RegisterPanelNode().
static void UI_PanelNodeLoaded | ( | 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 420 of file ui_node_panel.c.
References Com_DPrintf(), CORNER_SIZE, DEBUG_CLIENT, EXTRADATA, LAYOUT_NONE, MID_SIZE, uiNode_s::size, UI_GetPath(), and UI_Invalidate().
Referenced by UI_RegisterPanelNode().
Definition at line 436 of file ui_node_panel.c.
References uiNode_s::behaviour, uiBehaviour_s::propertyChanged, uiBehaviour_s::super, UI_GetPropertyFromBehaviour(), and UI_Invalidate().
Referenced by UI_RegisterPanelNode().
void UI_RegisterPanelNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 479 of file ui_node_panel.c.
References Com_RegisterConstInt(), uiBehaviour_s::doLayout, uiBehaviour_s::draw, uiBehaviour_s::extends, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::getClientPosition, LAYOUT_BORDER, LAYOUT_CLIENT, LAYOUT_COLUMN, LAYOUT_PACK, LAYOUT_STAR, LAYOUT_TOP_DOWN_FLOW, LAYOUTALIGN_BOTTOM, LAYOUTALIGN_BOTTOMLEFT, LAYOUTALIGN_BOTTOMRIGHT, LAYOUTALIGN_FILL, LAYOUTALIGN_LEFT, LAYOUTALIGN_MIDDLE, LAYOUTALIGN_RIGHT, LAYOUTALIGN_TOP, LAYOUTALIGN_TOPLEFT, LAYOUTALIGN_TOPRIGHT, uiBehaviour_s::loaded, uiBehaviour_s::name, uiBehaviour_s::properties, uiBehaviour_s::propertyChanged, UI_GetPropertyFromBehaviour(), UI_PanelNodeDoLayout(), UI_PanelNodeDraw(), UI_PanelNodeGetClientPosition(), UI_PanelNodeLoaded(), and UI_PanelPropertyChanged().
void UI_StarLayout | ( | uiNode_t * | node | ) |
Do a star layout with child according to there num.
Definition at line 258 of file ui_node_panel.c.
References uiNode_s::align, uiNode_s::behaviour, uiBehaviour_s::doLayout, uiNode_s::firstChild, LAYOUTALIGN_FILL, LAYOUTALIGN_NONE, LAYOUTALIGN_SPECIAL, uiNode_s::next, uiNode_s::pos, uiNode_s::size, UI_NodeGetPoint(), UI_NodeRelativeToAbsolutePoint(), and UI_NodeSetSize().
Referenced by UI_PanelNodeDoLayout(), and UI_WindowNodeDoLayout().
static void UI_TopDownFlowLayout | ( | uiNode_t * | node, | |
int | margin | |||
) | [static] |
Create a top-down flow layout with child of the node. Child position is automatically set, child height don't change and child width is set according to node width and padding.
[in,out] | node | The panel node to render the children for |
[in] | margin | The margin between all children nodes in their y-position of the panel |
Definition at line 74 of file ui_node_panel.c.
References uiNode_s::firstChild, uiNode_s::next, uiNode_s::padding, uiNode_s::pos, uiNode_s::size, and UI_NodeSetSize().
Referenced by UI_PanelNodeDoLayout().
const uiBehaviour_t const* localBehaviour [static] |
Definition at line 44 of file ui_node_panel.c.
const value_t properties[] [static] |
{ {"layout", V_INT, UI_EXTRADATA_OFFSETOF(panelExtraData_t, layout), MEMBER_SIZEOF(panelExtraData_t, layout)}, {"layoutMargin", V_INT, UI_EXTRADATA_OFFSETOF(panelExtraData_t, layoutMargin), MEMBER_SIZEOF(panelExtraData_t, layoutMargin)}, {"layoutColumns", V_INT, UI_EXTRADATA_OFFSETOF(panelExtraData_t, layoutColumns), MEMBER_SIZEOF(panelExtraData_t, layoutColumns)}, {NULL, V_NULL, 0, 0} }
Valid properties for a panel node.
Definition at line 452 of file ui_node_panel.c.
const value_t* propertyLayoutColumns [static] |
Definition at line 41 of file ui_node_panel.c.
const value_t* propertyLayoutMargin [static] |
Definition at line 40 of file ui_node_panel.c.
const value_t* propertyPadding [static] |
Definition at line 42 of file ui_node_panel.c.