Page 1 of 1

[SOLVED] a dialog layout

Posted: Mon Jun 18, 2007 19:14
by IndrekSnt
Hello,
I would like to load a frame window from a layout file for displaying a file selection dialog.

Should I start the layout file with a root GUISheet creation aswell?

Offtopic: Why does UnifiedAreaRect need 8 arguments?
(<Property Name="UnifiedAreaRect" Value="{{0.2,0.0},{0.2,0.0},{0.6,0.0},{0.4,0.0}}" />)

All suggestions are welcome,
Thank You..

Posted: Tue Jun 19, 2007 07:01
by Shades
Offtopic: Why does UnifiedAreaRect need 8 arguments?
(<Property Name="UnifiedAreaRect" Value="{{0.2,0.0},{0.2,0.0},{0.6,0.0},{0.4,0.0}}" />)


I can answer the offtopic bit. The eight values are {scale, offset} for each corner of the rectangle.

Scale is a modifier based on the parents? width, and offset is a pixel offset from wherever scale leaves you.

Posted: Tue Jun 19, 2007 08:47
by IndrekSnt
Thank You,

Actually I used a better solution for the dialog - I put everything in one layout file with the dialogs not visible at first. Then I just show ()-ed and hide ()-d them..

:) I think I just got it.
Without the root window in the layout I would have to create one in the program and add all the child windows manually.
With only one dialog in the layout file, this probably isn't a problem - loadWindowLayout returns the one and only window..
So I don't need any root window in the dialog layout file..

Thank You

Posted: Wed Jun 20, 2007 12:26
by Rackle
For a sample file dialog look at CEGUICommonFileDialog from the Ogre Wiki.

For dialog stuff have a look at DialogSystem for an implementation of dialogs with an Ok, Cancel, and an Apply button as well as DialogConfigurations to save a dialog/window's position and dimentions as well as restoring them the next time they are called. In my opinion DialogConfigurations is required with any GUI; there's nothing that I hate more than a game that forces me to reorganise the layout every single time I start it.

And yes, editing the .layout to remove the automatically created root window is the correct way to go to have one dialog per .layout file; that's what I've been doing for some time now.