aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 17:24:39 +1000
committerDavid Walter Seikel2013-01-13 17:24:39 +1000
commit393b5cd1dc438872af89d334ef6e5fcc59f27d47 (patch)
tree6a14521219942a08a1b95cb2f5a923a9edd60f63 /libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h
parentAdd a note about rasters suggested start up code. (diff)
downloadSledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.zip
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.gz
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.bz2
SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.xz
Added Irrlicht 1.8, but without all the Windows binaries.
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h
new file mode 100644
index 0000000..635501a
--- /dev/null
+++ b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIDummyEditorStub.h
@@ -0,0 +1,59 @@
1/*
2 This is a custom editor for stubbing problematic elements out,
3 for example elements which include modal screens
4*/
5
6#ifndef __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
7#define __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
8
9#include "IGUIElement.h"
10#include "IGUIEnvironment.h"
11#include "IGUIStaticText.h"
12
13namespace irr
14{
15
16namespace gui
17{
18 class CGUIDummyEditorStub : public IGUIElement
19 {
20 public:
21 //! constructor
22 CGUIDummyEditorStub(IGUIEnvironment* environment, IGUIElement *parent, const char *text) :
23 IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
24 TextBox(0), TypeName(text)
25 {
26
27 #ifdef _DEBUG
28 setDebugName("CGUIDummyEditorStub");
29 #endif
30
31 core::dimension2du d = Environment->getSkin()->getFont()->getDimension(L"A");
32 s32 h = d.Height / 2;
33 s32 w = d.Width / 2;
34
35 TextBox = environment->addStaticText(core::stringw(text).c_str(),
36 core::rect<s32>(50-w, 50-h, 50+w, 50+h),
37 false, false, this, -1, false);
38 TextBox->grab();
39 TextBox->setSubElement(true);
40 TextBox->setAlignment(EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER);
41 }
42
43 virtual ~CGUIDummyEditorStub()
44 {
45 if (TextBox)
46 TextBox->drop();
47 }
48 virtual const c8* getTypeName() const { return TypeName.c_str(); }
49
50 protected:
51 IGUIStaticText* TextBox;
52 core::stringc TypeName;
53
54 };
55
56} // namespace gui
57} // namespace irr
58
59#endif