Crazy Eddie's GUI System  0.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Layout XML files.
Author
Paul D Turner

A layout XML file defines a hierachy of window based objects to be created, with property and event binding information for each window.

Layout Element List:

<AutoWindow> Element
<Event> Element
<GUILayout> Element
<LayoutImport> Element
<Property> Element
<Window> Element


Overview

The reference for each element is arranged into sections, as described below:

  • Purpose:
    • This section describes what the elements general purpose is within the specifications.
  • Attributes:
    • This section describes available attributes for the elements, and whether they are required or optional.
  • Usage:
    • Describes where the element may appear, whether the element may have sub-elements, and other important usage information.
  • Examples:
    • For many elements, this section will contain brief examples showing the element used in context.


<GUILayout> Element

  • Purpose:
    • <GUILayout> is the root element in layout XML files.
  • Attributes:
    • version: specifies the version of the resource file. Should be specified for all files, current CEGUI layout version is: 4
  • Usage:
    • The <GUILayout> element is the root element for layout files.
    • The <GUILayout> element must contain a single <Window> element.
    • No element may contain a <GUILayout> element as a sub-element.
  • Examples:


<Window> Element

  • Purpose:
    • The <Window> element is used to specify a new window object to be created.
  • Attributes:
    • type: Specifies the type of window to be created. This may refer to a concrete window type, an alias, or a falagard mapped type. Required attribute.
    • name: Specifies the name to give the window. Window names must be unique within the system. Optional attribute, if the attribute is not specified a name will be generated automatically.
  • Usage:
    • The <Window> may appear as a sub-element of the following:
      • <GUILayout> elements.
      • <Window> elements.
      • <AutoWindow> elements.
    • The <Window> element may contain the following sub-elements:
      • Any number of <LayoutImport> elements. Followed by,
      • Any number of <Property> elements. Followed by,
      • Any number of <Event> elements. Followed by,
      • Any number of <Window> elements.
      • Any number of <AutoWindow> elements.
      • Finally, any number of <Property> elements (again).
  • Examples:


<Property> Element

  • Purpose:
    • The <Property> element is used to set properties on the Window created by the containing <Window> element.
  • Attributes:
    • name: Specifies the name of the property to set. Required attribute.
    • value: Specifies the value to set on the property. Optional attribute, if the attribute is not specified the value to be set should be given via the element text content.
  • Usage:
    • The <Property> may appear as a sub-element of <Window> elements and <AutoWindow> elements.
    • The <Property> element may not contain any sub-elements.
    • The <Property> element may contain text content to be used as the value.
  • Examples:


<Event> Element

  • Purpose:
    • The Event element is used to create bindings between GUI elements and script functions.
  • Attributes:
    • name: Specifies the name of the event to which the handler function specified by the Function attribute will be subscribed. Required attribute.
    • function: Specifis the name of a script function to be subscribed to the event specified by the Name attribute. Required attribute.
  • Usage:
    • The <Event> may appear as a sub-element of <Window> elements and <AutoWindow> elements.
    • The <Event> element may not contain any sub-elements.
  • Examples:


<LayoutImport> Element

  • Purpose:
    • 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.
  • Attributes:
    • filename: Specifies the path to the xml layout file to be imported. Required attribute.
    • resourceGroup: Specifies the resource group identifier to pass to the ResourceProvider when loading the file given in the Filename attribute. Optional attribute, default is the WindowManager default group.
  • Usage:
    • The <LayoutImport> may appear as a sub-element of <Window> elements and <AutoWindow> elements.
    • The <LayoutImport> element may not contain any sub-elements.
  • Examples:


<AutoWindow> Element

  • Purpose:
    • The <AutoWindow> element is used to target property settings, events and other content on to an automatically created child window of the current Window (or AutoWindow).
  • Attributes:
    • namePath: Specifies the name path for the target auto-window. Required attribute.
  • Usage:
    • The <AutoWindow> may appear as a sub-element of the following:
      • <Window> elements.
      • <AutoWindow> elements.
    • The <AutoWindow> element may contain the following sub-elements:
      • Any number of <LayoutImport> elements. Followed by,
      • Any number of <Property> elements. Followed by,
      • Any number of <Event> elements. Followed by,
      • Any number of <Window> elements.
      • Any number of <AutoWindow> elements.
      • Finally, any number of <Property> elements (again).
  • Examples: