UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_panel.h File Reference

Go to the source code of this file.

Data Structures

class  uiPanelNode
 
struct  panelExtraData_t
 extradata for the panel node More...
 

Macros

#define UI_GET_VERTICAL_ALIGN(align)   ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
 
#define UI_GET_HORIZONTAL_ALIGN(align)   ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
 

Enumerations

enum  panelLayout_t {
  LAYOUT_NONE, LAYOUT_TOP_DOWN_FLOW, LAYOUT_LEFT_RIGHT_FLOW, LAYOUT_BORDER,
  LAYOUT_PACK, LAYOUT_STAR, LAYOUT_CLIENT, LAYOUT_COLUMN,
  LAYOUT_MAX, LAYOUT_ENSURE_32BIT = 0x7FFFFFFF
}
 
enum  layoutAlign_t {
  LAYOUTALIGN_NONE = 0, LAYOUTALIGN_H_MASK = 0x03, LAYOUTALIGN_H_LEFT = 0x01, LAYOUTALIGN_H_MIDDLE = 0x02,
  LAYOUTALIGN_H_RIGHT = 0x03, LAYOUTALIGN_V_MASK = 0x0C, LAYOUTALIGN_V_TOP = 0x04, LAYOUTALIGN_V_MIDDLE = 0x08,
  LAYOUTALIGN_V_BOTTOM = 0x0C, LAYOUTALIGN_TOPLEFT = (LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_LEFT), LAYOUTALIGN_TOP = (LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_MIDDLE), LAYOUTALIGN_TOPRIGHT = (LAYOUTALIGN_V_TOP | LAYOUTALIGN_H_RIGHT),
  LAYOUTALIGN_LEFT = (LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_LEFT), LAYOUTALIGN_MIDDLE = (LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_MIDDLE), LAYOUTALIGN_RIGHT = (LAYOUTALIGN_V_MIDDLE | LAYOUTALIGN_H_RIGHT), LAYOUTALIGN_BOTTOMLEFT = (LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_LEFT),
  LAYOUTALIGN_BOTTOM = (LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_MIDDLE), LAYOUTALIGN_BOTTOMRIGHT = (LAYOUTALIGN_V_BOTTOM | LAYOUTALIGN_H_RIGHT), LAYOUTALIGN_SPECIAL = 0x10, LAYOUTALIGN_FILL,
  LAYOUTALIGN_MAX, LAYOUTALIGN_ENSURE_32BIT = 0x7FFFFFFF
}
 

Functions

void UI_Panel_SetBackgroundByName (uiNode_t *node, const char *name)
 
void UI_RegisterPanelNode (uiBehaviour_t *behaviour)
 
void UI_StarLayout (uiNode_t *node)
 Do a star layout with child according to there num. More...
 

Macro Definition Documentation

#define UI_GET_HORIZONTAL_ALIGN (   align)    ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
Parameters
aligna layoutAlign_t
Returns
LAYOUTALIGN_H_LEFT, LAYOUTALIGN_H_MIDDLE, LAYOUTALIGN_H_RIGHT, else LAYOUTALIGN_NONE

Definition at line 102 of file ui_node_panel.h.

Referenced by UI_NodeGetPoint().

#define UI_GET_VERTICAL_ALIGN (   align)    ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
Parameters
aligna layoutAlign_t
Returns
LAYOUTALIGN_V_TOP, LAYOUTALIGN_V_MIDDLE, LAYOUTALIGN_V_BOTTOM, else LAYOUTALIGN_NONE

Definition at line 97 of file ui_node_panel.h.

Referenced by UI_NodeGetPoint().

Enumeration Type Documentation

