[BUG] adding Drag Containers to Windows

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

[BUG] adding Drag Containers to Windows

Postby Van » Wed Oct 28, 2009 21:21

CEGUI: 0.7.1 SVN Branch
Ogre: 1.6.4 SVN
MSVS: 9.0+

We are migrating from 0.6.x to 0.7.x. We are having an issue with DRAG CONTAINERs not properly being added to the parent window. It's hard to describe so I have created a small video to view the problem. Please ignore the window layouts as the schema has not been converted to the 0.7.x format.

What to watch for:
After I click the cargo button note what happens to the two child windows (icons). You will notice that the first icon (drag container) appears at the top left-hand corner of the root GUI sheet however the second icon (drag container) correctly appears contained in the parent. Then watch what happens when I move the parent window (a CEGUI::FrameWindow).

Click to view video (335kb WMV)

Here is what is happening:

1) User clicks CARGO button.
2) Client requests the list of cargo items from the server farm.
3) Server sends back the list.
4) Client parses server messages in a loop:
4a) Reads data from message
4b) Creates an object from our class for each item. A DRAG CONTAINER which has a DefaultWindow to contain the static image.
4c) The DRAG CONTAINER is added to the parent window (which is a CEGUI::ScrollablePane).
4d) The CEGUI::Window::EventChildAdded is fired. The function "arranges" the icons and finally performs a CEGUI::FrameWindow::invalidate( true )

Note that this worked fine under 0.6.x.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: [BUG] adding Drag Containers to Windows

Postby Van » Thu Oct 29, 2009 07:35

The library does not seem to properly honor the CEGUI::Window::invalidate() request. The reason being is that the orphaned window will not "visibly" appear in the frame window unless the frame window is MOVED. Resizing the frame window or adding/removing children has no effect. Only when the frame window is "moved" will the orphaned child visibly appear inside the frame window. This is a visual problem, not a logic problem. As I step through our code, the orphaned window is attached to the parent. This is visually evident because the icons in the frame window are arranged as if it were present.

BigG
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Tue Oct 13, 2009 14:25

Re: [BUG] adding Drag Containers to Windows

Postby BigG » Thu Oct 29, 2009 18:55

I experience that bug as well in my item system. When attaching a CEGUI::DragContainer class to any other CEGUI::Window object via CEGUI::Window::addChildWindow, the children of the DragContainer are somehow wrongly positioned (after several tries about this problem I think it always visually aligns them relative to the PARENT window of the CEGUI::Window object, instead of the CEGUI::Window object itself, which, in your case appears to be the root window. Look at it a bit closer, it has the same offset to [0/0], the left top corner of root as it has in the actual parent window once it has been moved. In my case, I attached the DragContainer to a StaticImage (kind of an item container) and it was positioned relative to the Inventory window (the StaticImage's parent)). I managed to fix this problem by manually attaching all of the DragContainer's child windows in the correct order again AFTER attaching the DragContainer to its new parent. This seems to forcedly invalidate and reposition the single elements correctly (as calling invalidate() manually, be it recursive or not, doesn't resolve this issue), but I doubt this nasty hack is intentioned ;) As mentioned before, all hints linked together seem to be pointing at a bug in the invalidate() function, which I will look into later :)

Greetings,
-BigG

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: [BUG] adding Drag Containers to Windows

Postby Van » Thu Oct 29, 2009 20:11

I have a No Hacking policy. If it doesn't work then it needs to be fixed. Hacking just delays the inevitable.
This is a serious bug and should to be addressed by a CEGUI project developer ASAP.

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Re: [BUG] adding Drag Containers to Windows

Postby Van » Sun Nov 01, 2009 23:40

Would a moderator please move this thread to the BUG REPORTING forum. It will get lost in this forum.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [BUG] adding Drag Containers to Windows

Postby CrazyEddie » Thu Dec 03, 2009 10:23

I didn't look at the video yet, since I can't view it on this machine at the moment. But just wanted to say that I'll look into this and decide if it's an issue or something else...

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [BUG] adding Drag Containers to Windows

Postby CrazyEddie » Sat Dec 05, 2009 13:22

This issue should now be fixed in the stable branch.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 0 guests