ui_node_abstractscrollable.c File Reference

#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_font.h"
#include "../ui_render.h"
#include "../ui_actions.h"
#include "ui_node_abstractnode.h"
#include "ui_node_abstractscrollable.h"
#include "../../client.h"
Include dependency graph for ui_node_abstractscrollable.c:

Go to the source code of this file.

Defines

#define EXTRADATA_TYPE   abstractScrollableExtraData_t
#define EXTRADATA(node)   UI_EXTRADATA(node, EXTRADATA_TYPE)

Functions

qboolean UI_AbstractScrollableNodeIsSizeChange (uiNode_t *node)
 return true if the node size change and update the cache
qboolean UI_SetScroll (uiScroll_t *scroll, int viewPos, int viewSize, int fullSize)
 Set the scroll to a position.
qboolean UI_AbstractScrollableNodeSetY (uiNode_t *node, int viewPos, int viewSize, int fullSize)
 Set the Y scroll to a position, and call event if need.
static void UI_AbstractScrollableNodePageUp (uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractScrollableNodePageDown (uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractScrollableNodeMoveUp (uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractScrollableNodeMoveDown (uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractScrollableNodeMoveHome (uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractScrollableNodeMoveEnd (uiNode_t *node, const uiCallContext_t *context)
qboolean UI_AbstractScrollableNodeScrollY (uiNode_t *node, int offset)
 Scroll the Y scroll with a relative position, and call event if need.
void UI_RegisterAbstractScrollableNode (uiBehaviour_t *behaviour)

Variables

static const value_t properties []

Detailed Description

Todo:
use this interface into every scrollable node

Definition in file ui_node_abstractscrollable.c.


Define Documentation

#define EXTRADATA ( node   )     UI_EXTRADATA(node, EXTRADATA_TYPE)

Definition at line 37 of file ui_node_abstractscrollable.c.

#define EXTRADATA_TYPE   abstractScrollableExtraData_t

Definition at line 36 of file ui_node_abstractscrollable.c.


Function Documentation

qboolean UI_AbstractScrollableNodeIsSizeChange ( uiNode_t node  ) 

return true if the node size change and update the cache

Definition at line 42 of file ui_node_abstractscrollable.c.

References EXTRADATA, qfalse, qtrue, uiNode_s::size, and UI_NodeInstanceOf().

Referenced by UI_MaterialEditorNodeDraw(), UI_MessageListNodeDraw(), UI_TextLineNodeDrawText(), and UI_TextNodeDrawText().

static void UI_AbstractScrollableNodeMoveDown ( uiNode_t node,
const uiCallContext_t context 
) [static]

Definition at line 144 of file ui_node_abstractscrollable.c.

References EXTRADATA, and UI_AbstractScrollableNodeSetY().

static void UI_AbstractScrollableNodeMoveEnd ( uiNode_t node,
const uiCallContext_t context 
) [static]
Note:
fullSize is bigger than the "end" position. But the function will clamp it right

Definition at line 155 of file ui_node_abstractscrollable.c.

References EXTRADATA, and UI_AbstractScrollableNodeSetY().

static void UI_AbstractScrollableNodeMoveHome ( uiNode_t node,
const uiCallContext_t context 
) [static]

Definition at line 148 of file ui_node_abstractscrollable.c.

References UI_AbstractScrollableNodeSetY().

static void UI_AbstractScrollableNodeMoveUp ( uiNode_t node,
const uiCallContext_t context 
) [static]

Definition at line 140 of file ui_node_abstractscrollable.c.

References EXTRADATA, and UI_AbstractScrollableNodeSetY().

static void UI_AbstractScrollableNodePageDown ( uiNode_t node,
const uiCallContext_t context 
) [static]

Definition at line 136 of file ui_node_abstractscrollable.c.

References EXTRADATA, and UI_AbstractScrollableNodeSetY().

static void UI_AbstractScrollableNodePageUp ( uiNode_t node,
const uiCallContext_t context 
) [static]
Note:
pos == -1 is a reserved value, that why we clamp the value

Definition at line 131 of file ui_node_abstractscrollable.c.

References EXTRADATA, pos, and UI_AbstractScrollableNodeSetY().

qboolean UI_AbstractScrollableNodeScrollY ( uiNode_t node,
int  offset 
)

Scroll the Y scroll with a relative position, and call event if need.

Returns:
True, if something have change

Definition at line 163 of file ui_node_abstractscrollable.c.

References EXTRADATA, UI_AbstractScrollableNodeSetY(), and UI_NodeInstanceOf().

Referenced by UI_MaterialEditorNodeWheel(), UI_MessageListNodeMouseWheel(), UI_TextListNodeMouseWheel(), and UI_TextNodeMouseWheel().

qboolean UI_AbstractScrollableNodeSetY ( uiNode_t node,
int  viewPos,
int  viewSize,
int  fullSize 
)

Set the Y scroll to a position, and call event if need.

Parameters:
[in] node Context node
[in] viewPos New position to set, else -1 if no change
[in] viewSize New view size to set, else -1 if no change
[in] fullSize New full size to set, else -1 if no change
Returns:
True, if something have change

Definition at line 115 of file ui_node_abstractscrollable.c.

References EXTRADATA, UI_ExecuteEventActions(), UI_NodeInstanceOf(), and UI_SetScroll().

Referenced by UI_AbstractScrollableNodeMoveDown(), UI_AbstractScrollableNodeMoveEnd(), UI_AbstractScrollableNodeMoveHome(), UI_AbstractScrollableNodeMoveUp(), UI_AbstractScrollableNodePageDown(), UI_AbstractScrollableNodePageUp(), UI_AbstractScrollableNodeScrollY(), UI_MaterialEditorNodeUpdateView(), UI_MessageListNodeDraw(), UI_TextLineNodeDrawText(), and UI_TextNodeDrawText().

void UI_RegisterAbstractScrollableNode ( uiBehaviour_t behaviour  ) 
qboolean UI_SetScroll ( uiScroll_t scroll,
int  viewPos,
int  viewSize,
int  fullSize 
)

Set the scroll to a position.

Parameters:
[in] scroll scroll to edit
[in] viewPos New position to set, else -1 if no change
[in] viewSize New view size to set, else -1 if no change
[in] fullSize New full size to set, else -1 if no change
Returns:
True, if something have change

Definition at line 64 of file ui_node_abstractscrollable.c.

References uiScroll_t::fullSize, qfalse, qtrue, uiScroll_t::viewPos, and uiScroll_t::viewSize.

Referenced by UI_AbstractScrollableNodeSetY(), UI_ClientLayout(), UI_ColumnLayout(), UI_OptionListNodeMouseWheel(), UI_OptionListNodeUpdateScroll(), UI_OptionTreeNodeMouseWheel(), UI_OptionTreeNodeUpdateScroll(), and UI_OptionTreeSetSelectedValue().


Variable Documentation

const value_t properties[] [static]
Initial value:
 {
    
    {"viewpos", V_INT, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, scrollY.viewPos),  MEMBER_SIZEOF(EXTRADATA_TYPE, scrollY.viewPos)},
    
    {"viewsize", V_INT, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, scrollY.viewSize),  MEMBER_SIZEOF(EXTRADATA_TYPE, scrollY.viewSize)},
    
    {"fullsize", V_INT, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, scrollY.fullSize),  MEMBER_SIZEOF(EXTRADATA_TYPE, scrollY.fullSize)},
    
    {"onviewchange", V_UI_ACTION, UI_EXTRADATA_OFFSETOF(EXTRADATA_TYPE, onViewChange), MEMBER_SIZEOF(EXTRADATA_TYPE, onViewChange)},

    
    {"pageup", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodePageUp), 0},
    
    {"pagedown", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodePageDown), 0},
    
    {"moveup", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodeMoveUp), 0},
    
    {"movedown", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodeMoveDown), 0},
    
    {"movehome", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodeMoveHome), 0},
    
    {"moveend", V_UI_NODEMETHOD, ((size_t) UI_AbstractScrollableNodeMoveEnd), 0},

    {NULL, V_NULL, 0, 0}
}

Definition at line 169 of file ui_node_abstractscrollable.c.


Generated by  doxygen 1.6.2