ui_node_vscrollbar.c File Reference

#include "../ui_nodes.h"
#include "../ui_parse.h"
#include "../ui_timer.h"
#include "../ui_actions.h"
#include "../ui_input.h"
#include "../ui_render.h"
#include "ui_node_abstractnode.h"
#include "ui_node_abstractscrollbar.h"
#include "ui_node_vscrollbar.h"
#include "../../input/cl_input.h"
#include "../../input/cl_keys.h"
Include dependency graph for ui_node_vscrollbar.c:

Go to the source code of this file.

Defines

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

Functions

static void UI_VScrollbarNodeGetElementSize (uiNode_t *node, int description[5])
 Return size of all elements of the scrollbar.
static int UI_VScrollbarNodeGetElement (uiNode_t *node, int description[5], int x, int y)
 Get an element of the scrollbar at a position.
static void UI_VScrollbarNodeSet (uiNode_t *node, int value)
 Set the position of the scrollbar to a value.
static void UI_VScrollbarNodeDiff (uiNode_t *node, int value)
 Translate the position to a value.
static void UI_VScrollbarNodeAction (uiNode_t *node, int hoveredElement, qboolean allowCapture)
static void UI_VScrollbarNodeRepeat (uiNode_t *node, uiTimer_t *timer)
static void UI_ActiveVScrollbarNode_f ()
 Active an element of a vscrollbarnode.
static void UI_VScrollbarNodeMouseDown (uiNode_t *node, int x, int y, int button)
static void UI_VScrollbarNodeMouseUp (uiNode_t *node, int x, int y, int button)
static void UI_VScrollbarNodeCapturedMouseLost (uiNode_t *node)
 Called when the node have lost the captured node We clean cached data.
static void UI_VScrollbarNodeWheel (uiNode_t *node, qboolean down, int x, int y)
 Called when the user wheel the mouse over the node.
static void UI_VScrollbarNodeCapturedMouseMove (uiNode_t *node, int x, int y)
 Called when the node is captured by the mouse.
static void UI_VScrollbarNodeDraw (uiNode_t *node)
 Call to draw the node.
static void UI_VScrollbarNodeLoading (uiNode_t *node)
static void UI_VScrollbarNodeLoaded (uiNode_t *node)
void UI_RegisterVScrollbarNode (uiBehaviour_t *behaviour)

Variables

static const int TILE_WIDTH = 32
static const int TILE_HEIGHT = 18
static const int ELEMENT_WIDTH = 19
static const int ELEMENT_HEIGHT = 16
static int oldPos
static int oldMouseY
static uiTimer_tcapturedTimer
static int capturedElement

Detailed Description

Todo:

implement disabled

robustness

Definition in file ui_node_vscrollbar.c.


Define Documentation

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

Definition at line 50 of file ui_node_vscrollbar.c.


Function Documentation

static void UI_ActiveVScrollbarNode_f (  )  [static]

Active an element of a vscrollbarnode.

Note:
This command work like an user, so, if need, change event are fired

Definition at line 194 of file ui_node_vscrollbar.c.

References Cmd_Argc(), Cmd_Argv(), Com_Printf(), qfalse, UI_GetNodeByPath(), UI_NodeInstanceOf(), and UI_VScrollbarNodeAction().

Referenced by UI_RegisterVScrollbarNode().

void UI_RegisterVScrollbarNode ( uiBehaviour_t behaviour  ) 
static void UI_VScrollbarNodeAction ( uiNode_t node,
int  hoveredElement,
qboolean  allowCapture 
) [inline, static]
static void UI_VScrollbarNodeCapturedMouseLost ( uiNode_t node  )  [static]

Called when the node have lost the captured node We clean cached data.

Definition at line 249 of file ui_node_vscrollbar.c.

References UI_TimerRelease().

Referenced by UI_RegisterVScrollbarNode().

static void UI_VScrollbarNodeCapturedMouseMove ( uiNode_t node,
int  x,
int  y 
) [static]

Called when the node is captured by the mouse.

Definition at line 273 of file ui_node_vscrollbar.c.

