]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CGUICheckBox.h
adb46b4197bdfd05a9ac9c94b18fb9e6f9b3ac63
[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 #ifdef _IRR_COMPILE_WITH_GUI_\r
10 \r
11 #include "IGUICheckBox.h"\r
12 \r
13 namespace irr\r
14 {\r
15 namespace gui\r
16 {\r
17 \r
18         class CGUICheckBox : public IGUICheckBox\r
19         {\r
20         public:\r
21 \r
22                 //! constructor\r
23                 CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);\r
24 \r
25                 //! set if box is checked\r
26                 void setChecked(bool checked) override;\r
27 \r
28                 //! returns if box is checked\r
29                 bool isChecked() const override;\r
30 \r
31                 //! Sets whether to draw the background\r
32                 void setDrawBackground(bool draw) override;\r
33 \r
34                 //! Checks if background drawing is enabled\r
35                 /** \return true if background drawing is enabled, false otherwise */\r
36                 bool isDrawBackgroundEnabled() const override;\r
37 \r
38                 //! Sets whether to draw the border\r
39                 void setDrawBorder(bool draw) override;\r
40 \r
41                 //! Checks if border drawing is enabled\r
42                 /** \return true if border drawing is enabled, false otherwise */\r
43                 bool isDrawBorderEnabled() const override;\r
44 \r
45                 //! called if an event happened.\r
46                 bool OnEvent(const SEvent& event) override;\r
47 \r
48                 //! draws the element and its children\r
49                 void draw() override;\r
50 \r
51         private:\r
52 \r
53                 u32 CheckTime;\r
54                 bool Pressed;\r
55                 bool Checked;\r
56                 bool Border;\r
57                 bool Background;\r
58         };\r
59 \r
60 } // end namespace gui\r
61 } // end namespace irr\r
62 \r
63 #endif // __C_GUI_CHECKBOX_H_INCLUDED__\r
64 \r
65 #endif // _IRR_COMPILE_WITH_GUI_\r