Enumerator
LAYOUTALIGN_NONE 
LAYOUTALIGN_H_MASK 
LAYOUTALIGN_H_LEFT 
LAYOUTALIGN_H_MIDDLE 
LAYOUTALIGN_H_RIGHT 
LAYOUTALIGN_V_MASK 
LAYOUTALIGN_V_TOP 
LAYOUTALIGN_V_MIDDLE 
LAYOUTALIGN_V_BOTTOM 
LAYOUTALIGN_TOPLEFT 
LAYOUTALIGN_TOP 
LAYOUTALIGN_TOPRIGHT 
LAYOUTALIGN_LEFT 
LAYOUTALIGN_MIDDLE 
LAYOUTALIGN_RIGHT 
LAYOUTALIGN_BOTTOMLEFT 
LAYOUTALIGN_BOTTOM 
LAYOUTALIGN_BOTTOMRIGHT 
LAYOUTALIGN_SPECIAL 
LAYOUTALIGN_FILL 
LAYOUTALIGN_MAX 
LAYOUTALIGN_ENSURE_32BIT 

Definition at line 59 of file ui_node_panel.h.

Enumerator
LAYOUT_NONE 
LAYOUT_TOP_DOWN_FLOW 
LAYOUT_LEFT_RIGHT_FLOW 
LAYOUT_BORDER 
LAYOUT_PACK 
LAYOUT_STAR 
LAYOUT_CLIENT 
LAYOUT_COLUMN 
LAYOUT_MAX 
LAYOUT_ENSURE_32BIT 

Definition at line 45 of file ui_node_panel.h.

Function Documentation

void UI_Panel_SetBackgroundByName ( uiNode_t node,
const char *  name 
)

Definition at line 597 of file ui_node_panel.cpp.

References UI_EXTRADATA, and UI_GetSpriteByName().

Referenced by uiPanelNode_t_set_background().

void UI_RegisterPanelNode ( uiBehaviour_t behaviour)

Select a layout manager to set position and size of child. Most of layout manager do not move or resize child without align property set. In the image, number identify the position of the child into node, and same color identify the same node. Text on child display the value of the "align" property of each child.

  • 0: no layout manager. Child keep there position and there size.
  • LAYOUT_TOP_DOWN_FLOW: layout child from top to down. Only child height do not change.
  • LAYOUT_PACK: Pack one by one child into the available space of the node.
  • LAYOUT_BORDER: Align nodes at a know position. Its look like pack layout, but the order is not the same. top and bottom child first, then left and right, then middle. We can show the difference into the image.
  • LAYOUT_STAR: Align the corner of child into the corner of the node. Child size do not change.
    Layout.png

Margin use to layout children (margin between children)

Number of column use to layout children (used with LAYOUT_COLUMN)

If scrolling via mousewheel is enabled

Definition at line 602 of file ui_node_panel.cpp.

References Com_RegisterConstInt(), uiBehaviour_t::extends, EXTRADATA_TYPE, uiBehaviour_t::extraDataSize, LAYOUT_BORDER, LAYOUT_CLIENT, LAYOUT_COLUMN, LAYOUT_LEFT_RIGHT_FLOW, 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_t::lua_SWIG_typeinfo, uiBehaviour_t::manager, uiBehaviour_t::name, UI_RegisterExtradataNodeProperty, UI_SWIG_TypeQuery(), V_BOOL, V_INT, and V_UI_SPRITEREF.

void UI_StarLayout ( uiNode_t node)

Do a star layout with child according to there num.

Note
1=top-left 2=top-middle 3=top-right 4=middle-left 5=middle-middle 6=middle-right 7=bottom-left 8=bottom-middle 9=bottom-right 10=fill
Todo:
Tag it static when it is possible

Definition at line 304 of file ui_node_panel.cpp.

References uiNode_t::align, uiNode_t::box, uiNode_t::firstChild, LAYOUTALIGN_FILL, LAYOUTALIGN_NONE, LAYOUTALIGN_SPECIAL, uiNode_t::next, uiBox_t::size, UI_Node_DoLayout(), UI_NodeGetPoint(), UI_NodeRelativeToAbsolutePoint(), and UI_NodeSetSize().

Referenced by uiPanelNode::doLayout(), and uiWindowNode::doLayout().