How can I get exit event from 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
keynet
Posts: 18
Joined: Wed Jun 27, 2012 9:07 am

How can I get exit event from MessageBox?

Post by keynet »

Hi.

I added a message box into current GUIEnvironment, using dev->getGUIEnvironment()->addMessageBox(...);

What I want to do is that if user clicks OK button of message box, then some event( ex. set focus of GUIEnvironment to other element, etc.) occurs.

So I made codes like below :

Code: Select all

 
...
dev->getGUIEnviroment()->addMessageBox( _T("Notice"), _T("") );
dev->getGUIEnvironment()->setFocus( someOtherElement );
...
 
But the result wasn't what I want. It seems irrlicht ignores the setFocus part if I clicked the OK of messageBox.

How can I get exit event (i.e., the event that occurs when user clicks the OK button of message box so that the message box will disappear) from the message box, so that I can set some other events according to that?

Does anybody has a solution for this?
From Seoul, South Korea
CuteAlien
Admin
Posts: 9933
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How can I get exit event from MessageBox?

Post by CuteAlien »

There are 4 events which you can catch in your eventreceiver: EGET_MESSAGEBOX_YES, EGET_MESSAGEBOX_NO, EGET_MESSAGEBOX_OK, EGET_MESSAGEBOX_CANCEL .
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