UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_node_panel.h
Go to the documentation of this file.
1
4
5
/*
6
Copyright (C) 2002-2025 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 "
ui_node_abstractscrollable.h
"
28
29
class
uiPanelNode
:
public
uiAbstractScrollableNode
{
30
void
draw
(
uiNode_t
* node)
override
;
31
void
onLoaded
(
uiNode_t
* node)
override
;
32
void
onLoading
(
uiNode_t
* node)
override
;
33
void
doLayout
(
uiNode_t
* node)
override
;
34
void
getClientPosition
(
uiNode_t
const
* node,
vec2_t
position)
override
;
35
void
onPropertyChanged
(
uiNode_t
* node,
const
value_t
* property)
override
;
36
bool
onScroll
(
uiNode_t
* node,
int
deltaX,
int
deltaY)
override
;
37
void
onMouseUp
(
uiNode_t
* node,
int
x,
int
y,
int
button)
override
;
38
bool
onMouseLongPress
(
uiNode_t
* node,
int
x,
int
y,
int
button)
override
;
39
bool
onStartDragging
(
uiNode_t
* node,
int
startX
,
int
startY
,
int
currentX,
int
currentY,
int
button)
override
;
40
void
onCapturedMouseMove
(
uiNode_t
* node,
int
x,
int
y)
override
;
41
};
42
43
struct
uiBehaviour_t
;
44
45
typedef
enum
{
46
LAYOUT_NONE
,
47
LAYOUT_TOP_DOWN_FLOW
,
48
LAYOUT_LEFT_RIGHT_FLOW
,
49
LAYOUT_BORDER
,
50
LAYOUT_PACK
,
51
LAYOUT_STAR
,
52
LAYOUT_CLIENT
,
53
LAYOUT_COLUMN
,
54
55
LAYOUT_MAX
,
56
LAYOUT_ENSURE_32BIT
= 0x7FFFFFFF
57
}
panelLayout_t
;
58
59
typedef
enum
{
60
LAYOUTALIGN_NONE
= 0,
61
62
/* vertical and horizontal flag bits */
63
LAYOUTALIGN_H_MASK
= 0x03,
64
LAYOUTALIGN_H_LEFT
= 0x01,
65
LAYOUTALIGN_H_MIDDLE
= 0x02,
66
LAYOUTALIGN_H_RIGHT
= 0x03,
67
LAYOUTALIGN_V_MASK
= 0x0C,
68
LAYOUTALIGN_V_TOP
= 0x04,
69
LAYOUTALIGN_V_MIDDLE
= 0x08,
70
LAYOUTALIGN_V_BOTTOM
= 0x0C,
71
72
/* common alignment */
73
LAYOUTALIGN_TOPLEFT
= (
LAYOUTALIGN_V_TOP
|
LAYOUTALIGN_H_LEFT
),
74
LAYOUTALIGN_TOP
= (
LAYOUTALIGN_V_TOP
|
LAYOUTALIGN_H_MIDDLE
),
75
LAYOUTALIGN_TOPRIGHT
= (
LAYOUTALIGN_V_TOP
|
LAYOUTALIGN_H_RIGHT
),
76
LAYOUTALIGN_LEFT
= (
LAYOUTALIGN_V_MIDDLE
|
LAYOUTALIGN_H_LEFT
),
77
LAYOUTALIGN_MIDDLE
= (
LAYOUTALIGN_V_MIDDLE
|
LAYOUTALIGN_H_MIDDLE
),
78
LAYOUTALIGN_RIGHT
= (
LAYOUTALIGN_V_MIDDLE
|
LAYOUTALIGN_H_RIGHT
),
79
LAYOUTALIGN_BOTTOMLEFT
= (
LAYOUTALIGN_V_BOTTOM
|
LAYOUTALIGN_H_LEFT
),
80
LAYOUTALIGN_BOTTOM
= (
LAYOUTALIGN_V_BOTTOM
|
LAYOUTALIGN_H_MIDDLE
),
81
LAYOUTALIGN_BOTTOMRIGHT
= (
LAYOUTALIGN_V_BOTTOM
|
LAYOUTALIGN_H_RIGHT
),
82
83
/* special align, everything bigger 0x10 */
84
LAYOUTALIGN_SPECIAL
= 0x10,
85
86
/* pack and star layout manager only */
87
LAYOUTALIGN_FILL
,
88
89
LAYOUTALIGN_MAX
,
90
LAYOUTALIGN_ENSURE_32BIT
= 0x7FFFFFFF
91
}
layoutAlign_t
;
92
97
#define UI_GET_VERTICAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_V_MASK & align))
102
#define UI_GET_HORIZONTAL_ALIGN(align) ((align >= LAYOUTALIGN_SPECIAL)?LAYOUTALIGN_NONE:(LAYOUTALIGN_H_MASK & align))
103
107
typedef
struct
{
108
abstractScrollableExtraData_t
super
;
109
panelLayout_t
layout
;
110
int
layoutMargin
;
111
int
layoutColumns
;
112
bool
wheelScrollable
;
114
uiSprite_t
*
background
;
115
}
panelExtraData_t
;
116
117
void
UI_Panel_SetBackgroundByName
(
uiNode_t
* node,
const
char
*
name
);
118
119
void
UI_RegisterPanelNode
(
uiBehaviour_t
* behaviour);
120
void
UI_StarLayout
(
uiNode_t
* node);
uiAbstractScrollableNode
Definition
ui_node_abstractscrollable.h:35
uiPanelNode
Definition
ui_node_panel.h:29
uiPanelNode::onLoading
void onLoading(uiNode_t *node) override
Handled after the end of the load of the node from script (all data and/or child are set).
Definition
ui_node_panel.cpp:483
uiPanelNode::getClientPosition
void getClientPosition(uiNode_t const *node, vec2_t position) override
Definition
ui_node_panel.cpp:536
uiPanelNode::onMouseLongPress
bool onMouseLongPress(uiNode_t *node, int x, int y, int button) override
Send mouse event when a pressed mouse button is dragged.
Definition
ui_node_panel.cpp:493
uiPanelNode::draw
void draw(uiNode_t *node) override
Handles Button draw.
Definition
ui_node_panel.cpp:54
uiPanelNode::onPropertyChanged
void onPropertyChanged(uiNode_t *node, const value_t *property) override
Definition
ui_node_panel.cpp:542
uiPanelNode::onLoaded
void onLoaded(uiNode_t *node) override
Handled after the end of the load of the node from script (all data and/or child are set).
Definition
ui_node_panel.cpp:530
uiPanelNode::onMouseUp
void onMouseUp(uiNode_t *node, int x, int y, int button) override
Definition
ui_node_panel.cpp:511
uiPanelNode::onScroll
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
Handle mouse wheel scrolling.
Definition
ui_node_panel.cpp:562
uiPanelNode::onStartDragging
bool onStartDragging(uiNode_t *node, int startX, int startY, int currentX, int currentY, int button) override
Send mouse event when a pressed mouse button is dragged.
Definition
ui_node_panel.cpp:506
uiPanelNode::onCapturedMouseMove
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
Definition
ui_node_panel.cpp:517
uiPanelNode::doLayout
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
Definition
ui_node_panel.cpp:443
name
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition
r_gl.h:110
abstractScrollableExtraData_t
Definition
ui_node_abstractscrollable.h:75
panelExtraData_t
extradata for the panel node
Definition
ui_node_panel.h:107
panelExtraData_t::layoutColumns
int layoutColumns
Definition
ui_node_panel.h:111
panelExtraData_t::layoutMargin
int layoutMargin
Definition
ui_node_panel.h:110
panelExtraData_t::wheelScrollable
bool wheelScrollable
Definition
ui_node_panel.h:112
panelExtraData_t::layout
panelLayout_t layout
Definition
ui_node_panel.h:109
panelExtraData_t::background
uiSprite_t * background
Definition
ui_node_panel.h:114
panelExtraData_t::super
abstractScrollableExtraData_t super
Definition
ui_node_panel.h:108
uiBehaviour_t
node behaviour, how a node work
Definition
ui_behaviour.h:39
uiNode_t
Atomic structure used to define most of the UI.
Definition
ui_nodes.h:80
uiSprite_t
Definition
ui_sprite.h:41
value_t
Definition
scripts.h:167
vec2_t
vec_t vec2_t[2]
Definition
ufotypes.h:38
ui_node_abstractscrollable.h
base code for scrollable node
startY
static int startY
Definition
ui_node_editor.cpp:61
startX
static int startX
Definition
ui_node_editor.cpp:60
UI_Panel_SetBackgroundByName
void UI_Panel_SetBackgroundByName(uiNode_t *node, const char *name)
Definition
ui_node_panel.cpp:597
UI_StarLayout
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
Definition
ui_node_panel.cpp:304
UI_RegisterPanelNode
void UI_RegisterPanelNode(uiBehaviour_t *behaviour)
Definition
ui_node_panel.cpp:602
layoutAlign_t
layoutAlign_t
Definition
ui_node_panel.h:59
LAYOUTALIGN_BOTTOMLEFT
@ LAYOUTALIGN_BOTTOMLEFT
Definition
ui_node_panel.h:79
LAYOUTALIGN_V_BOTTOM
@ LAYOUTALIGN_V_BOTTOM
Definition
ui_node_panel.h:70
LAYOUTALIGN_LEFT
@ LAYOUTALIGN_LEFT
Definition
ui_node_panel.h:76
LAYOUTALIGN_TOPRIGHT
@ LAYOUTALIGN_TOPRIGHT
Definition
ui_node_panel.h:75
LAYOUTALIGN_V_MASK
@ LAYOUTALIGN_V_MASK
Definition
ui_node_panel.h:67
LAYOUTALIGN_V_TOP
@ LAYOUTALIGN_V_TOP
Definition
ui_node_panel.h:68
LAYOUTALIGN_V_MIDDLE
@ LAYOUTALIGN_V_MIDDLE
Definition
ui_node_panel.h:69
LAYOUTALIGN_ENSURE_32BIT
@ LAYOUTALIGN_ENSURE_32BIT
Definition
ui_node_panel.h:90
LAYOUTALIGN_TOPLEFT
@ LAYOUTALIGN_TOPLEFT
Definition
ui_node_panel.h:73
LAYOUTALIGN_BOTTOM
@ LAYOUTALIGN_BOTTOM
Definition
ui_node_panel.h:80
LAYOUTALIGN_RIGHT
@ LAYOUTALIGN_RIGHT
Definition
ui_node_panel.h:78
LAYOUTALIGN_NONE
@ LAYOUTALIGN_NONE
Definition
ui_node_panel.h:60
LAYOUTALIGN_H_RIGHT
@ LAYOUTALIGN_H_RIGHT
Definition
ui_node_panel.h:66
LAYOUTALIGN_H_MASK
@ LAYOUTALIGN_H_MASK
Definition
ui_node_panel.h:63
LAYOUTALIGN_H_LEFT
@ LAYOUTALIGN_H_LEFT
Definition
ui_node_panel.h:64
LAYOUTALIGN_H_MIDDLE
@ LAYOUTALIGN_H_MIDDLE
Definition
ui_node_panel.h:65
LAYOUTALIGN_SPECIAL
@ LAYOUTALIGN_SPECIAL
Definition
ui_node_panel.h:84
LAYOUTALIGN_BOTTOMRIGHT
@ LAYOUTALIGN_BOTTOMRIGHT
Definition
ui_node_panel.h:81
LAYOUTALIGN_MAX
@ LAYOUTALIGN_MAX
Definition
ui_node_panel.h:89
LAYOUTALIGN_TOP
@ LAYOUTALIGN_TOP
Definition
ui_node_panel.h:74
LAYOUTALIGN_FILL
@ LAYOUTALIGN_FILL
Definition
ui_node_panel.h:87
LAYOUTALIGN_MIDDLE
@ LAYOUTALIGN_MIDDLE
Definition
ui_node_panel.h:77
panelLayout_t
panelLayout_t
Definition
ui_node_panel.h:45
LAYOUT_COLUMN
@ LAYOUT_COLUMN
Definition
ui_node_panel.h:53
LAYOUT_PACK
@ LAYOUT_PACK
Definition
ui_node_panel.h:50
LAYOUT_LEFT_RIGHT_FLOW
@ LAYOUT_LEFT_RIGHT_FLOW
Definition
ui_node_panel.h:48
LAYOUT_CLIENT
@ LAYOUT_CLIENT
Definition
ui_node_panel.h:52
LAYOUT_ENSURE_32BIT
@ LAYOUT_ENSURE_32BIT
Definition
ui_node_panel.h:56
LAYOUT_BORDER
@ LAYOUT_BORDER
Definition
ui_node_panel.h:49
LAYOUT_TOP_DOWN_FLOW
@ LAYOUT_TOP_DOWN_FLOW
Definition
ui_node_panel.h:47
LAYOUT_MAX
@ LAYOUT_MAX
Definition
ui_node_panel.h:55
LAYOUT_NONE
@ LAYOUT_NONE
Definition
ui_node_panel.h:46
LAYOUT_STAR
@ LAYOUT_STAR
Definition
ui_node_panel.h:51
src
client
ui
node
ui_node_panel.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0