Page 1 of 1
Z-order of windows
Posted: Tue Sep 08, 2009 15:10
by LearnerPlates
Hopefully this is a very simple question, though I can't find the answer yet -
How do I stop my windows moving into the foreground / uppermost layer when I click on them? I assume this happens because that window is then in focus. Do I have to set them to disabled to prevent this?
Re: Z-order of windows
Posted: Tue Sep 08, 2009 16:46
by Jamarr
Disabling those windows will prevent them from receiving the focus, but for whatever reason does not prevent the currently active window from losing focus (at least in 0.6.2). If this is not sufficient, then the next obvious solution would be to simply not inject the event - after all, you control what input CEGUI receives. You could use Window::isHit() or System::getWindowContainingMouse() to determine what window, if any, the mouse is over. There are probably other means as well. If you explained why you are doing this, giving an exact solution would be easier.
Re: Z-order of windows
Posted: Wed Sep 09, 2009 03:50
by LearnerPlates
Hi Jamarr
Thanks - disabling them worked fine for what I needed.

The problem was because I had a button on top of a StaticImage, so if you accidentally clicked on the image, it would move to the top layer and obscure the button!
Is there any way to disable windows through the .layout file, or is it necessary to do it through code?
Re: Z-order of windows
Posted: Wed Sep 09, 2009 08:40
by CrazyEddie
Hi,
You can set the disabled state in a layout by way of the "Disabled" property. So:
Code: Select all
<Property Name="Disabled" Value="True" />Note also, if you need the thing enabled, you can also try disabling the "RiseOnClick" setting, though note that this was broken in versions prior to 0.6.2 (I think).
CE.