Page 1 of 1

Child window position error use different initial order

Posted: Sat Jul 31, 2010 07:57
by rockoz
I met this problem when I was writing a window has at least three layers.

My code is like:

Code: Select all

oRootWindow = winMgr:loadWindowLayout("TestPosWindow.layout")

oSlotWindow = winMgr:createWindow("TaharezLook/StaticImage", "TestSlotWindow")
oSlotWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 5), CEGUI.UDim(0, 15)))
oSlotWindow:setWidth(CEGUI.UDim(0,32))
oSlotWindow:setHeight(CEGUI.UDim(0,32))
   
oContainerWindow = winMgr:createWindow("TaharezLook/StaticImage", "TestContainerWindow")
oContainerWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 10), CEGUI.UDim(0, 10)))
oContainerWindow:setWidth(CEGUI.UDim(0,32))
oContainerWindow:setHeight(CEGUI.UDim(0,32))


Init these windows first and then set their relation in different orders:

code that get right position

Code: Select all

oRootWindow:addChildWindow(oSlotWindow)
oSlotWindow:addChildWindow(oContainerWindow)


result
Image

and code error occurs

Code: Select all

oSlotWindow:addChildWindow(oContainerWindow)
oRootWindow:addChildWindow(oSlotWindow)


result
Image


Is CEGUI windows position must be initialised in the right order or this problem can be solved? :(

Thanks~

Re: Child window position error use different initial order

Posted: Sat Jul 31, 2010 08:04
by rockoz
And in addition, when error occurs, sizing and moving the root window can make the container window back to its right position.
I'm not sure how make this happen, sometimes just move, and sometimes try both sizing and moving once has no effect. Anyway, that's weird :(

Re: Child window position error use different initial order

Posted: Sat Jul 31, 2010 12:48
by CrazyEddie
You forgot to post vital information.

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

Re: Child window position error use different initial order

Posted: Sun Aug 01, 2010 10:30
by rockoz
CrazyEddie wrote:You forgot to post vital information.

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV


Hello CE, is that you cant see pictures I posted?
That is the last thing I expected to happen... :(

I've changed another image hosting space. Wish it will help...

Re: Child window position error use different initial order

Posted: Sun Aug 01, 2010 11:54
by Kulik
rockoz wrote:
CrazyEddie wrote:You forgot to post vital information.

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV


Hello CE, is that you cant see pictures I posted?
That is the last thing I expected to happen... :(

I've changed another image hosting space. Wish it will help...


You have to post what version you are using! Read CE sig and hope he haven't gone mad already :lol:

Re: Child window position error use different initial order

Posted: Sun Aug 01, 2010 13:37
by rockoz
Kulik wrote:
rockoz wrote:
CrazyEddie wrote:You forgot to post vital information.

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV


Hello CE, is that you cant see pictures I posted?
That is the last thing I expected to happen... :(

I've changed another image hosting space. Wish it will help...


You have to post what version you are using! Read CE sig and hope he haven't gone mad already :lol:



Thank you Kulik, the thing I worried about most is you possibly not see pictures I posted.

The version ought to be annonced that I'm using 0.7.1. Sorry guys. :oops:

Re: Child window position error use different initial order

Posted: Sun Aug 01, 2010 18:46
by CrazyEddie
:lol:

I'll have to test it on both 0.7.1 and current v0-7. I have a recollection of fixing many such issues, so it may be fixed already (but may not be, hence the testing!). I'll get back to you soon...

CE.

Re: Child window position error use different initial order

Posted: Mon Aug 02, 2010 01:27
by rockoz
...the thing I worried about most is you possibly not see pictures I posted.


I still dont know whether you can see them.
It is hard to find a linkable image sharing site for me, so please tell me the result.

test 1
Image

test 2
Image

Re: Child window position error use different initial order

Posted: Mon Aug 02, 2010 18:03
by CrazyEddie
Yeah, I've been able to see the images all along. I should have clarified that earlier ;) I'll look into the issue itself soon (i.e. hopefully sometime in the next 7 days).

CE.