]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUICheckBox.h
facbfb0558c46f78b802a07db87363016e178f01
[irrlicht.git] / source / Irrlicht / CGUICheckBox.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __C_GUI_CHECKBOX_H_INCLUDED__\r
6 #define __C_GUI_CHECKBOX_H_INCLUDED__\r
7 \r
8 #include "IrrCompileConfig.h"\r
9 #include "IGUICheckBox.h"\r
10 \r
11 namespace irr\r
12 {\r
13 namespace gui\r
14 {\r
15 \r
16         class CGUICheckBox : public IGUICheckBox\r
17         {\r
18         public:\r
19 \r
20                 //! constructor\r
21                 CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);\r
22 \r
23                 //! set if box is checked\r
24                 void setChecked(bool checked) override;\r
25 \r
26                 //! returns if box is checked\r
27                 bool isChecked() const override;\r
28 \r
29                 //! Sets whether to draw the background\r
30                 void setDrawBackground(bool draw) override;\r
31 \r
32                 //! Checks if background drawing is enabled\r
33                 /** \return true if background drawing is enabled, false otherwise */\r
34                 bool isDrawBackgroundEnabled() const override;\r
35 \r
36                 //! Sets whether to draw the border\r
37                 void setDrawBorder(bool draw) override;\r
38 \r
39                 //! Checks if border drawing is enabled\r
40                 /** \return true if border drawing is enabled, false otherwise */\r
41                 bool isDrawBorderEnabled() const override;\r
42 \r
43                 //! called if an event happened.\r
44                 bool OnEvent(const SEvent& event) override;\r
45 \r
46                 //! draws the element and its children\r
47                 void draw() override;\r
48 \r
49         private:\r
50 \r
51                 u32 CheckTime;\r
52                 bool Pressed;\r
53                 bool Checked;\r
54                 bool Border;\r
55                 bool Background;\r
56         };\r
57 \r
58 } // end namespace gui\r
59 } // end namespace irr\r
60 \r
61 #endif // __C_GUI_CHECKBOX_H_INCLUDED__\r