OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
uilist.h
1/*
2===========================================================================
3Copyright (C) 2024 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
26{
27public:
28 str itemname;
29 str itemalias;
30};
31
32class UIList : public UIWidget
33{
34protected:
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
47public:
48 CLASS_PROTOTYPE(UIList);
49
50protected:
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
62public:
63 UIList();
64 ~UIList();
65
66 void UpdateUIElement(void) override;
67 void UpdateData(void) override;
68};
69
70class UIListIndex : public UIList
71{
72public:
73 CLASS_PROTOTYPE(UIListIndex);
74
75 qboolean KeyEvent(int key, unsigned int time) override;
76};
Definition container.h:85
Definition listener.h:246
Definition uilist.h:71
Definition uilist.h:26
Definition uirect2d.h:29
Definition uiwidget.h:36
Definition uiconsole.h:28
Definition str.h:77