OpenMoHAA
0.83.0
Loading...
Searching...
No Matches
uilist.h
1
/*
2
===========================================================================
3
Copyright (C) 2024 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
21
*/
22
23
#pragma once
24
25
class
UIListItem
26
{
27
public
:
28
str itemname;
29
str itemalias;
30
};
31
32
class
UIList :
public
UIWidget
33
{
34
protected
:
35
Container<UIListItem *>
m_itemlist;
36
int
m_currentItem;
37
float
m_arrow_width;
38
UIRect2D
*m_next_arrow_region;
39
UIRect2D
*m_prev_arrow_region;
40
bool
m_depressed;
41
bool
m_held;
42
UIReggedMaterial
*m_prev_arrow;
43
UIReggedMaterial
*m_next_arrow;
44
bool
m_prev_arrow_depressed;
45
bool
m_next_arrow_depressed;
46
47
public
:
48
CLASS_PROTOTYPE(UIList);
49
50
protected
:
51
void
Draw(
void
)
override
;
52
qboolean KeyEvent(
int
key,
unsigned
int
time)
override
;
53
void
CharEvent(
int
ch)
override
;
54
void
Pressed(Event *ev);
55
void
Released(Event *ev);
56
void
ScrollNext(
void
);
57
void
ScrollPrev(
void
);
58
void
FrameInitialized(
void
)
override
;
59
void
LayoutAddListItem(Event *ev);
60
void
AddItem(str
item
, str alias);
61
62
public
:
63
UIList();
64
~UIList();
65
66
void
UpdateUIElement(
void
)
override
;
67
void
UpdateData(
void
)
override
;
68
};
69
70
class
UIListIndex
:
public
UIList
71
{
72
public
:
73
CLASS_PROTOTYPE(
UIListIndex
);
74
75
qboolean KeyEvent(
int
key,
unsigned
int
time)
override
;
76
};
Container
Definition
g_local.h:81
UIListIndex
Definition
uilist.h:71
UIListItem
Definition
uilist.h:26
UIRect2D
Definition
uirect2d.h:29
UIReggedMaterial
Definition
uiwidget.h:36
item
Definition
uiconsole.h:28
code
uilib
uilist.h
Generated by
1.13.2