summaryrefslogtreecommitdiff
path: root/tools/GUIEditor/CGUIDummyEditorStub.h
diff options
context:
space:
mode:
authorMirrorbot <mirrorbot@cogarr.net>2025-12-27 17:53:06 -0600
committerMirrorbot <mirrorbot@cogarr.net>2025-12-27 17:53:06 -0600
commit71e94ee161447b84c0eaabf6567f8fa62262cd3e (patch)
tree391064cc6173a6fe75069af2fdc1978af12f623e /tools/GUIEditor/CGUIDummyEditorStub.h
downloadirrlicht-master.tar.gz
irrlicht-master.tar.bz2
irrlicht-master.zip
Inital commitHEADmaster
Diffstat (limited to 'tools/GUIEditor/CGUIDummyEditorStub.h')
-rw-r--r--tools/GUIEditor/CGUIDummyEditorStub.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/GUIEditor/CGUIDummyEditorStub.h b/tools/GUIEditor/CGUIDummyEditorStub.h
new file mode 100644
index 0000000..635501a
--- /dev/null
+++ b/tools/GUIEditor/CGUIDummyEditorStub.h
@@ -0,0 +1,59 @@
+/*
+ This is a custom editor for stubbing problematic elements out,
+ for example elements which include modal screens
+*/
+
+#ifndef __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
+#define __C_GUI_DUMMY_EDITOR_STUB_H_INCLUDED__
+
+#include "IGUIElement.h"
+#include "IGUIEnvironment.h"
+#include "IGUIStaticText.h"
+
+namespace irr
+{
+
+namespace gui
+{
+ class CGUIDummyEditorStub : public IGUIElement
+ {
+ public:
+ //! constructor
+ CGUIDummyEditorStub(IGUIEnvironment* environment, IGUIElement *parent, const char *text) :
+ IGUIElement(EGUIET_ELEMENT, environment, parent, -1, core::rect<s32>(0, 0, 100, 100) ),
+ TextBox(0), TypeName(text)
+ {
+
+ #ifdef _DEBUG
+ setDebugName("CGUIDummyEditorStub");
+ #endif
+
+ core::dimension2du d = Environment->getSkin()->getFont()->getDimension(L"A");
+ s32 h = d.Height / 2;
+ s32 w = d.Width / 2;
+
+ TextBox = environment->addStaticText(core::stringw(text).c_str(),
+ core::rect<s32>(50-w, 50-h, 50+w, 50+h),
+ false, false, this, -1, false);
+ TextBox->grab();
+ TextBox->setSubElement(true);
+ TextBox->setAlignment(EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER, EGUIA_CENTER);
+ }
+
+ virtual ~CGUIDummyEditorStub()
+ {
+ if (TextBox)
+ TextBox->drop();
+ }
+ virtual const c8* getTypeName() const { return TypeName.c_str(); }
+
+ protected:
+ IGUIStaticText* TextBox;
+ core::stringc TypeName;
+
+ };
+
+} // namespace gui
+} // namespace irr
+
+#endif