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