Have a layout *not* handle all inputs
Posted: Sat Aug 16, 2008 04:12
I've wasted half a day trying to get something pretty basic working, so I guess I'm missing something, well, basic
I want to show a layout with some windows, on top of my game. When the layout windows are clicked, I want them naturally to handle those clicks, and when the click is outside of those windows, I want them to not handle it so I know to pass the click on to my actual game.
But I can't get this to work. If the layout has a root window which covers the entire window (but transparent so I can see the game behind it), then it captures input. Specifically, it captures every *other* input, since RiseOnClck is enabled - the invisible parent layout window 'rises', no matter where I click. Which makes sense I guess since it covers the entire screen. Now, setting RiseOnClick to False doesn't work, because then the _child_ windows don't rise anymore, and I need them to react when clicked. I've also tried setting PassthroughEnabled on the root window (so it wouldn't rise when clicked, the click would 'pass through'), but RiseOnClick ignores the passthrough property - the click is stil handled despite PassthroughEnabled being true.
The other solution seems to be to not have a parent root window in the layout which covers the entire screen. So say the layout just contains a single small window somewhere. But this doesn't work either, because when I click, getTargetWindow returns the small window in my layout, even though the click isn't on it - because that window is the 'active sheet'.
I honestly at this point have no further ideas about how to solve this, so I'm posting here...
I want to show a layout with some windows, on top of my game. When the layout windows are clicked, I want them naturally to handle those clicks, and when the click is outside of those windows, I want them to not handle it so I know to pass the click on to my actual game.
But I can't get this to work. If the layout has a root window which covers the entire window (but transparent so I can see the game behind it), then it captures input. Specifically, it captures every *other* input, since RiseOnClck is enabled - the invisible parent layout window 'rises', no matter where I click. Which makes sense I guess since it covers the entire screen. Now, setting RiseOnClick to False doesn't work, because then the _child_ windows don't rise anymore, and I need them to react when clicked. I've also tried setting PassthroughEnabled on the root window (so it wouldn't rise when clicked, the click would 'pass through'), but RiseOnClick ignores the passthrough property - the click is stil handled despite PassthroughEnabled being true.
The other solution seems to be to not have a parent root window in the layout which covers the entire screen. So say the layout just contains a single small window somewhere. But this doesn't work either, because when I click, getTargetWindow returns the small window in my layout, even though the click isn't on it - because that window is the 'active sheet'.
I honestly at this point have no further ideas about how to solve this, so I'm posting here...