OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
uicheckbox.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
25class UICheckBox : public UIWidget {
26 str m_checked_command;
27 str m_unchecked_command;
28 UIReggedMaterial *m_checked_material;
29 UIReggedMaterial *m_unchecked_material;
30 bool m_checked;
31 bool m_depressed;
32 float m_check_width;
33 float m_check_height;
34
35public:
36 CLASS_PROTOTYPE( UICheckBox );
37
38private:
39 void Draw( void ) override;
40 void CharEvent( int ch ) override;
41 void Pressed( Event *ev );
42 void Released( Event *ev );
43 void UpdateCvar( void );
44 void MouseEntered( Event *ev );
45 void MouseExited( Event *ev );
46 void SetCheckedCommand( Event *ev );
47 void SetUncheckedCommand( Event *ev );
48 void SetCheckedShader( Event *ev );
49 void SetUncheckedShader( Event *ev );
50
51public:
52 UICheckBox( void );
53
54 void UpdateData( void ) override;
55 bool isChecked( void );
56};
57
58extern Event EV_UICheckBox_SetCheckedCommand;
59extern Event EV_UICheckBox_SetUncheckedCommand;
60extern Event EV_UICheckBox_SetCheckedShader;
61extern Event EV_UICheckBox_SetUncheckedShader;
Definition listener.h:246
Definition uiwidget.h:35
Definition str.h:77