UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_abstractoption.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 #include "../../../shared/shared.h"
29 
30 struct uiAction_s;
31 
33 public:
35  void initNode(uiNode_t* node) override;
36 
37  void doLayout(uiNode_t* node) override;
38  int getCellWidth(uiNode_t* node) override;
39  int getCellHeight(uiNode_t* node) override;
40 };
41 
42 typedef struct {
43  /* link to shared data (can be used if internal data is null) */
44  int dataId;
45  int versionId;
46  const char* cvar;
48  /* information */
49  int count;
51 
60 
61 struct uiBehaviour_t;
62 
65 
68 void UI_AbstractOption_SetCurrentValue(uiNode_t* node, const char* value);
69 
72 const char* UI_AbstractOption_GetCvar (uiNode_t* node);
73 
74 void UI_AbstractOption_SetDataId (uiNode_t* node, int id);
75 void UI_AbstractOption_SetDataIdByName (uiNode_t* node, const char* name);
76 void UI_AbstractOption_SetCvar (uiNode_t* node, const char* name);
77 void UI_AbstractOption_SetBackgroundByName(uiNode_t* node, const char* name);
78 
80 void UI_AbstractOption_Scroll_SetCurrent (uiNode_t* node, int pos);
int getCellHeight(uiNode_t *node) override
Return size of the cell, which is the size (in virtual "pixel") which represents 1 in the scroll valu...
int UI_AbstractOption_Scroll_FullSize(uiNode_t *node)
void UI_RegisterAbstractOptionNode(uiBehaviour_t *behaviour)
int getCellWidth(uiNode_t *node) override
Return size of the cell, which is the size (in virtual "pixel") which represents 1 in the scroll valu...
int UI_AbstractOption_Scroll_ViewSize(uiNode_t *node)
int LUA_EVENT
holds a reference to a lua event handler
Definition: scripts_lua.h:49
int UI_AbstractOption_GetDataId(uiNode_t *node)
void UI_AbstractOption_SetBackgroundByName(uiNode_t *node, const char *name)
void UI_AbstractOption_SetDataIdByName(uiNode_t *node, const char *name)
void initNode(uiNode_t *node) override
void UI_AbstractOption_Scroll_SetViewSize(uiNode_t *node, int size)
const char * UI_AbstractOption_GetCurrentValue(uiNode_t *node)
int UI_AbstractOption_Scroll_Current(uiNode_t *node)
GLsizei size
Definition: r_gl.h:152
void UI_AbstractOption_SetCvar(uiNode_t *node, const char *name)
void UI_AbstractOption_SortOptions(uiNode_t *node)
Sort options by alphabet.
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
base code for scrollable node
const char * UI_AbstractOption_GetCvar(uiNode_t *node)
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
void UI_AbstractOption_SetDataId(uiNode_t *node, int id)
node behaviour, how a node work
Definition: ui_behaviour.h:39
struct uiAction_s * onViewChange
Scroll representation.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
uiNode_t * UI_AbstractOption_GetFirstOption(uiNode_t *node)
Return the first option of the node.
void UI_AbstractOption_Scroll_SetCurrent(uiNode_t *node, int pos)
Atomic element to store UI scripts The parser use this atom to translate script action into many tree...
Definition: ui_actions.h:144
void UI_AbstractOption_Scroll_SetFullSize(uiNode_t *node, int size)
int UI_AbstractOption_GetCount(uiNode_t *node)
void UI_AbstractOption_SetCurrentValue(uiNode_t *node, const char *value)