diff options
author | David Walter Seikel | 2016-03-28 22:28:34 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-28 22:28:34 +1000 |
commit | 7028cbe09c688437910a25623098762bf0fa592d (patch) | |
tree | 10b5af58277d9880380c2251f109325542c4e6eb /libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h | |
parent | Move lemon to the src/others directory. (diff) | |
download | SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.zip SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.gz SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.bz2 SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.xz |
Move Irrlicht to src/others.
Diffstat (limited to 'libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h')
-rw-r--r-- | libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h b/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h deleted file mode 100644 index b0521db..0000000 --- a/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIBoolAttribute.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | #ifndef __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__ | ||
2 | #define __C_GUI_BOOL_ATTRIBUTE_H_INCLUDED__ | ||
3 | |||
4 | #include "CGUIAttribute.h" | ||
5 | #include "IGUICheckBox.h" | ||
6 | #include "EGUIEditTypes.h" | ||
7 | |||
8 | namespace irr | ||
9 | { | ||
10 | namespace gui | ||
11 | { | ||
12 | |||
13 | class CGUIBoolAttribute : public CGUIAttribute | ||
14 | { | ||
15 | public: | ||
16 | // | ||
17 | CGUIBoolAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) : | ||
18 | CGUIAttribute(environment, parent, myParentID), AttribCheckBox(0) | ||
19 | { | ||
20 | |||
21 | core::rect<s32> r = getAbsolutePosition(); | ||
22 | core::rect<s32> r2(0, Environment->getSkin()->getFont()->getDimension(L"A").Height + 10, | ||
23 | r.getWidth() - 5, | ||
24 | Environment->getSkin()->getFont()->getDimension(L"A").Height*2 + 15 ); | ||
25 | |||
26 | AttribCheckBox = environment->addCheckBox(false, r2, this); | ||
27 | AttribCheckBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); | ||
28 | AttribCheckBox->setSubElement(true); | ||
29 | AttribCheckBox->grab(); | ||
30 | } | ||
31 | |||
32 | virtual ~CGUIBoolAttribute() | ||
33 | { | ||
34 | if (AttribCheckBox) | ||
35 | AttribCheckBox->drop(); | ||
36 | } | ||
37 | |||
38 | virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex) | ||
39 | { | ||
40 | AttribCheckBox->setChecked(attribs->getAttributeAsBool(attribIndex)); | ||
41 | CGUIAttribute::setAttrib(attribs, attribIndex); | ||
42 | } | ||
43 | |||
44 | // save the attribute and possibly post the event to its parent | ||
45 | virtual bool updateAttrib(bool sendEvent=true) | ||
46 | { | ||
47 | if (!Attribs) | ||
48 | return true; | ||
49 | |||
50 | Attribs->setAttribute(Index, AttribCheckBox->isChecked()); | ||
51 | |||
52 | return CGUIAttribute::updateAttrib(sendEvent); | ||
53 | } | ||
54 | |||
55 | //! Returns the type name of the gui element. | ||
56 | virtual const c8* getTypeName() const | ||
57 | { | ||
58 | return GUIEditElementTypeNames[EGUIEDIT_BOOLATTRIBUTE]; | ||
59 | } | ||
60 | |||
61 | private: | ||
62 | IGUICheckBox* AttribCheckBox; | ||
63 | }; | ||
64 | |||
65 | } // namespace gui | ||
66 | } // namespace irr | ||
67 | |||
68 | #endif | ||