[SOLVED] a dialog layout

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

IndrekSnt
Just popping in
Just popping in
Posts: 5
Joined: Mon Jun 18, 2007 08:48
Contact:

[SOLVED] a dialog layout

Postby IndrekSnt » Mon Jun 18, 2007 19:14

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..
Last edited by IndrekSnt on Tue Jun 19, 2007 10:31, edited 1 time in total.

Shades
Just popping in
Just popping in
Posts: 6
Joined: Thu Jun 14, 2007 18:18

Postby Shades » Tue Jun 19, 2007 07:01

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.

IndrekSnt
Just popping in
Just popping in
Posts: 5
Joined: Mon Jun 18, 2007 08:48
Contact:

Postby IndrekSnt » Tue Jun 19, 2007 08:47

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

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Jun 20, 2007 12:26

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests