Modal focus
Posted: Tue Aug 05, 2008 21:04
I'm having a bit of trouble with my modal dialogs.
Code:
Event handler for both (EventCharacterKey):
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.
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.