Automatic Layouting (horizontal, vertical, grid, ...)
Moderators: CEGUI MVP, CEGUI Team
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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.
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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.
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.
-
- Not too shy to talk
- Posts: 45
- Joined: Wed Aug 25, 2010 00:32
- Location: Buenos Aires - Argentina
Re: Automatic Layouting (horizontal, vertical, grid, ...)
Downloading & Patching... brb with feedback
Edit: Yup, that did the trick, it seems i don't have to call layout() myself anymore
Btw, do you plan to add some kind of spacer and/or some constraint policies?
Edit: Yup, that did the trick, it seems i don't have to call layout() myself anymore
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.
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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.
I might move the layouting calls to Window::render to make this work even without time pulses, but this seemed more logical to me.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Automatic Layouting (horizontal, vertical, grid, ...)
Just a note to say that this patch (or any later version posted here) will go in on Saturday morning.
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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!).
-
- Not too shy to talk
- Posts: 45
- Joined: Wed Aug 25, 2010 00:32
- Location: Buenos Aires - Argentina
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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 ^^
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 ^^
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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.
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.
Re: Automatic Layouting (horizontal, vertical, grid, ...)
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
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 2 guests