UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_abstractscrollable.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24*/
25
26#pragma once
27
30
31struct uiBehaviour_t;
32struct uiAction_s;
33struct uiNode_t;
34
36public:
38 void initNode(uiNode_t* node) override;
39
43 bool isSizeChange(uiNode_t* node);
44 bool scrollY(uiNode_t* node, int offset);
45 bool setScrollY(uiNode_t* node, int viewPos, int viewSize, int fullSize);
46
47 void pageUp (uiNode_t* node);
48 void pageDown (uiNode_t* node);
49 void moveUp (uiNode_t* node);
50 void moveDown (uiNode_t* node);
51 void moveHome (uiNode_t* node);
52 void moveEnd (uiNode_t* node);
53};
54
58struct uiScroll_t {
59 int viewPos;
62
63 bool set(int viewPos, int viewSize, int fullSize);
64 bool move(int viewPos);
70 bool moveDelta(int deltaPos) {
71 return move(this->viewPos + deltaPos);
72 }
73};
74
86
bool scrollY(uiNode_t *node, int offset)
Scroll the Y scroll with a relative position, and call event if need.
void initNode(uiNode_t *node) override
bool setScrollY(uiNode_t *node, int viewPos, int viewSize, int fullSize)
Set the Y scroll to a position, and call event if need.
bool isSizeChange(uiNode_t *node)
return true if the node size change and update the cache
voidpf uLong offset
Definition ioapi.h:45
int LUA_EVENT
holds a reference to a lua event handler
Definition scripts_lua.h:49
node behaviour, how a node work
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
Scroll representation.
bool move(int viewPos)
Fix a new position.
bool set(int viewPos, int viewSize, int fullSize)
Set the scroll to a position.
bool moveDelta(int deltaPos)
Move the position with a delta position.
vec_t vec2_t[2]
Definition ufotypes.h:38
void UI_RegisterAbstractScrollableNode(uiBehaviour_t *behaviour)