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/CGUIStringAttribute.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/CGUIStringAttribute.h')
-rw-r--r-- | libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h b/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h deleted file mode 100644 index af9ac03..0000000 --- a/libraries/irrlicht-1.8.1/tools/GUIEditor/CGUIStringAttribute.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | #ifndef __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__ | ||
2 | #define __C_GUI_STRING_ATTRIBUTE_H_INCLUDED__ | ||
3 | |||
4 | #include "CGUIAttribute.h" | ||
5 | #include "IGUIEditBox.h" | ||
6 | #include "EGUIEditTypes.h" | ||
7 | |||
8 | namespace irr | ||
9 | { | ||
10 | namespace gui | ||
11 | { | ||
12 | |||
13 | class CGUIStringAttribute : public CGUIAttribute | ||
14 | { | ||
15 | public: | ||
16 | // | ||
17 | CGUIStringAttribute(IGUIEnvironment* environment, IGUIElement *parent, s32 myParentID) : | ||
18 | CGUIAttribute(environment, parent, myParentID), | ||
19 | AttribEditBox(0) | ||
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 | AttribEditBox = environment->addEditBox(0, r2, true, this, -1); | ||
27 | AttribEditBox->grab(); | ||
28 | AttribEditBox->setSubElement(true); | ||
29 | AttribEditBox->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); | ||
30 | |||
31 | } | ||
32 | |||
33 | virtual ~CGUIStringAttribute() | ||
34 | { | ||
35 | if (AttribEditBox) | ||
36 | AttribEditBox->drop(); | ||
37 | } | ||
38 | |||
39 | virtual void setAttrib(io::IAttributes *attribs, u32 attribIndex) | ||
40 | { | ||
41 | AttribEditBox->setText(attribs->getAttributeAsStringW(attribIndex).c_str()); | ||
42 | CGUIAttribute::setAttrib(attribs, attribIndex); | ||
43 | } | ||
44 | |||
45 | //! save the attribute and possibly post the event to its parent | ||
46 | virtual bool updateAttrib(bool sendEvent=true) | ||
47 | { | ||
48 | if (!Attribs) | ||
49 | return true; | ||
50 | |||
51 | Attribs->setAttribute(Index, AttribEditBox->getText()); | ||
52 | AttribEditBox->setText(Attribs->getAttributeAsStringW(Index).c_str()); | ||
53 | |||
54 | return CGUIAttribute::updateAttrib(sendEvent); | ||
55 | } | ||
56 | |||
57 | //! Returns the type name of the gui element. | ||
58 | virtual const c8* getTypeName() const | ||
59 | { | ||
60 | return GUIEditElementTypeNames[EGUIEDIT_STRINGATTRIBUTE]; | ||
61 | } | ||
62 | |||
63 | private: | ||
64 | IGUIEditBox* AttribEditBox; | ||
65 | }; | ||
66 | |||
67 | } // namespace gui | ||
68 | } // namespace irr | ||
69 | |||
70 | #endif | ||