Modal focus

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

dewyatt
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Sat Jun 14, 2008 21:26

Modal focus

Postby dewyatt » Tue Aug 05, 2008 21:04

I'm having a bit of trouble with my modal dialogs.
Code:

Code: Select all

mDialog_1->setVisible(true);
mDialog_1->setModalState(true);
mDialog_2->setVisible(true);
mDialog_2->setModalState(true);

Event handler for both (EventCharacterKey):

Code: Select all

bool onDialog_Character(const CEGUI::EventArgs& e)
{
const CEGUI::KeyEventArgs& Args = static_cast<const CEGUI::KeyEventArgs&>(e);
if (Args.codepoint != L' ')
   return true;

mDialog_1/2->setVisible(false);
mDialog_1/2->setModalState(false);
return true;
}

The problem is, after pressing space (which calls the above method), the dialog is closed, but the focus does not go to the window below.
So I have to click on the dialog before pressing space to close it.
This is not what I want, I need to be able to just press space through all the dialogs.

Is there a way to do this without maintaining some sort of stack in my app?

EDIT: Actually, I think I'm going to have to maintain a stack anyways for an unrelated reason but I'd still like to know what's up with this.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Aug 06, 2008 08:19

This reply is basically to just confirm that you have not missed anything; the system does not do any auto-activation of some other window when closing / destroying the window that is active.

CE.

dewyatt
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Sat Jun 14, 2008 21:26

Postby dewyatt » Wed Aug 06, 2008 14:56

Okay, I understand.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests