aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h')
-rw-r--r--src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h b/src/others/irrlicht-1.8.1/tools/GUIEditor/CGUIDummyEditorStub.h
new file mode 100644
index 0000000..635501a
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/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