UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_node_baseinventory.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 "ui_node_container.h"
29 
31 public:
32  void initNode(uiNode_t* node) override;
33  void draw(uiNode_t* node) override;
34  void drawTooltip(const uiNode_t* node, int x, int y) const override;
35 
36  void onMouseDown(uiNode_t* node, int x, int y, int button) override;
37  void onMouseUp(uiNode_t* node, int x, int y, int button) override;
38  bool onScroll(uiNode_t* node, int deltaX, int deltaY) override;
39  void onCapturedMouseMove(uiNode_t* node, int x, int y) override;
40  void onWindowOpened(uiNode_t* node, linkedList_t* params) override;
41  void onLoading(uiNode_t* node) override;
42  void onLoaded(uiNode_t* node) override;
43  bool onDndEnter(uiNode_t* node) override;
44  bool onDndMove(uiNode_t* node, int x, int y) override;
45  void onDndLeave(uiNode_t* node) override;
46 };
47 
48 /* prototypes */
49 struct uiBehaviour_t;
50 
51 typedef struct baseInventoryExtraData_s {
53 
56 
57  int columns;
65 
66  /* scroll status */
68  /* scroll callback when the status change */
73 
77 CASSERT(offsetof(baseInventoryExtraData_t, super) == 0);
78 
containerExtraData_t super
struct baseInventoryExtraData_s baseInventoryExtraData_t
void draw(uiNode_t *node) override
Main function to draw a container node.
int LUA_EVENT
holds a reference to a lua event handler
Definition: scripts_lua.h:49
void onCapturedMouseMove(uiNode_t *node, int x, int y) override
void onMouseDown(uiNode_t *node, int x, int y, int button) override
void initNode(uiNode_t *node) override
void onLoading(uiNode_t *node) override
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
Call when we open the window containing the node.
void onMouseUp(uiNode_t *node, int x, int y, int button) override
extradata for container widget
void onDndLeave(uiNode_t *node) override
Call when a DND enter into the node.
bool onScroll(uiNode_t *node, int deltaX, int deltaY) override
Atomic structure used to define most of the UI.
Definition: ui_nodes.h:80
base code for scrollable node
struct uiAction_s * onViewChange
bool onDndEnter(uiNode_t *node) override
Call when a DND enter into the node.
void onLoaded(uiNode_t *node) override
Calculates the size of a container node and links the container into the node (uses the invDef_t shap...
node behaviour, how a node work
Definition: ui_behaviour.h:39
Scroll representation.
bool onDndMove(uiNode_t *node, int x, int y) override
Call into the target when the DND hover it.
void UI_RegisterBaseInventoryNode(uiBehaviour_t *behaviour)
Atomic element to store UI scripts The parser use this atom to translate script action into many tree...
Definition: ui_actions.h:144
void drawTooltip(const uiNode_t *node, int x, int y) const override
Custom tooltip for container node.
CASSERT(offsetof(baseInventoryExtraData_t, super)==0)