UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_panel.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
28
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
43struct uiBehaviour_t;
44
58
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
116
117void UI_Panel_SetBackgroundByName(uiNode_t* node, const char* name);
118
119void UI_RegisterPanelNode(uiBehaviour_t* behaviour);
120void UI_StarLayout(uiNode_t* node);
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).
void getClientPosition(uiNode_t const *node, vec2_t position) override
bool onMouseLongPress(uiNode_t *node, int x, int y, int button) override
Send mouse event when a pressed mouse button is dragged.
void draw(uiNode_t *node) override
Handles Button draw.
void onPropertyChanged(uiNode_t *node, const value_t *property) override
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).
void onMouseUp(uiNode_t *node, int x, int y, int button) override
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
Handle mouse wheel scrolling.
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.
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
extradata for the panel node
panelLayout_t layout
uiSprite_t * background
abstractScrollableExtraData_t super
node behaviour, how a node work
Atomic structure used to define most of the UI.
Definition ui_nodes.h:80
vec_t vec2_t[2]
Definition ufotypes.h:38
base code for scrollable node
static int startY
static int startX
void UI_Panel_SetBackgroundByName(uiNode_t *node, const char *name)
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
void UI_RegisterPanelNode(uiBehaviour_t *behaviour)
layoutAlign_t
@ LAYOUTALIGN_BOTTOMLEFT
@ LAYOUTALIGN_V_BOTTOM
@ LAYOUTALIGN_LEFT
@ LAYOUTALIGN_TOPRIGHT
@ LAYOUTALIGN_V_MASK
@ LAYOUTALIGN_V_TOP
@ LAYOUTALIGN_V_MIDDLE
@ LAYOUTALIGN_ENSURE_32BIT
@ LAYOUTALIGN_TOPLEFT
@ LAYOUTALIGN_BOTTOM
@ LAYOUTALIGN_RIGHT
@ LAYOUTALIGN_NONE
@ LAYOUTALIGN_H_RIGHT
@ LAYOUTALIGN_H_MASK
@ LAYOUTALIGN_H_LEFT
@ LAYOUTALIGN_H_MIDDLE
@ LAYOUTALIGN_SPECIAL
@ LAYOUTALIGN_BOTTOMRIGHT
@ LAYOUTALIGN_MAX
@ LAYOUTALIGN_TOP
@ LAYOUTALIGN_FILL
@ LAYOUTALIGN_MIDDLE
panelLayout_t
@ LAYOUT_COLUMN
@ LAYOUT_PACK
@ LAYOUT_LEFT_RIGHT_FLOW
@ LAYOUT_CLIENT
@ LAYOUT_ENSURE_32BIT
@ LAYOUT_BORDER
@ LAYOUT_TOP_DOWN_FLOW
@ LAYOUT_MAX
@ LAYOUT_NONE
@ LAYOUT_STAR