MessageBox

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
cooky451
Posts: 9
Joined: Sun Jun 26, 2011 12:12 pm
Location: Germany

MessageBox

Post by cooky451 »

Hi,

is there a way to show a window, like the Windows "MessageBox()"? The only way I found was:
(from tutorial code)

Code: Select all

IGUIWindow* window = env->addWindow(
						rect<s32>(100 + Context.counter, 100 + Context.counter, 300 + Context.counter, 200 + Context.counter),
						false, // modal?
						L"Test window");

					env->addStaticText(L"Please close me",
						rect<s32>(35,35,140,50),
						true, // border?
						false, // wordwrap?
						window);
Which needs a IGUIEnvironment* and doesn't take the focus. Is there a way to show a "free" message box which takes the focus?
How do you show your error messages, e.g. "Could not create device."?
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

see CGUIMessageBox in Irrlicht source
cooky451
Posts: 9
Joined: Sun Jun 26, 2011 12:12 pm
Location: Germany

Post by cooky451 »

nespa wrote:see CGUIMessageBox in Irrlicht source
Can't find that. Is CGUIMessageBox declared in irr::gui? Could you post a docu-link, or show me some example how to use?

Edit:
Ok, I found:

Code: Select all

Device->getGUIEnvironment()->addMessageBox(
                Caption.c_str(), MessageText.c_str());
But this still needs a device createt. Is there a way to show a message box without creating a device?
Last edited by cooky451 on Tue Jun 28, 2011 8:07 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9718
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

The gui-environment has a function addMessageBox
See documentation: http://irrlicht.sourceforge.net/docu/cl ... 728098a917
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
cooky451
Posts: 9
Joined: Sun Jun 26, 2011 12:12 pm
Location: Germany

Post by cooky451 »

CuteAlien wrote:The gui-environment has a function addMessageBox
See documentation: http://irrlicht.sourceforge.net/docu/cl ... 728098a917
Thanks for helping me, but I found it just right now. (See edit of post above)
cooky451 wrote:But this still needs a device createt. Is there a way to show a message box without creating a device?
CuteAlien
Admin
Posts: 9718
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

No, everything in Irrlicht needs a device. Otherwise we couldn't know how to draw the MessageBox (which is using the Irrlicht GUI).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply