UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_abstractvalue.h
Go to the documentation of this file.
1 
7 /*
8 Copyright (C) 2002-2020 UFO: Alien Invasion.
9 
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 See the GNU General Public License for more details.
20 
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 
25 */
26 
27 #pragma once
28 
30 public:
31  void onLoaded(uiNode_t* node) override;
32  void onLoading(uiNode_t* node) override;
33  void clone(uiNode_t const* source, uiNode_t* clone) override;
34  void initNode(uiNode_t* node) override;
35  void initNodeDynamic(uiNode_t* node) override;
36  void deleteNode(uiNode_t* node) override;
37 
38  void setRange(uiNode_t* node, float min, float max);
39  bool setValue(uiNode_t* node, float value);
40  bool setDelta(uiNode_t* node, float delta);
41  bool setMax(uiNode_t* node, float max);
42  bool setMin(uiNode_t* node, float min);
43  bool incValue(uiNode_t* node);
44  bool decValue(uiNode_t* node);
45 
46  float getFactorFloat(uiNode_t const* node);
47  float getMin(uiNode_t const* node);
48  float getMax(uiNode_t const* node);
49  float getDelta(uiNode_t const* node);
50  float getValue(uiNode_t const* node);
51  float getLastDiff (uiNode_t const* node);
52  float getShiftIncreaseFactor (uiNode_t* const node);
53 };
54 
61 typedef struct abstractValueExtraData_s {
62  void* min;
63  void* max;
64  void* value;
65  void* delta;
66  float lastdiff;
69 
70 struct uiBehaviour_t; /* prototype */
71 
73 
74 float UI_AbstractValue_GetMin (uiNode_t* node);
75 float UI_AbstractValue_GetMax (uiNode_t* node);
80 
83 
84 void UI_AbstractValue_SetRange (uiNode_t* node, float min, float max);
85 void UI_AbstractValue_SetMin (uiNode_t* node, float min);
86 void UI_AbstractValue_SetMax (uiNode_t* node, float max);
87 void UI_AbstractValue_SetValue (uiNode_t* node, float value);
88 void UI_AbstractValue_SetDelta (uiNode_t* node, float delta);
89 
90 void UI_AbstractValue_SetRangeCvar (uiNode_t* node, const char* min, const char* max);
91 void UI_AbstractValue_SetMinCvar (uiNode_t* node, const char* min);
92 void UI_AbstractValue_SetMaxCvar (uiNode_t* node, const char* max);
93 void UI_AbstractValue_SetValueCvar (uiNode_t* node, const char* value);
94 void UI_AbstractValue_SetShiftIncreaseFactor (uiNode_t* node, float factor);
bool setMax(uiNode_t *node, float max)
float getDelta(uiNode_t const *node)
float getShiftIncreaseFactor(uiNode_t *const node)
float getMin(uiNode_t const *node)
void UI_AbstractValue_SetValue(uiNode_t *node, float value)
void clone(uiNode_t const *source, uiNode_t *clone) override
Call to update a cloned node.
bool incValue(uiNode_t *node)
extradata for common GUI widget which allow to edit a value (scrollbar, spinner, and more) ...
void deleteNode(uiNode_t *node) override
float getFactorFloat(uiNode_t const *node)
void UI_AbstractValue_IncValue(uiNode_t *node)
float getMax(uiNode_t const *node)
void UI_AbstractValue_SetValueCvar(uiNode_t *node, const char *value)
float getLastDiff(uiNode_t const *node)
bool setDelta(uiNode_t *node, float delta)
void UI_AbstractValue_SetRange(uiNode_t *node, float min, float max)
float UI_AbstractValue_GetDelta(uiNode_t *node)
void UI_AbstractValue_SetShiftIncreaseFactor(uiNode_t *node, float factor)
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
void UI_RegisterAbstractValueNode(uiBehaviour_t *behaviour)
void UI_AbstractValue_SetMinCvar(uiNode_t *node, const char *min)
void onLoaded(uiNode_t *node) override
float UI_AbstractValue_GetMin(uiNode_t *node)
bool setMin(uiNode_t *node, float min)
float UI_AbstractValue_GetShiftIncreaseFactor(uiNode_t *node)
node behaviour, how a node work
Definition: ui_behaviour.h:39
void UI_AbstractValue_DecValue(uiNode_t *node)
void UI_AbstractValue_SetRangeCvar(uiNode_t *node, const char *min, const char *max)
void UI_AbstractValue_SetDelta(uiNode_t *node, float delta)
float UI_AbstractValue_GetLastDiff(uiNode_t *node)
bool setValue(uiNode_t *node, float value)
void onLoading(uiNode_t *node) override
float UI_AbstractValue_GetValue(uiNode_t *node)
void UI_AbstractValue_SetMin(uiNode_t *node, float min)
void initNode(uiNode_t *node) override
float getValue(uiNode_t const *node)
struct abstractValueExtraData_s abstractValueExtraData_t
extradata for common GUI widget which allow to edit a value (scrollbar, spinner, and more) ...
void UI_AbstractValue_SetMax(uiNode_t *node, float max)
float UI_AbstractValue_GetMax(uiNode_t *node)
void UI_AbstractValue_SetMaxCvar(uiNode_t *node, const char *max)
void setRange(uiNode_t *node, float min, float max)
bool decValue(uiNode_t *node)
void initNodeDynamic(uiNode_t *node) override