sheet / root window events

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
kristian
Just popping in
Just popping in
Posts: 12
Joined: Wed Apr 13, 2005 17:25

sheet / root window events

Postby kristian » Mon Jul 11, 2005 19:08

Hello,
How can i determine if the sheet is clicked, i want to enable "game input" when i click the sheet root window and disable the "game input" when i click and other window.

How is that accomplished or is that possible at all ?

all myy attempts of doing this seems to have failed becourse the mouse click event for the root window is seems to be called even if i dont click the root window.

- Kristian

User avatar
Acrion
Just popping in
Just popping in
Posts: 18
Joined: Tue Jun 28, 2005 18:45
Location: Maine, USA
Contact:

Re: sheet / root window events

Postby Acrion » Tue Jul 12, 2005 17:23

Have you tried EventActivated and EventDeactivated on either all of your widgets or the (doubt it would work as your widgets are children) root sheet?

I never tried MouseClicked but MouseButtonDown and MouseButtonUp work properly on the root for me as of 0.3.0.

Another thing that might be effective is doing something similar to XMouse using MouseEnters/MouseLeaves on your widgets. IE: when you move the mouse over a FrameWindow, your input switches to the form, when it goes over the GUISheet, your input goes to the game.

Hope this helps.
[font=Verdana][size=xx-small]"It's not hard to stand out when the general level of competence is so low" -EMH[/size][/font]
namik@flashmail.com

User avatar
kristian
Just popping in
Just popping in
Posts: 12
Joined: Wed Apr 13, 2005 17:25

Re: sheet / root window events

Postby kristian » Wed Jul 13, 2005 07:53

this is the solution i came up with:

bool GuiEventHandler::_onSheet_MouseClick( const CEGUI::EventArgs& e ) {
CEGUI::Window* c = mGuiSystem->getGUISheet()->getChildAtPosition(((const CEGUI::MouseEventArgs&)e).position);
if( c != 0 ) {
mInputMode = 0;
false;
} else {
mInputMode = 1;
if( mGuiSystem->getGUISheet()->getActiveChild() )
mGuiSystem->getGUISheet()->getActiveChild()->deactivate();
((CEGUI::EventArgs&)e).handled = true;
}
return e.handled;
}


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 9 guests