References capturedElement, ELEMENT_HEIGHT, EXTRADATA, oldMouseY, oldPos, pos, uiNode_s::size, and UI_VScrollbarNodeSet().

Referenced by UI_RegisterVScrollbarNode().

static void UI_VScrollbarNodeDiff ( uiNode_t node,
int  value 
) [inline, static]

Translate the position to a value.

Definition at line 120 of file ui_node_vscrollbar.c.

References EXTRADATA, pos, and UI_VScrollbarNodeSet().

Referenced by UI_VScrollbarNodeAction().

static void UI_VScrollbarNodeDraw ( uiNode_t node  )  [static]
static int UI_VScrollbarNodeGetElement ( uiNode_t node,
int  description[5],
int  x,
int  y 
) [static]

Get an element of the scrollbar at a position.

Parameters:
[in] node Absolute position y
[in] description Size of each scroll bar elements (beginarrow, mid, scroll, mid, endarrow)
[in] x Absolute position x
[in] y Absolute position y

Definition at line 76 of file ui_node_vscrollbar.c.

References i, and UI_NodeAbsoluteToRelativePos().

Referenced by UI_VScrollbarNodeDraw(), and UI_VScrollbarNodeMouseDown().

static void UI_VScrollbarNodeGetElementSize ( uiNode_t node,
int  description[5] 
) [static]

Return size of all elements of the scrollbar.

Definition at line 55 of file ui_node_vscrollbar.c.

References ELEMENT_HEIGHT, EXTRADATA, and uiNode_s::size.

Referenced by UI_VScrollbarNodeDraw(), and UI_VScrollbarNodeMouseDown().

static void UI_VScrollbarNodeLoaded ( uiNode_t node  )  [static]
static void UI_VScrollbarNodeLoading ( uiNode_t node  )  [static]

Definition at line 412 of file ui_node_vscrollbar.c.

References uiNode_s::size.

Referenced by UI_RegisterVScrollbarNode().

static void UI_VScrollbarNodeMouseDown ( uiNode_t node,
int  x,
int  y,
int  button 
) [static]
static void UI_VScrollbarNodeMouseUp ( uiNode_t node,
int  x,
int  y,
int  button 
) [static]

Definition at line 233 of file ui_node_vscrollbar.c.

References EXTRADATA, K_MOUSE1, UI_GetMouseCapture(), and UI_MouseRelease().

Referenced by UI_RegisterVScrollbarNode().

static void UI_VScrollbarNodeRepeat ( uiNode_t node,
uiTimer_t timer 
) [static]
static void UI_VScrollbarNodeSet ( uiNode_t node,
int  value 
) [static]

Set the position of the scrollbar to a value.

Definition at line 91 of file ui_node_vscrollbar.c.

References EXTRADATA, uiNode_s::onChange, pos, and UI_ExecuteEventActions().

Referenced by UI_VScrollbarNodeCapturedMouseMove(), UI_VScrollbarNodeDiff(), and UI_VScrollbarNodeWheel().

static void UI_VScrollbarNodeWheel ( uiNode_t node,
qboolean  down,
int  x,
int  y 
) [static]

Called when the user wheel the mouse over the node.

Definition at line 260 of file ui_node_vscrollbar.c.

References EXTRADATA, pos, and UI_VScrollbarNodeSet().

Referenced by UI_RegisterVScrollbarNode().


Variable Documentation

int capturedElement [static]

Definition at line 47 of file ui_node_vscrollbar.c.

const int ELEMENT_HEIGHT = 16 [static]
const int ELEMENT_WIDTH = 19 [static]

Definition at line 42 of file ui_node_vscrollbar.c.

Referenced by UI_VScrollbarNodeDraw().

int oldMouseY [static]
int oldPos [static]
const int TILE_HEIGHT = 18 [static]

Definition at line 41 of file ui_node_vscrollbar.c.

const int TILE_WIDTH = 32 [static]

Definition at line 40 of file ui_node_vscrollbar.c.

Referenced by UI_VScrollbarNodeDraw().


Generated by  doxygen 1.6.2