OpenMoHAA 0.82.0
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
26public:
27 str itemname;
28 str itemalias;
29};
30
31class UIList : public UIWidget {
32protected:
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
45public:
46 CLASS_PROTOTYPE( UIList );
47
48protected:
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 );
59public:
60 UIList();
61 ~UIList();
62
63 void UpdateUIElement( void ) override;
64 void UpdateData( void ) override;
65};
66
67class UIListIndex : public UIList {
68public:
69 CLASS_PROTOTYPE( UIListIndex );
70
71 qboolean KeyEvent( int key, unsigned int time ) override;
72};
Definition container.h:85
Definition listener.h:246
Definition uilist.h:67
Definition uilist.h:25
Definition uirect2d.h:28
Definition uiwidget.h:35
Definition uiconsole.h:27
Definition str.h:77