Crazy Eddies GUI System
0.7.7
|
The following pages contain reference material for the XML elements defined for the Falagard skin definition files.
Overview
<AbsoluteDim> Element
<Area> Element
<AreaProperty> Element
<Child> Element
<ColourProperty> Element
<ColourRectProperty> Element
<Colours> Element
<Dim> Element
<DimOperator> Element
<Falagard> Element
<FontDim> Element
<FontProperty> Element
<FrameComponent> Element
<HorzAlignment> Element
<HorzFormat> Element
<HorzFormatProperty> Element
<Image> Element
<ImageDim> Element
<ImageryComponent> Element
<ImageProperty> Element
<ImagerySection> Element
<Layer> Element
<NamedArea> Element
<Property> Element
<PropertyDefinition> Element
<PropertyLinkDefinition> Element
<PropertyLinkTarget> Element
<PropertyDim> Element
<Section> Element
<StateImagery> Element
<Text> Element
<TextComponent> Element
<TextProperty> Element
<UnifiedDim> Element
<VertAlignment> Element
<VertFormat> Element
<VertFormatProperty> Element
<WidgetDim> Element
<WidgetLook> Element
The reference for each element is arranged into sections, as described below:
This section describes what the elements general purpose is within the specifications.
This section describes available attributes for the elements, and whether they are required or optional.
Describes where the element may appear, whether the element may have sub-elements, and other important usage information.
For many elements, this section will contain brief examples showing the element used in context.
The <AbsoluteDim>
element is used to define a component dimension for an area rectangle. <AbsoluteDim>
is used to specify absolute pixel values for a dimension.
value
specifies the a number of pixels. Required attribute.<AbsoluteDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <AbsoluteDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <AbsoluteDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation.The following shows <AbsoluteDim>
used to define an area rectangle. In the example, all four component dimensions of the area rectangle are specified using <AbsoluteDim>
:
The following shows <AbsoluteDim>
in use as part of a dimension calculation sequence. In the example the left edge is being set to the width of the child widget 'myWidget' minus two pixels:
Finally, we see <AbsoluteDim>
as the starting dimension for a dimension calculation sequence. In the example, we are adding the value of some window property to the starting absolute value of six:
The <Area>
element is a simple container element for the <Dim>
dimension elements, or a single <AreaProperty>
element, in order to form a rectangular area. <Area>
is generally used to define target regions which are to be used for rendering imagery, text, to place a component child widget, or to form 'named' areas required by the base widget.
<Area>
has no attributes.
The <Area>
element must contain either:
A single <AreaProperty>
element that describes a URect type property where the final area can be obtained.
<Dim>
elements: <Dim>
element must define the left edge or x position. <Dim>
element must define the top edge or y position. <Dim>
element must define either the right edge or width. <Dim>
element must define either the bottom edge or height. <Area>
element may appear in any of the following elements: <Child>
to define the target area to be occupied by a child widget. <ImageryComponent>
to define the target rendering area of an image. <NamedArea>
to define an area which can be retrieved by name. <TextComponent>
to define the target rendering area of some text. <FrameComponent>
to define the target rendering area for a frame. In this example we can see a named area being defined:
The <AreaProperty>
element is intended to allow the system to access a property on the target window to obtain the final target area of a component being defined.
name
specifies the name of the property to access. The named property must access a URect value. Required attribute.<AreaProperty>
element may not contain sub-elements. <AreaProperty>
element may appear as a sub-element only within the main <Area>
element.The <Child>
element defines a component widget that will be created and added to each instance of any window using the <WidgetLook>
being defined. Some base widgets have requirements for <Child>
element definition that must be provided.
type
specifies the widget type to create. Required attribute. nameSuffix
specifies a suffix which will be used when naming the widget. The final name of the child widget will be that of the parent with this suffix appended. Required attribute. look
specifies the name of a widget look to apply to the child widget. You should only use this if 'type' specifies a Falagard base widget type. Optional attribute.Note: the sub-elements should appear in the order that they are defined here.
<Child>
element must contain an <Area>
element that defines the location of the child widget in relation to the component being defined. <VertAlignment>
element to set the vertical alignment for the child. <HorzAlignment>
element to set the horizontal alignment for the child. <Property>
elements to set default values for any property supported by the widget type being used for the child. <Child>
element may only appear within the <WidgetLook>
element. In this example, taken from TaharezLook.looknfeel, we see how the title bar child widget required by the frame window type is defined:
The <ColourProperty>
element is intended to allow the system to access a property on the target window to obtain colour information to be used when drawing some part of the component being defined.
name
specifies the name of the property to access. The named property must access a single colour value. Required attribute.The <ColourProperty>
element may not contain sub-elements.
<ColourProperty>
element may appear as a sub-element within any of the following elements: <ImageryComponent>
to specify a modulating colour to be applied when rendering the image. <ImagerySection>
to specify a modulating colour to be applied to all imagery components within the imagery section as it is rendered. <Section>
to specify a modulating colour to be applied to all imagery in the named section as it is rendered. <TextComponent>
to specify a colour to use when rendering the text component. <FrameComponent>
to specify a colour to use when rendering the text frame. The following example, listing imagery for a button in the "Normal" state, shows the <ColourProperty>
element in use to specify a property where colours to be used when rendering the ImagerySection named 'label' can be found:
The <ColourRectProperty
> element is intended to allow the system to access a property on the target window to obtain colour information to be used when drawing some part of the component being defined.
name
specifies the name of the property to access. The named property must access a ColourRect value. Required attribute.The <ColourRectProperty>
element may not contain sub-elements.
<ColourRectProperty>
element may appear as a sub-element within any of the following elements: <ImageryComponent>
to specify a modulating ColourRect to be applied when rendering the image. <ImagerySection>
to specify a modulating ColourRect to be applied to all imagery components within the imagery section as it is rendered. <Section>
to specify a modulating ColourRect to be applied to all imagery in the named section as it is rendered. <TextComponent>
to specify a ColourRect to use when rendering the text component. <FrameComponent>
to specify a colour to use when rendering the text frame. The <Colours>
element is used to explicitly specify values for a ColourRect that should be used when rendering some part of the component being defined.
topLeft
specifies a hex colour value, of the form "AARRGGBB", to be used for the top-left corner of the ColourRect. Required attribute. topRight
specifies a hex colour value, of the form "AARRGGBB", to be used for the top-right corner of the ColourRect. Required attribute. bottomLeft
specifies a hex colour value, of the form "AARRGGBB", to be used for the bottom-left corner of the ColourRect. Required attribute. bottomRight
specifies a hex colour value of the form "AARRGGBB", to be used for the bottom-right corner of the ColourRect. Required attribute.The <Colours>
element may not contain sub-elements.
<Colours>
element may appear as a sub-element within any of the following elements: <ImageryComponent>
to specify a modulating ColourRect to be applied when rendering the image. <ImagerySection>
to specify a modulating ColourRect to be applied to all imagery components within the imagery section as it is rendered. <Section>
to specify a modulating ColourRect to be applied to all imagery in the named section as it is rendered. <TextComponent>
to specify a ColourRect to use when rendering the text component. <FrameComponent>
to specify a colour to use when rendering the text frame. In this example, we see the <Colours>
element used to specify the value 'FFFFFF00' as the colour for all four corners of the colour rect to be used when rendering the image being defined:
The <Dim>
element is intended as a container element for a single dimension of an area rectangle.
type
specifies what the dimension being defined represents. This attribute should be set to one of the values defined for the DimensionType enumeration (see below). Required attribute.The <Dim>
element may only appear within the <Area>
element.
<Dim>
element may contain any of the following specialised dimension elements: <AbsoluteDim>
<FontDim>
<ImageDim>
<PropertyDim>
<UnifiedDim>
<WidgetDim>
The <DimOperator>
element allows you to combine two of the specialised dimension specifier elements via a simple mathematical operator. Since the dimension used as the second operand may also contain a <DimOperator>
it is possible to create quite complex operations.
Of important note is the fact that in a large chain of operations, the calculations are done in reverse order. Also, there is no operator precedence as such, all operations are applied linearly.
op
specifies one of the vales from the DimensionOperator enumeration indicating the mathematical operation to be performed. Required attribute.A single <DimOperator>
element may appear as a sub-element within any of the following specialised dimension elements:
<AbsoluteDim>
<FontDim>
<ImageDim>
<PropertyDim>
<UnifiedDim>
<WidgetDim>
<DimOperator>
element may contain any of the following specialised dimension elements: <AbsoluteDim>
<FontDim>
<ImageDim>
<PropertyDim>
<UnifiedDim>
<WidgetDim>
The following multiplies two simple AbsoluteDim dimensions:
The next example takes the height of the font used for the target window, adds four pixels and multiplies the result by two.
Note the effectively reversed order and lack of 'normal' operator precedence, the operation performed will be:
and not:
The <Falagard>
element is the root element in Falagard XML skin definition files. The element serves mainly as a container for <WidgetLook>
elements
Element <Falagard>
has no attributes.
<Falagard>
element is the root element for Falagard skin files. <Falagard>
element may contain any number of <WidgetLook>
elements. <Falagard>
elements as a sub-element. Here we just see the general structure of a Falagard XML file, notice that the <Falagard>
element just serves as a container for multiple <WidgetLook>
elements:
The <FontDim>
element is used to take some measurement of a Font, and use it as a dimension component of an area rectangle.
widget
specifies the name suffix of a child window to access when automatically obtaining the font or text string to be used when calculating the dimension's value. The final name used to access the widget will be that of the target window with this suffix appended. If this suffix is not specified, the target window itself is used. Optional attribute. type
specifies the type of font metric / measurement to use for this dimension. This should be set to one of the values from the FontMetricType enumeration. Required attribute. font
specifies the name of a font. If no font is given, the font will be taken from the target window at the time the dimension's value is taken. Optional attribute. string
For horizontal extents measurement, specifies the string to be measured. If no explicit string is given, the window text for the target window at the time the dimension's value is taken will be used instead. Optional attribute. padding
an absolute pixel 'padding' value to be added to the font metric value. Optional attribute.<FontDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <FontDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <FontDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation. This first example just gets the line spacing for the window's current font:
Now we take an extents measurement of the windows current text, using a specified font, and pad the result by ten pixels:
The <FontProperty>
element is intended to allow the system to access a property on the target window to obtain the font to be used when rendering the TextComponent being defined.
name
specifies the name of the property to access. Required attribute. The value of the named property is taken as being the name of a Font.<FontProperty>
element may not contain sub-elements. <FontProperty>
element may appear as a sub-element only within the <TextComponent>
element. The <FrameComponent>
element is used to define an imagery frame using a maximum of eight images for the corners and edges, and a single, formatted, image for the background. Any of the images may be omitted if not required.
No attributes are currently defined for the <FrameComponent>
element.
Note: the sub-elements should appear in the order that they are defined here.
<Area>
defining the target area for this frame. Up to nine <Image>
elements specifying the images to be drawn and in what positions.
Optionally specifying the colours for the entire frame, one of the colour elements:
<Colours>
<ColourProperty>
<ColourRectProperty>
Optionally, to specify the vertical formatting to use for the frame background, either of:
<VertFormat>
<VertFormatProperty>
Optionally, to specify the horizontal formatting to use for the frame background, either of:
<HorzFormat>
<HorzFormatProperty>
<FrameComponent>
element may only appear as a sub-element of the element <ImagerySection>
. The following defines a full frame and background. It is taken from the TaharezLook skin specification for the Listbox widget:
The <HorzAlignment>
element is used to specify the horizontal alignment option required for a child window element.
type
specifies one of the values from the HorizontalAlignment enumeration indicating the desired horizontal alignment.<HorzAlignment>
element may only appear as a sub-element of the <Child>
element. <HorzAlignment>
element may not contain any sub-elements. This example defines a scrollbar type child widget. We have used the <HorzAlignment>
element to specify that the scrollbar appear on the far right edge of the component being defined:
The <HorzFormat>
element is used to specify the required horizontal formatting for an image, frame, or text component.
type
specifies the required horizontal formatting option.The <HorzFormat>
element may only appear as a sub-element of the following elements:
<ImageryComponent>
<FrameComponent>
<TextComponent>
<HorzFormat>
element may not contain any sub-elements. This first example shows an ImageryComponent definition. We use <HorzFormat>
to specify that we want the image stretched to cover the entire width of the designated target area:
This second example is for a TextComponent. You can see <HorzFormat>
used here to specify that we want the text centred within the target area, and word-wrapped where required:
The <HorzFormatProperty>
element is intended to allow the system to access a property on the target window to obtain the horizontal formatting to be used when drawing the component being defined.
name
specifies the name of the property to access. The named property must access a string value that will be set to one of the enumeration values appropriate for the component being defined (HorizontalTextFormat for TextComponent, and HorizontalFormat for either FrameComponent or ImageryComponent). Required attribute.The <HorzFormatProperty>
element may not contain sub-elements.
<HorzFormatProperty>
element may appear as a sub-element within any of the following elements: <ImageryComponent>
to specify a horizontal formatting to be used the the image. <FrameComponent>
to specify a horizontal formatting to be used for the frame background. <TextComponent>
to specify a horizontal formatting to be used for the text. The <Image>
element is used to specify an Imageset and Image pair, and for FrameComponent images, how the image is to be used.
imageset
specifies the name of an Imageset which contains the image to be used. Required attribute. image
specifies the name of the image from the specified Imageset to be used. Required attribute. type
Only for FrameComponent. Specifies the part of the frame that this image is to be used for. One of the values from the FrameImageComponent enumeration. Required attribute.<Image>
element may only appear as a sub-element of the <ImageryComponent>
or <FrameComponent>
elements. <Image>
element may not contain any sub-elements. Here you can see the <Image>
element used to specify the image to render for an ImageryComponent being defined:
The <ImageDim>
element is used to define a component dimension for an area rectangle. <ImageDim>
is used to specify some dimension of an image for use as an area dimension.
imageset
specifies the name of an Imageset which contains the image to be used. Required attribute. image
specifies the name of the image from the specified Imageset to be used. Required attribute. dimension
specifies the image dimension to be used. This should be set to one of the values defined in the DimensionType enumeration. Required attribute.<ImageDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <ImageDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <ImageDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation. This example shows a dimension that uses <ImageDim>
to fetch the width of a specified image for use as the dimensions value:
The <ImageryComponent>
element defines a single image to be drawn within a given ImagerySection. The ImageryComponent contains all information about which image is to be drawn, where it should be drawn, which colours are to be used and how the image should be formatted.
No attributes are defined for the <ImageryComponent>
element.
Note: the sub-elements should appear in the order that they are defined here.
<Area>
defining the target area for this image.
Either one of:
<Image>
element specifying the image to be drawn. <ImageProperty>
element specifying a property defining the image to be drawn. Optionally specifying the colours for this single image, one of the colour elements:
<Colours>
<ColourProperty>
<ColourRectProperty>
Optionally, to specify the vertical formatting to use, either of:
<VertFormat>
<VertFormatProperty>
Optionally, to specify the horizontal formatting to use, either of:
<HorzFormat>
<HorzFormatProperty>
<ImageryComponent>
element may only appear as a sub-element of the element <ImagerySection>
. The following was taken from TaharezLook.looknfeel and shows a full ImageryComponent definition:
The <ImageProperty>
element is intended to allow the system to access a property on the target window to obtain the final image to be used when rendering the ImageryComponent being defined.
name
specifies the name of the property to access. Required attribute. The named property must access a imageset & image value pair of the form: <ImageProperty>
element may not contain sub-elements. <ImageProperty>
element may appear as a sub-element only within the <ImageryComponent>
elements. The <ImagerySection>
element is used to group multiple <ImageryComponent>
and <TextComponent>
definitions into named sections which can then be specified for use as imagery in state definitions.
name
specifies the name to be given to this ImagerySection. Names are per-WidgetLook, and specifying the same name more than once will replace the previous definition. Required attribute.Note: the sub-elements should appear in the order that they are defined here.
To optionally specify colours to be modulated with the individual component's colours, the <ImagerySection>
may contain one of the colour definition elements:
<Colours>
<ColourProperty>
<ColourRectProperty>
<FrameComponent>
elements may then follow. <ImageryComponent>
elements. <TextComponent>
elements may be given. <ImagerySection>
element may only appear as a sub-element of the <WidgetLook>
element. The <Layer>
element is used to define layers of imagery within the definition of a StateImagery section.
priority
specifies the priority for the layer. Higher priorities appear in front of lower priorities. Default priority is 0. Optional attribute.<Layer>
element may only appear as a sub-element of the <StateImagery>
element. <Layer>
element may contain any number of <Section>
sub-elements. Here we see a single layer with multiple sections included. This example was taken from the TaharezLook skin XML file (ListHeaderSegment widget):
Defines an area that can be accessed via it's name. Generally this this used by base widgets to obtain skin supplied areas for use in rendering or other widget specific operations.
name
specifies a name for the area being defined. Required attribute.<NamedArea>
element must contain only an <Area>
sub-element defining the area rectangle for the named area. <NamedArea>
element may only appear as a sub-element within <WidgetLook>
elements. This example defines a named area called 'TextArea'. It is defined as being an area seven pixels inside the total area of the widget being defined:
The <Property>
element is used to initialise a property on a window or widget being defined.
name
specifies the name of the property to be initialised. Required attribute. value
specifies the value string to be used when initialising the property. Required attribute.<Property>
element may not contain any sub-elements. <Property>
element may appear as a sub-element in <WidgetLook>
elements to define property initialisers for the type being defined. <Property>
element may appear as a sub-element in <Child>
elements to define property initialisers for the child widget being defined. In this extract from the definition for TaharezLook/Titlebar, we can see the <Property>
element used to set the 'CaptionColour' property; this establishes a default for all instances of this widget:
The <PropertyDefinition>
element creates a new named property for the widget being defined. The defined property may be accessed via any means that a 'normal' property may.
name
specifies the name to use for the new property. Required attribute. initialValue
specifies the initial value to be assigned to the property. Optional attribute. type
specifies the data type of the property. This should be one of the values defined for the PropertyType enumeration. Optional attribute. redrawOnWrite
boolean setting specifies whether writing a new value to this property should cause the widget being defined to redraw itself. Optional attribute. layoutOnWrite
boolean setting specifies whether writing a new value to this property should cause the widget being defined to re-layout it's defined child widgets. Optional attribute.<PropertyDefinition>
element may not contain sub-elements. <PropertyDefinition>
element must appear as a sub-element within <WidgetLook>
elements. In this example, within the WidgetLook we create a new property named 'ScrollbarWidth'. We then use this property to control the width of a component child widget. This effectively gives the user control over the width of the child scrollbar via the property:
The <PropertyLinkDefinition>
element creates a new named property for the widget being defined that is linked to one or more properties on either child widget components, or on the parent widget. The target widgets and properties can be specified either as attributes (for example if the link is to be a one to one mapping), or via <PropertyLinkTarget> elements (if there is to be a one to many mapping). This allows properties on child widgets to be directly exposed to clients of the widget being defined, as well as allowing the widget being defined to make use of properties defined on a parent widget. The defined property may be accessed via any means that a 'normal' property may.
name
specifies the name to use for the new property. Required attribute. widget
specifies either the name suffix of the child widget containing the first property to be linked to the property being defined, or the special value "__parent__"
to indicate a back-link to the parent. Optional attribute. targetProperty
specifies the name of the property on the child widget that is to be the first property linked to the new property being defined. If this is omitted but widget
is specified, it will be assumed that the target property has the same name as the property being defined. Optional attribute. initialValue
specifies the initial value to be assigned to the property. Optional attribute. type
specifies the data type of the property. This should be one of the values defined for the PropertyType enumeration. Optional attribute. redrawOnWrite
boolean setting specifies whether writing a new value to this property should cause the widget being defined to redraw itself. Optional attribute. layoutOnWrite
boolean setting specifies whether writing a new value to this property should cause the widget being defined to re-layout it's defined child widgets. Optional attribute.<PropertyLinkDefinition>
element may contain any number of <PropertyLinkTarget>
sub-elements. <PropertyLinkDefinition>
element may only appear as a sub-element within <WidgetLook>
elements. In this example we create a new property named 'CaptionTextColour'. This is linked to a property named 'CaptionColour' on the child widget with name suffix 'auto_titlebar'. Any access of the 'CaptionTextColour' property on the widget will actually access the 'CaptionColour' property on the specified child widget:
The <PropertyLinkTarget>
element specifies a target widget suffix and property name to be used with a <PropertyLinkDefinition>
. Whenever the property defined by the enclosing <PropertyLinkDefinition>
is written to, the property specified in the <PropertyLinkTarget>
will be written also. If the <PropertyLinkTarget>
is the first linked target it will also be used as the 'master linked target' and will be used as the source for read accesses to the property defined by the enclosing <PropertyLinkDefinition>
element.
widget
specifies either the name suffix of the child widget containing the property that is to be linked to the property being defined by the enclosing <PropertyLinkDefinition>
element, or the special value "__parent__"
to indicate a back-link to the parent. Required attribute. property
specifies the name of the property on the child widget that is to be linked to the property being defined by the enclosing <PropertyLinkDefinition>
. If this is omitted, it will be assumed that the target property has the same name as the property being defined. Optional attribute.<PropertyLinkTarget>
element may not contain sub-elements. <PropertyLinkTarget>
element may only appear as a sub-element within <PropertyLinkDefinition>
elements. In this example we create a new property named 'TextColour'. This is linked to separate properties on two different child components. A property named 'LabelColour' on a child widget with name suffix 'auto_button1', and a property named 'ContentColour' on a child widget with name suffix 'auto_content_panel. Writing to the property 'TextColour' will cause both 'LabelColour' and 'ContentColour' to be updated, while reading the property 'TextColour' will fetch the value of 'LabelColour' (because it appears first, it is treated as the master target).
The <PropertyDim>
element is used to define a component dimension for an area rectangle. <PropertyDim>
is used to specify either a UDim or a simple floating point value - accessed via a window property - for use as an area dimension.
widget
specifies the name suffix of a child window to access the property for. The final name used to access the widget will be that of the target window with this suffix appended. If this suffix is not specified, the target window itself is used. Optional attribute. name
specifies the name of the property that will provide the value for this dimension. The property named should access either a UDim value or a simple floating point numerical value - the system determines which type of value to expect based upon the usage (or not) of the optional type
attribute. type
specifies the dimension for which the relative scale value of a UDim value is a portion of, and as such should be set to either "Width"
or "Height"
. If the property specified by the attribute name
is intended to access a simple floating point value rather than a UDim value, this attribute should be omitted. Optional attribute.<PropertyDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <PropertyDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <PropertyDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation. This example shows a dimension that uses <PropertyDim>
to fetch a property value to use as the dimension value. We are accessing the 'AbsoluteWidth' property, from an attached widget with the name suffix 'auto_button', that accesses a simple floating point value:
Here we show a dimension that uses <PropertyDim>
to access a property named 'UserWidth' on the target window. We have specified the type
attribute to be 'Width', which indicates to the system that the property will access a UDim value and that the scale part of the UDim is relative to the width of the target window.
The <Section>
element is used to name an ImagerySection to be included for rendering within a StateImagery Layer definition.
look
specifies the name of a WidgetLook that contains the ImagerySection to be referenced. If this is omitted, the WidgetLook currently being defined is used. Optional attribute. section
specifies the name of an ImagerySection from the chosen WidgetLook to be referenced. Required attribute. controlProperty
specifies the name of a property that will be accessed to determine whether or not to render this section (see controlValue
below for details of how it is determined whether or not the secion will be drawn). Optional attribute. controlValue
specifies a value that will be compared to the value fetched from controlProperty
in order to decide whether to draw the section. If controlValue
is not specified, or is specified as the empty string, then the property named in controlProperty
is treated as a boolean value. Otherwise the value fetched from the property named in controlPropery
must exactly match the value specified in controlValue
for the imagery section to be drawn. Optional attribute. controlWidget
specifies either the name suffix of a child widget, or the special value "__parent__"
, to indicate a widget that will be used as the source of the property named in controlProperty
. If controlWidget
is not specified, or is specified as the empty string, then the widget with WidgetLook assigned to it will be used as the source (matching the previous / default behaviour). Optional attribute.The <Section>
element may only appear as a sub-element within the <Layer>
element.
<Section>
element may specify colours to be modulated with any current colours used for each component within the named ImagerySection, by optionally specifying one of the colour elements as a sub-element: <Colours>
<ColourProperty>
<ColourRectProperty>
Here we see a state definition from a button widget. The state specifies to use the 'normal' imagery section, and also the 'label' imagery section. The 'label' section is only drawn if the 'DrawText' property of the target window is 'True'. Colours for 'label' will be modulated with the colour obtained from the 'NormalTextColour' property of the target window:
The <StateImagery>
element defines imagery to be used when rendering a named state. The base widget type intended as a target for the WidgetLook being defined will specify which states are required to be defined.
name
specifies the name of the state being defined. Required attribute. clipped
boolean setting that states whether imagery defined within this state should be clipped to the target window's defined area. If this is specified and set to false, the state imagery will only be clipped to the display area. Optional attribute.<StateImagery>element
may contain any number of <Layer>
sub-elements. <StateImagery>
element may only appear as a sub-element of the <WidgetLook>
element. The following is an extract of the MenuItem definition from TaharezLook.looknfeel. The except defines some of the states required for that widget. Note that, although not shown here, a required state can be empty if no rendering is needed for that state:
The <Text>
element is used to define font and text string information within a TextComponent.
font
specifies the name of a font to use for this text. If this is omitted, the current font of the target window will be used instead. Optional attribute. string
specifies a text string to be rendered. If this is omitted, the current window text for the target window will be used instead. Optional attribute.<Text>
element may not contain any sub-elements. <Text>
element should only appear as a sub-element within <TextComponent>
elements. In this simple example, we define a TextComponent that renders some static text. The <Text>
element is used to specify the font and string to be used:
The <TextComponent>
element defines a single item of text to be drawn within a given ImagerySection. The TextComponent contains all information about the text that is to be drawn, where it should be drawn, which colours are to be used and how the text should be formatted within its area.
Note that if the <Text>
element appears in addition to either of the <TextProperty>
or <FontProperty>
elements, the string and font specified within the <Text>
element will act as default values if the properties referenced in <TextProperty>
or <FontProperty>
evaluate to empty strings.
The <TextComponent>
element has no attributes defined.
Note: the sub-elements should appear in the order that they are defined here.
<Area>
defining the target area for the text. <Text>
optional element specifying the font to be used and text string to be drawn. <TextProperty>
optional element specifying the name of a property that contains the text to be drawn. <FontProperty>
optional element specifying the name of a property that contains the name of the font to use when drawing the text.
Optionally specifying the colours for this text, one of the colour elements:
<Colours>
<ColourProperty>
<ColourRectProperty>
Optionally, to specify the vertical formatting to use, either of:
<VertFormat>
<VertFormatProperty>
Optionally, to specify the horizontal formatting to use, either of:
<HorzFormat>
<HorzFormatProperty>
<TextComponent>
element may only appear as a sub-element of the element <ImagerySection>
. The following example could be used to specify the caption text to appear within a Titlebar style widget:
The <TextProperty>
element is intended to allow the system to access a property on the target window to obtain the text to be used when rendering the TextComponent being defined.
name
specifies the name of the property to access. The value of the named property is taken as a string to be rendered. Required attribute.<TextProperty>
element may not contain sub-elements. <TextProperty>
element may appear as a sub-element only within the <TextComponent>
element. The <UnifiedDim>
element is used to define a component dimension for an area rectangle. <UnifiedDim>
is used to specify a value using the 'unified' co-ordinate system.
scale
specifies the relative scale component of the UDim. Optional attribute. offset
specifies the absolute pixel component of the UDim. Optional attribute. type
specifies what the dimension represents. This is needed so that the system knows how to interpret the 'scale' component. Required attribute.<UnifiedDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <UnifiedDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <UnifiedDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation. This example shows a dimension that uses <UnifiedDim>
to specify a UDim value to use as the dimension's value:
The <VertAlignment>
element is used to specify the vertical alignment option required for a child window element.
type
specifies one of the values from the VerticalAlignment enumeration indicating the desired vertical alignment.<VertAlignment>
element may only appear as a sub-element of the <Child>
element. <VertAlignment>
element may not contain any sub-elements. This example defines a scrollbar type child widget. We have used the <VertAlignment>
element to specify that the scrollbar appear on the bottom edge of the component being defined:
The <VertFormat>
element is used to specify the required vertical formatting for an image, frame, or text component.
type
specifies the required vertical formatting option. The <VertFormat>
element may only appear as a sub-element of the elements:
<ImageryComponent>
<FrameComponent>
<TextComponent>
<VertFormat>
element may not contain any sub-elements. This first example shows an ImageryComponent definition. We use <VertFormat>
to specify that we want the image tiled to cover the entire width of the designated target area:
This second example is for a TextComponent. You can see <VertFormat>
used here to specify that we want the text centred within the target area:
The <VertFormatProperty>
element is intended to allow the system to access a property on the target window to obtain the vertical formatting to be used when drawing the component being defined.
name
specifies the name of the property to access. The named property must access a string value that will be set to one of the enumeration values appropriate for the component being defined (VerticalTextFormat for TextComponent, and VerticalFormat for FrameComponent and ImageryComponent). Required attribute.The <VertFormatProperty>
element may not contain sub-elements.
<VertFormatProperty>
element may appear as a sub-element within any of the following elements: <ImageryComponent>
to specify a vertical formatting to be used the the image. <FrameComponent>
to specify a vertical formatting to be used for the frame background. <TextComponent>
to specify a vertical formatting to be used for the text. The <WidgetDim>
element is used to define a component dimension for an area rectangle. <WidgetDim>
is used to specify some dimension of an attached child widget for use as an area dimension.
widget
specifies a suffix which will be used when building the name of the widget to access. The final name of the child widget will be that of the parent with this suffix appended. If this is not specified, the target window itself is used. Optional attribute. dimension
specifies the widget dimension to be used. This should be set to one of the values defined in the DimensionType enumeration. Required attribute.<WidgetDim>
element may contain a single <DimOperator>
element in order to form a dimension calculation. <WidgetDim>
element can appear as a sub-element in <Dim>
to form a dimension specification for an area. <WidgetDim>
element can appear as a sub-element of <DimOperator>
to specify the second operand for a dimension calculation. This example shows using <WidgetDim>
to obtain dimensions from an attached child widget 'auto_titlebar', and also from the target window itself:
The <WidgetLook>
element is the most important element within the system. It defines a complete widget 'look' which can be assigned to one of the Falagard base widget classes to create what is essentially a new widget type.
name
specifies the name of the WidgetLook being defined. If a WidgetLook with this name already exists within the system, it will be replaced with the new definition. Required attribute.Note: the sub-elements should appear in the order that they are defined here.
The <WidgetLook>
element can contain the following sub-elements:
<PropertyDefinition>
sub-elements defining new properties. <PropertyLinkDefinition>
sub-elements defining new linked properties. <Property>
sub-elements specifying default property values. <NamedArea>
sub-elements defining areas within the widget. <Child>
sub-elements defining component child widgets. <ImagerySection>
sub-elements defining imagery for the widget. <StateImagery>
sub-elements defining what to draw for widget states. <AnimationDefinition>
sub-elements defining animations for the WidgetLook. See: Animation XML files. <WidgetLook>
element may only appear as sub-elements of the root <Falagard>
element. The following example is the complete definition for 'TaharezLook/ListHeader'. This is a trivial example that actually does no rendering, it just specifies a required property: