Page 1 of 1

CodeSnippets: GridLayout

Posted: Fri Jun 29, 2007 10:42
by razr
I've wikied a layout manager for CEGUI >= 0.5

Feel free to discuss this article here.

Re: CodeSnippets: GridLayout

Posted: Fri Jun 29, 2007 11:03
by ldb
razr wrote:I've wikied a layout manager for CEGUI >= 0.5[

Feel free to discuss this article here.


i havent tried it yet, but oh boy do i intend to. this is just what the doctor ordered.

Posted: Fri Jun 29, 2007 11:38
by Pompei2
oh this is great ! I loved QT for having this and hated MFC for not having this :)

It would be even more great if these could be specified within the .layout files, to achieve this you would need to make the GridLayout be a CEGUI custom widget, I think.

Maybe the two files (.cpp/.h) could be uploaded to the CEGUI server, so if noware.info should go down in the future, these great files are still available !

edit:
there should be a link to the article somewhere on the page, so nobody misses it. maybe in the FAQ, create a point "how to lay out my widgets in a grid like for QT/Gtk" ?

Posted: Wed Jul 04, 2007 05:34
by ldb
my suggestion is to create a contrib directory where code such as this could live. similar to how wxWidgets has a contrib directory in their source release.

just a thought.

Auto layout with XML config

Posted: Fri Jul 20, 2007 09:28
by Oscar.Ken
hi, :D I'v implemented an auto layout system:
http://www.cegui.org.uk/wiki/index.php/User:Oscar.Ken

Posted: Tue Jul 31, 2007 16:18
by razr
ldb wrote:my suggestion is to create a contrib directory where code such as this could live. similar to how wxWidgets has a contrib directory in their source release.

Good idea! Makes me somewhat proud to see my code there :)

EDIT:
Pompei2 wrote:It would be even more great if these could be specified within the .layout files, to achieve this you would need to make the GridLayout be a CEGUI custom widget, I think.

I've been investigating the code base to see if that's possible and I think it is:
One can create a custom GridLayoutWidget with a property defining the layout of its children. The solution via the property is quite ugly though, because it would take a very long string to define the layout of a more complex window (alternatives welcome ;) ).
By the way, using a widget has got another advantage: it is very easy to create stacked layouts by making a GridLayoutWidget a GridLayoutWidget's child.

Posted: Thu Aug 02, 2007 12:19
by Pompei2
you can upload images at imageshack.us, but they disappear after a time.

Posted: Wed Sep 05, 2007 15:20
by daves
Looks nice. I'll let you know once I've tried this. This kind of manager class can be very useful.