Creating a dialog

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Creating a dialog

Postby Rackle » Wed Dec 27, 2006 01:37

Continued from the Ogre forums

I got some code that shows me the window I tried to create. But closing it does not work. Neither the way described in the DialogSystem example nor trying to destroy the window makes it disappear


Pressing the X of the window corresponds to the FrameWindow::EventCloseClicked event, which is associated with the DialogSystem::cancel action. This action calls upon DialogSystem::onCancel() which calls doClose() of either DialogSystem or your own override through subclassing. The default doClose() function executes CEGUI::WindowManager::getSingleton().getWindow(m_window)->setVisible(false), which hides the dialog. Make sure that setVisible(false) is properly called within a doClose().

Your MagWorldApp::handleEdit() function is initializing/creating many Cegui items. These would need to be undone when you "close" the dialog, otherwise you'll have problems when you call upon handleEdit once again. Either you pre-load those or use a state variable to bypass all the code and only call upon editDialog.doOpen() the second time you start the editor.

Also try to compile the sample as is; the behavior you are seeking should be functional within that demo. If not then there's a problem with your Cegui source code.

Return to “Help”

Who is online

Users browsing this forum: No registered users and 22 guests