OpenMoHAA
0.82.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
public
:
27
str
itemname;
28
str
itemalias;
29
};
30
31
class
UIList :
public
UIWidget {
32
protected
:
33
Container<UIListItem *>
m_itemlist;
34
int
m_currentItem;
35
float
m_arrow_width;
36
UIRect2D
*m_next_arrow_region;
37
UIRect2D
*m_prev_arrow_region;
38
bool
m_depressed;
39
bool
m_held;
40
UIReggedMaterial
*m_prev_arrow;
41
UIReggedMaterial
*m_next_arrow;
42
bool
m_prev_arrow_depressed;
43
bool
m_next_arrow_depressed;
44
45
public
:
46
CLASS_PROTOTYPE( UIList );
47
48
protected
:
49
void
Draw(
void
)
override
;
50
qboolean KeyEvent(
int
key,
unsigned
int
time )
override
;
51
void
CharEvent(
int
ch )
override
;
52
void
Pressed(
Event
*ev );
53
void
Released(
Event
*ev );
54
void
ScrollNext(
void
);
55
void
ScrollPrev(
void
);
56
void
FrameInitialized(
void
)
override
;
57
void
LayoutAddListItem(
Event
*ev );
58
void
AddItem(
str
item
,
str
alias );
59
public
:
60
UIList();
61
~UIList();
62
63
void
UpdateUIElement(
void
)
override
;
64
void
UpdateData(
void
)
override
;
65
};
66
67
class
UIListIndex
:
public
UIList {
68
public
:
69
CLASS_PROTOTYPE(
UIListIndex
);
70
71
qboolean KeyEvent(
int
key,
unsigned
int
time )
override
;
72
};
Container
Definition
container.h:85
Event
Definition
listener.h:246
UIListIndex
Definition
uilist.h:67
UIListItem
Definition
uilist.h:25
UIRect2D
Definition
uirect2d.h:28
UIReggedMaterial
Definition
uiwidget.h:35
item
Definition
uiconsole.h:27
str
Definition
str.h:77
code
uilib
uilist.h
Generated by
1.13.2