Automatic Layouting (horizontal, vertical, grid, ...)

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby Kulik » Tue Aug 31, 2010 17:54

Yeah you're right. I got lucky and reproduced it! It arises pretty often it seems but I missed it initially. I am working on a fix! Basically the order of the layout containers updated is now outside-in whilst it has to be inside-out.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby Kulik » Tue Aug 31, 2010 18:40

Ok, could you please check if this patch works for you? It seems to have solved all problems with nested containers for me.
http://harcov.czenet.com/kulik/CEGUI/nestedLayoutContainers.patch

I have to check with CE if it's OK to make Window::update(..) virtual... Take this as an unofficial patch for now.

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby IR3uL » Tue Aug 31, 2010 20:57

Downloading & Patching... brb with feedback :)

Edit: Yup, that did the trick, it seems i don't have to call layout() myself anymore :D

Btw, do you plan to add some kind of spacer and/or some constraint policies?
Last edited by IR3uL on Tue Aug 31, 2010 21:16, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby Kulik » Tue Aug 31, 2010 21:12

Ok, I am on IRC freenode/#cegui. Just to add a note: With this patch you have to call CEGUI::System::injectTimePulse, otherwise layouting will never happen. Lots of users don't realise that because most of CEGUI works even without injecting time pulses.

I might move the layouting calls to Window::render to make this work even without time pulses, but this seemed more logical to me.

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

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby CrazyEddie » Thu Sep 02, 2010 08:34

Just a note to say that this patch (or any later version posted here) will go in on Saturday morning.

CE.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby Kulik » Thu Sep 09, 2010 09:06

IR3uL wrote:Btw, do you plan to add some kind of spacer and/or some constraint policies?


I haven't noticed this :-) It certainly is possible to do spacers and constraints but I don't have any specific ideas at the moment partly because I don't need this functionality. How would you like them to work? You can already do a spacer with "DefaultWindow" or using the "Margin" property (Margin will only work when the window is inside a layout container!).

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby IR3uL » Fri Sep 10, 2010 15:13

Something similar to the Qt behavior would be cool. I don't know how other GUI systems works.

I already implemented some stuff like that, but it's more like a "hack" =D Doing it inside CEGUI might be a lot better (i would do it myself and send you a patch, but my understanding of CEGUI internals are not too good yet).

PS: You saved me twice man... i discovered the animation system a few days ago ^^

User avatar
AndiNo
Just popping in
Just popping in
Posts: 1
Joined: Wed Dec 08, 2010 14:56

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby AndiNo » Wed Dec 08, 2010 23:43

I hope this thread isn't too old, but it seems it's the only one related to layout containers.
Today I tried to use the GridLayoutContainer. Although the documentaion is a little sparse I worked out a way how I thought things worked. In the end it took me several hours to find a problem I had. I'm using DefaultWindows to fill the grid layout which have a StaticImage and StaticText as children. I think the problem was that each DefaultWindow defaults to filling out the whole parent window space. That way I could always only see one big window in my grid layout. Hence my suggestion: It should be possible to set the maximum size of each GridLayoutContainer "cell" (or for all cells). Maybe the default could then be something smaller than the whole parent window. Maybe this isn't necessary, however I think it makes sense and can eliminate some future confusion for others.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Automatic Layouting (horizontal, vertical, grid, ...)

Postby Kulik » Thu Dec 09, 2010 00:06

Yes the documentation is sparse. I want to give layout containers an overhaul for 0.8 to give them more Qt-like behaviour.

You actually only have to set sizes of each element in the grid, the layout container takes care of positions. The sizes are relative the the parent of the grid, not the size of the grid itself.

Here is a little wiki page that never got finished - http://www.cegui.org.uk/wiki/index.php/Layout_Containers


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests