Layout files

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Revision as of 23:08, 23 June 2014 by Thomas (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

For the time being, this has been copy-and-pasted directly from "readme.txt" in the XMLRefSchema directory of the CEGUI source code. Some prettier formatting along the lines of Scheme files would be nice.

A GUI Layout defines a hierachy of Window based objects to be created and a property settings for each window.
The root element is GUILayout.


GUILayout Element
=================
GUILayout is the root element.
The GUILayout must contain a single Window element only.

GUILayout attributes
--------------------
Version         - Specifies the version of the resource file. Should be specified for all files, current CEGUI layout version is: 4
Parent		- Specifies the name of an existing window that this gui layout should be attached to (optional).


Window Element
==============
The Window element is used to specify a new window object to be created.
The Window element has attributes as described below and may contain any number of nested Window elements, any number of Property elements,
any number of LayoutImport elements, and any number of Event elements.

Window attributes
-----------------
Type		- Specifies the type of Window object to be created (required).
Name		- Specifies the unique name for the Window.  If this is ommitted a name will be generated.  If a window with the name already exists, an exception will be thrown. (optional).


Property Element
================
The Property element is used to set properties on the Window created by the containing Window element.
Property has no sub-elements, but has attributes as described below.

Property attributes
-------------------
Name		- The name of the property to be set.  If no such property exists for the target window, an exception may be thrown.  (required).
Value		- The value to be assigned to the property.  This must be in a format expected by the property or an exception may be thrown.  (required).


LayoutImport Element
====================
The LayoutImport element is used to reference (import) a layout file into another.  The root window of the imported layout is attached to the Window where the import occurrs.
The LayoutImport element has attributes but no sub-elements.

LayoutImport attributes
-----------------------
Filename	- Specifies the filename of the layout XML file to be imported.
ResourceGroup - The resource group identifier to pass to the resource provider when loading the file.


Event Element
=============
The Event element is used to create bindings between Gui elements and script functions.
The Event element has attributes but no sub-elements.

Event attributes
----------------
Name		- Specifies the name of the target event.
Function	- Specifies the name of the script function that is to be bound to the event.