Page 1 of 1

"Whole App View" Mouse Event question

Posted: Sat Aug 06, 2005 07:41
by paddy
One thing I find trouble with in coding my GUI systems is that events are localized to the window that triggers them. This is good for down/up movement, but I am still looking for a good design pattern that handles tracking mouse drag events that start in one window, then occur anytime the mouse moves until up, even if it is not over a CEGUI window at all.

An example is I have a quad of 4 panels that are my CAD design widgets, you alt+drag and move the mouse up or down, and it zooms in and out, hold the control key, and you can drag the canvas around to pan the canvas.

Right now, as soon as the mouse moves out of the initiating panel's rect, it is no longer generating mouse move events for that panel. If the mouse goes Up in another widget, the widget that was watching the Down never completes its Up counterpart. I can tell visually that the PushButton knows when its up, because no matter where you release the mouse it returns to its normal state when released (unless the mouse is let up after an Alt-Tab to a different application).

It seems a bit top heavy to tell the top level parent to look for all possible events to forward to the generating children, and I doubt that would work for mouse moves outside the top level parent.

I am just looking for good suggestions, I am sure there is an elegant method I have overlooked.

Thanks
Paddy

Re: "Whole App View" Mouse Event question

Posted: Sat Aug 06, 2005 08:39
by CrazyEddie
Look at Window::captureInput
Call this when the mouse button is pressed, and all inputs will come to that window.

Don't forget to release inputs again once you're done dragging.