falagard skinning ssytem for CEGUI 参考手册翻译(2)

来源:互联网 发布:双轨制直销系统源码asp 编辑:程序博客网 时间:2024/05/01 21:07

声明:转自http://blog.csdn.net/powerkoria/archive/2008/03/31/2232283.aspx 谢谢他!

<FrameComponent> Element
目的:
 <FrameComponent> 元素通常通过用8幅图片给4个角,4条边和一幅单一图片来做背景来定义一个
图象框架,如果忽略那么任意一个图象都不是必须的。(一共最多9个图片)
 
属性:
 无
用法:
 注意:子元素必须按下面循序定义。
 1)<Area> 定义frame的目标区域
 2)详细指定每一个图片要画的位置
 3)可选方式详细定义整个frame颜色,颜色元素为:
  <Colours>
  <ColourProperty>
  <ColourRectProperty>
 4)可选的, 随意的定义frame的数值方向格式排列,元素为:
  <VertFormat>
  <VertFormatProperty>
 5)可选的, 随意的定义frame的水平方向格式排列,元素为:
  <HorzFormat>
  <HorzFormatProperty>
 
 <FrameComponent> 元素 只允许作为<ImagerySection>的子元素

例子:
 <FrameComponent>
   <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
   </Area>
   <Image type="TopLeftCorner"
     imageset="TaharezLook" image="ListboxTopLeft"
   />
   <Image type="TopRightCorner"
     imageset="TaharezLook" image="ListboxTopRight"
   />
   <Image type="BottomLeftCorner"
     imageset="TaharezLook" image="ListboxBottomLeft"
   />
   <Image type="BottomRightCorner"
     imageset="TaharezLook" image="ListboxBottomRight"
   />
   <Image type="LeftEdge"
     imageset="TaharezLook" image="ListboxLeft"
   />
   <Image type="RightEdge"
     imageset="TaharezLook" image="ListboxRight"
   />
   <Image type="TopEdge"
     imageset="TaharezLook" image="ListboxTop"
   />
   <Image type="BottomEdge"
     imageset="TaharezLook" image="ListboxBottom"
   />
   <Image type="Background"
     imageset="TaharezLook" image="ListboxBackdrop"
   />
 </FrameComponent>


<HorzAlignment> Element
目的:
 通常用于指定水平对齐方式,这是一个子窗口元素中必须的。
属性:
 type
 详细指定一个属于HorizontalAlignment enum表里的值,标志出期望的水平对齐方式

用法:
 1) 只能作为<Child>元素的子元素
 2)不能存在任何子元素
例子:
 这个例子定义了一个滚动条类型的控件,我们使用<HorzAlignment>来指定滚动条在被定义的组件
 的右边
 <Child  type="MyLook/VertScrollbar" nameSuffix="__auto_vscrollbar__">
   <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><AbsoluteDim value="15" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
   </Area>
   <HorzAlignment type="RightAligned" />
 </Child>

<HorzFormat> Element
目的:
 <HorzFormat> 通常用于详细说明图象,frame,文字的水平格式化
属性:
 type
 指定必须的水平格式选项
 在ImageryComponents or FrameComponents使用,type 值为HorizontalFormat 值集合的一个
 在TextComponents使用,type值则是HorizontalTextFormat 值集合中的一个
用法:
 1)只能作为下面三个元素的子元素
  <ImageryComponent>
  <FrameComponent>
  <TextComponent>
 2)不能存在任何子元素
例子:
 <ImageryComponent>
   <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><AbsoluteDim value="25" /></Dim>
     <Dim type="Height" ><AbsoluteDim value="25" /></Dim>
   </Area>
   <Image imageset="myImageset" image="coolImage" />
   <VertFormat type="Stretched" />
   <HorzFormat type="Stretched" />
 </ImageryComponent>


<TextComponent>
  <Area>
    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
  </Area>
  <HorzFormat type="WordWrapLeftAligned" />
</TextComponent>


<HorzFormatProperty> Element
目的:
 <HorzFormatProperty>元素有意允许系统访问目标窗口的属性,以得到画被定义组件时
 的水平格式化信息
属性:
 name
 指定访问的名字。 已经命名的属性提供一个字符窜值,这为组件提供了一个恰当的值。
 必要属性
用法:
 1)不存在子元素
 2)可作为下面元素的子元素
  <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.
 
  <ImageryComponent>里指定了所用的图象的水平方向格式
  <FrameComponent>里指定了frame背景的水平方向格式
  <TextComponent>里指定了文本的水平方向格式

例子:
 无

<Image> Element
目的:
 
 <Image>元素通常用于FrameComponent的图片中指定一个Imageset and Image 对 及图片怎么使用

属性:
 imageset 指定imageset的名字,imageset里包含image信息, 必要属性
 image 指定image名字,image名字在imageset里提供,必要属性
 type
  只为FrameComponent提供,指定图片使用于frame的部分,值是FrameImageComponent中的一个
  必要属性
用法:
 1) 只能做<ImageryComponent> or <FrameComponent>的子元素
 2) 不能包含子元素
例子
 <ImageryComponent>
   <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><AbsoluteDim value="15" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
   </Area>
   <Image imageset="FunkyLook" image="ButtonIcon" />
   <VertFormat type="CentreAligned" />
   <HorzFormat type="CentreAligned" />
 </ImageryComponent>


<ImageDim> Element
目的:
 <ImageDim> 元素通常用于定义一个矩形区域的组成尺寸
 <ImageDim> 元素通常用于指定一个图象的某个尺寸以用来表示某个区域的尺寸
属性:
 imageset 必要属性。 指定imageset的名字
 image 必要属性,指定image的名字
 dimension 必要属性。必须设置为DimensionType集合中的一个值
用法:
 1)可以存在一个<DimOperator>元素来计算尺寸
 2)可以作为<Dim>的子元素来组成一个区域的尺寸
 3)可作为<DimOperator>子元素来做而次计算尺寸
例子:
 <Area>
  <Dim type="LeftEdge">
    <ImageDim imageset="myImages" image="leftImage" dimension="width" />
  </Dim>
  ...
</Area>

<ImageryComponent> Element
目的:
 <ImageryComponent>元素在ImagerySection定义了一个单一的图片如何画出来。
 <ImageryComponent>包含了一个图象如何画出来的所有信息。画在哪,什么颜色被使用
 和图象格式
属性
 无
用法:
 注意:子元素应该按照下面循序排列
 1)<Area> 定义了图象的绘画区域
  <Image>或<ImageProperty>来定义一个图象被绘制
 2)随意的定义一个图片的颜色,颜色元素如下:
 3)随意的定义垂直方向的排列,元素为:
  <VertFormat>或<VertFormatProperty>
 4) 随意地定义水平方向的排列,元素为
  <HorzFormat> 或<HorzFormatProperty> 

例子:
 一个完整的<ImageryComponent>定义
 <ImageryComponent>
   <Area>
    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
    <Dim type="TopEdge" ><UnifiedDim scale="0.2" type="TopEdge" /></Dim>
    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
    <Dim type="Height" ><UnifiedDim scale="0.3" type="Height" /></Dim>
  </Area>
  <Image imageset="TaharezLook" image="TextSelectionBrush" />
  <Colours
    topLeft="FFFFFF00"
    topRight="FFFFFF00"
    bottomLeft="FFFFFF00"
    bottomRight="FFFFFF00"
  />
  <VertFormat type="Tiled" />
  <HorzFormat type="Stretched" />
</ImageryComponent>

<ImageProperty> Element
目的:
 允许系统访问目标窗口的一个属性。提供了定义的ImageryComponent被渲染的图片
属性:
 name
 指定访问属性的名字
 名字属性必须提供一对imageset和image值
用法:
 1) 不能包含子元素
 2)只能作为<ImageryComponent>子元素
例子:
 无

<ImagerySection> Element
目的:
 成组定义多个<ImageryComponent> and <TextComponent>组成一个命名项,
 这个命名项作为一个图象状态的定义。
属性:
 name
 指定一个名字给<ImagerySection>,名字由WidgetLook提供,指定重复名字的话,将会覆盖
 旧的定义,必要属性
用法:
 注意:子元素要按照如下次序出现
 1)为了随意指定颜色并被调整,<ImagerySection> 可以包含如下元素
 <Colours>
 <ColourProperty>
 <ColourRectProperty>
 2)任何数量的 <FrameComponent>元素可以紧跟在下面
 3)<ImageryComponent>元素紧跟
 4)最后 <TextComponent> 元素跟随
 5)只能作为<WidgetLook>的子元素
例子:
 <ImagerySection name="example">
   <ImageryComponent>
     <Area>
       <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
       <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
       <Dim type="Width" ><AbsoluteDim value="15" /></Dim>
       <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
     </Area>
     <Image imageset="sillyImages" image="anotherImage" />
     <VertFormat type="Stretched" />
     <HorzFormat type="Stretched" />
   </ImageryComponent>
   <TextComponent>
     <Area>
       <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
       <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
       <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
       <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
     </Area>
   </TextComponent>
 </ImagerySection>


<Layer> Element
目的:
 <Layer> 元素在一个StateImagery 项里用于定义图象区的层
属性:
 priority
 定义层的优先权。高权限的将显示在最前面。默认是优先权是0,可选属性
用法:
 1)只能作为<StateImagery> 的子元素
 2)可以包含任意多个<Section>子元素
例子:
 <StateImagery name="Normal">
   <Layer>
     <Section section="segment_normal" />
     <Section section="splitter_normal" />
     <Section section="label" />
   </Layer>
 </StateImagery>

<NamedArea> Element
目的:
 <NamedArea> 定义一个区域的名字,可以通过名字访问。

属性:
 name
 必要属性。定义一个区域的名字
用法:
 1)只能包含一个<Area>区域
 2)只能作为<WidgetLook> 的子元素
例子:
 <NamedArea name="TextArea">
  <Area>
    <Dim type="LeftEdge" >
      <AbsoluteDim value="7" />
    </Dim>
    <Dim type="TopEdge" >
      <AbsoluteDim value="7" />
    </Dim>
    <Dim type="RightEdge" >
      <UnifiedDim scale="1.0" offset="-7" type="RightEdge" />
    </Dim>
    <Dim type="BottomEdge" >
      <UnifiedDim scale="1.0" offset="-7" type="BottomEdge" />
    </Dim>
  </Area>
</NamedArea>


<Property> Element
目的:
 初始化一个窗口或控件的属性
属性:
 name 属性名字,必要属性
 value 初始虾属性时设置的字窜
用法:
 1) 不能包含任何子元素
 2)作为 <WidgetLook>的子元素
 3) 作为<Child子元素
 
 例子:
  <WidgetLook name="TaharezLook/Titlebar">
  <Property name="CaptionColour" value="FFFFFFFF" />
  <ImagerySection name="main">
    <ImageryComponent>
      <Area>
        <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
        ...
      </Area>
    ...
    </ImageryComponent>
  </ImagerySection>
  ...
</WidgetLook>

<PropertyDefinition> Element
目的:
 创建一个widget新的属性,这个属性可以表示任何和其他一般的属性表示任何意义
 
属性:
 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.
  类型,值是PropertyType的一个,可选属性
 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
  可选属性
  布林值,指定是否重写一个新值到属性上,当重新排列子窗口时
用法:
 1)不存在子元素
 2) 只能作为<WidgetLook>的子元素

例子:
 这个例子中,在WidgetLook里创建了一个新属性叫ScrollbarWidth,我们使用它来控制一个子控件的宽度属性
 这个影响了子滚动条的宽度来给出控制
 
 <WidgetLook name="PropertyDefExample">
   <PropertyDefinition
     name="ScrollbarWidth"
     initialValue="12"
     layoutOnWrite="true"
   />
   ...
   <Child  type="MyVertScrollbar" nameSuffix="__auto_vscrollbar__">
   <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><PropertyDim name="ScrollbarWidth" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
   </Area>
   <HorzAlignment type="RightAligned" />
 </Child>
 ...
 </WidgetLook>


<PropertyLinkDefinition> Element
目标:
  <PropertyLinkDefinition> 元素为控件定义创建了一个新的属性名字,
  在子控件中连接这个属性作为一个指定属性,允许子控件的属性直接暴露到这个控件的
  客户端,这个属性类似一般属性一样可以提供任何意义。
属性:
 name
 specifies the name to use for the new property. Required attribute.
 必要属性,指定的新属性的名字
 
 widget
  specifies the name suffix of the child widget containing the property that is to be linked to the property being defined. Required attribute.
 必要属性。指定子控件存在这个属性的名字前缀
 
 targetProperty
  specifies the name of the property on the child widget that is to be linked to the property being defined. If this is omitted, 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.
 可选属性,指定属性类型,类型值由PropertyType提供
 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 attribu
 可选属性。布林值,指定一个新值到属性上,使得是否允许定义的空间是否允许重新排列控件里定义的控件
用法:
 1)不能包含子元素
 2)只能作为<WidgetLook>子元素
例子:
 
 <WidgetLook name="PropertyLinkDefinition">
   <PropertyLinkDefinition
     name="CaptionTextColour"
     widget="__auto_titlebar__"
     targetpropety="CaptionColor"
     initialValue="FFFF3333"
     layoutOnWrite="true"
   />
 </WidgetLook>

<PropertyDim> Element
Purpose:
The <PropertyDim> element is used to define a component dimension for an area rectangle. <PropertyDim> is used to specify a floating point value, accessed via a window property, for use as an area dimension.

目的:
 The <PropertyDim>元素通常用于定义一个矩形区域的组成尺寸
 <PropertyDim>通常指定一个浮点数值,通过一个窗口属性来访问,作为一个区域尺寸来使用。
Attributes:

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 a simple numerical value.
属性:
widget
 指定访问这个属性的子窗口的名字前缀
 属性名必须是个简单的数值
name
 指定属性的提供尺寸的名字,属性名字可以访问一个数值
Usage:

The <PropertyDim> element may contain a single <DimOperator> element in order to form a dimension calculation.
The <PropertyDim> element can appear as a sub-element in <Dim> to form a dimension specification for an area.
The <PropertyDim> element can appear as a sub-element of <DimOperator> to specify the second operand for a dimension calculation.
用法:
1)只包含一个<DimOperator>来组织一个尺寸计算
2)可以作为<Dim>的子元素来给区域进行组织尺寸定义
3)可作为<DimOperator>子元素以进行二次计算

Examples:
This example shows a dimension that uses <PropertyDim> to fetch a property value to use as the dimensions value.
 We are accessing the 'AbsoluteWidth' property from an attached widget with the name suffix '__auto_button__':

<Area>
  <Dim type="LeftEdge">
    <PropertyDim widget="__auto_button__" name="AbsoluteWidth" />
  </Dim>
  ...
</Area>


<Section> Element
Purpose:
The <Section> element is used to name an ImagerySection to be included for rendering within a StateImagery Layer definition.
目的:
The <Section>元素通常用于在一个StateImagery层定义中命名一个ImagerySection

Attributes:

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 boolean property that will be accessed to determine whether or not to render this section. Optional attribute.
属性:
look
 指定WidgetLook的名字,这个WidgetLook包含了ImagerySection了指引。
 如果这个被指定了,则当前的WidgetLook就可以被使用,可选属性。
section
 从选择的WidgetLook指定一个ImagerySection的名字,必要属性。
controlProperty
 一个布林属性的名字,这个属性会提供一个访问方法来决定渲染或不渲染这个section.
 可选参数
Usage:

The <Section> element may only appear as a sub-element within the <Layer> element.
The <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>
用法:
 1)只能在<Layer> 作为子元素
 2)可以指定颜色来调整任何当前 命名的ImagerySection里的颜色,随意的通过下面几种元素处理
 <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. Colours for "label" will be modulated with the colour obtained from the "NormalTextColour" property of the target window:

...
<StateImagery name="Normal">
  <Layer>
    <Section section="normal" />
    <Section section="label">
      <ColourProperty name="NormalTextColour" />
    </Section>
  </Layer>
</StateImagery>


<StateImagery> Element
Purpose:
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.
目的:
 当渲染一个状态名时,定义图象使用,
 定义WidgetLook时,以基础部件定义一个目标部件时指定哪一个状态
 
Attributes:
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.
属性:
name
 指定状态名,必要属性
clipped
 布林设置值。设置状态决定图象定义是否被拷贝到目标窗口,如果这个被指定,并被设置为false, 那么这个状态的图象将只被拷贝到那些显示的区域。
 可选属性
Usage:
The <StateImagery>element may contain any number of <Layer> sub-elements.
The <StateImagery> element may only appear as a sub-element of the <WidgetLook> element.
用法:
 1)只包含任意数量的<Layer>元素
 2)可以作为<WidgetLook>的子元素
Examples:
The following is an extract of the MenuItem definition from TaharezLookSkin.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

<StateImagery name="EnabledNormal">
  <Layer>
    <Section section="label" />
  </Layer>
</StateImagery>
<StateImagery name="EnabledHover">
  <Layer>
    <Section section="frame" />
    <Section section="label" />
  </Layer>
</StateImagery>
<StateImagery name="EnabledPushed">
  <Layer>
    <Section section="frame" />
    <Section section="label" />
  </Layer>
</StateImagery>


<Text> Element
Purpose:
The <Text> element is used to define font and text string information within a TextComponent.
目的:
 <Text>元素通常用于在一个TextComponent定义一字体和文本字窜信息

Attributes:

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.
属性:
font
 定义文本的字体名,如果这个被忽略,当前目标窗口的字体将被取代。
 可选属性
string
 指定一个文本字窜被渲染,如果被忽略,当前窗口的字窜将取代目标窗口的字窜
 可选属性。
 
Usage:

The <Text> element may not contain any sub-elements.
The <Text> element should only appear as a sub-element within <TextComponent> elements.
用法:
 1)不存在子元素
 2)作为<TextComponent>的子元素
Examples:
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:
例子:
<TextComponent>
  <Area>
    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
  </Area>
  <Text font="Roman-18" string="Render this text!" />
</TextComponent>


<TextComponent> Element
Purpose:
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.

目的:
 <TextComponent>元素在一个给顶的ImagerySection定义了一个文本条目被绘制,
 <TextComponent>元素包含了要绘制的文本信息的一切,绘制在哪里,什么颜色,及在他的区域里的排版格式
 
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.
注意如果<Text>出现在<TextProperty> or <FontProperty> 中,<Text>值回作为属性默认值

Attributes:
The <TextComponent> element has no attributes defined.
属性:
 无

Usage:
Note: the sub-elements should appear in the order that they are defined here.
用法:
 注意:子元素应该按照下面循序被定义

 1)<Area> defining the target area for the text.
 <Area>定义了目标区域
 
 2)<Text> optional element specifying the font to be used and text string to be drawn.
 定义了绘制的字体和文本字窜
 
 3)<TextProperty> optional element specifying the name of a property that contains the text to be drawn.
  <TextProperty> 可选元素 指定了包含的绘制的文本的名字属性
 4)<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>
  <FontProperty>可选元素指定了属性名,包含了字体信息
  随意的指定文本颜色,使用如下颜色元素
  <Colours>
  <ColourProperty>
  <ColourRectProperty>
 5)Optionally, to specify the vertical formatting to use, either of:
 
  <VertFormat>
  <VertFormatProperty>
  随意的指定垂直格式,元素为
  <VertFormat>
  <VertFormatProperty>
 
 6)Optionally, to specify the horizontal formatting to use, either of:
 
  <HorzFormat>
  <HorzFormatProperty>
  随意指定水平方向格式
  <HorzFormat>
  <HorzFormatProperty>
 The <TextComponent> element may only appear as a sub-element of the element <ImagerySection>.
 <TextComponent> 元素只作为<ImagerySection>子元素
 
Examples:
The following example could be used to specify the caption text to appear within a Titlebar style widget:
<ImagerySection name="caption">
  <TextComponent>
    <Area>
      <Dim type="LeftEdge" ><AbsoluteDim value="10" /></Dim>
      <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
      <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
      <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
    </Area>
    <ColourProperty name="CaptionColour" />
    <VertFormat type="CentreAligned" />
    <HorzFormat type="WordWrapLeftAligned" />
  </TextComponent>
</ImagerySection>

<TextProperty> Element
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.

目的:
<TextProperty>元素想要允许系统在目标窗口上访问一个 属性,这个属性提供了要使用的文本当渲染TextComponent时

Attributes:
name
specifies the name of the property to access. Required attribute. The value of the named property is taken as a string to be rendered.
属性:
name
 指定访问属性的名字。必要属性。
 
Usage:
The <TextProperty> element may not contain sub-elements.
The <TextProperty> element may appear as a sub-element only within the <TextComponent> element.
用法:
 1)不存在子元素
 2)只作为<TextComponent>的子元素
Examples:

<UnifiedDim> Element
Purpose:
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.
目的:
 通常用于定义一个矩形区域尺寸组成。通常用于表示一个统一联合坐标系统的值
Attributes:

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.
属性:
scale
 指定<UDim>组成的相对比例,可选属性
offset
 指定<UDim>组成的绝对尺寸,可选属性
type
 指定尺寸表现形式,,这是在系统知道要怎么解释scale组成时是必须的。
 必要属性
Usage:

The <UnifiedDim> element may contain a single <DimOperator> element in order to form a dimension calculation.
The <UnifiedDim> element can appear as a sub-element in <Dim> to form a dimension specification for an area.
The <UnifiedDim> element can appear as a sub-element of <DimOperator> to specify the second operand for a dimension calculation.
用法:
 1)只包含单一<DimOperator>来进行尺寸计算
 2)组建一个尺寸区域时作为<Dim>的子元素
 3)作为<DimOperator>子元素来进行二次尺寸计算
 
Examples:
This example shows a dimension that uses <UnifiedDim> to specify a UDim value to use as the dimension's valu
例子:
<Area>
  <Dim type="LeftEdge">
    <UnfiedDim scale="0.5" offset="-8" type="LeftEdge" />
  </Dim>
  ...
</Area>


<VertAlignment> Element
Purpose:
The <VertAlignment> element is used to specify the vertical alignment option required for a child window element.
目的:
The <VertAlignment>元素通常用于指定子窗口的垂直排列

Attributes:
type - specifies one of the values from the VerticalAlignment enumeration indicating the desired vertical alignment.
属性
type
 指定VerticalAlignment 类型值。
 
Usage:
The <VertAlignment> element may only appear as a sub-element of the <Child> element.
The <VertAlignment> element may not contain any sub-elements.
用法:
 1)只能作为<Child>子元素
 2)不能包含子元素
Examples:
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:

...
<Child  type="MyLook/HorzScrollbar" nameSuffix="__auto_hscrollbar__">
  <Area>
    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
    <Dim type="Height" ><AbsoluteDim value="15" /></Dim>
  </Area>
  <VertAlignment type="BottomAligned" />
</Child>
...
 
 
<VertFormat> Element
Purpose:
The <VertFormat> element is used to specify the required vertical formatting for an image, frame, or text component.
目的:
 The <VertFormat> 元素通常用于指定图象,frame,文本,必须的垂直排列格式
 
Attributes:
type - specifies the required vertical formatting option. For use in ImageryComponents and FrameComponents, this will be one of the values from the VerticalFormat enumeration. For use in TextComponents, this will one of *the values form the VerticalTextFormat enumeration.
属性
type
 指定需要的垂直格式选项
 在ImageryComponents and FrameComponents里使用,则用 VerticalFormat 选项值
 在TextComponents里使用,则用VerticalTextFormat选项值
 
Usage:
The <VertFormat> element may only appear as a sub-element of the <ImageryComponent>, <FrameComponent>, or <TextComponent> elements.
The <VertFormat> element may not contain any sub-elements.
用法:
 1) 只作为 <ImageryComponent>, <FrameComponent>, or <TextComponent>的子元素
 2) 不能包含任何子元素
 
Examples:
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:

...
<ImageryComponent>
  <Area>
    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="Width" ><AbsoluteDim value="25" /></Dim>
    <Dim type="Height" ><AbsoluteDim value="25" /></Dim>
  </Area>
  <Image imageset="myImageset" image="coolImage" />
  <VertFormat type="Tiled" />
  <HorzFormat type="Stretched" />
</ImageryComponent>
...
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:

...
<TextComponent>
  <Area>
    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
  </Area>
  <VertFormat type="CentreAligned" />
</TextComponent>
...


<VertFormatProperty> Element
Purpose:
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.
目的:
 The <VertFormatProperty>元素意图是允许系统访问目标窗口的一个属性,
 这个属性提供了组件在绘制时的垂直排列信息。
 
Attributes:
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 (so VerticalTextFormat for *TextComponent, and VerticalFormat for FrameComponent and ImageryComponent). Required attribute.
属性
name
 指定一个访问属性的名字
 必要属性。
 
Usage:
The <VertFormatProperty> element may not contain sub-elements.
The <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.
用法:
 1)不能有子元素
 2)只能作为下面三种元素的子元素
 <ImageryComponent> 指定垂直格式的图象使用
 <FrameComponent> 指定垂直格式的frame背景使用
 <TextComponent> 指定垂直格式的文本使用。
Examples:


<WidgetDim> Element
Purpose:
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.
目的:
 The <WidgetDim> 元素通常用于定义一个矩形区域的组成尺寸。
 通常用于指定依附在子窗口上的尺寸,来指定区域尺寸
 
Attributes:
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.
属性
widget
 指定一个widget名字的前缀
 可选属性
dimension
 指定一个要使用的widget尺寸,值是DimensionType的一个。
 必要属性
 
Usage:
The <WidgetDim> element may contain a single <DimOperator> element in order to form a dimension calculation.
The <WidgetDim> element can appear as a sub-element in <Dim> to form a dimension specification for an area.
The <WidgetDim> element can appear as a sub-element of <DimOperator> to specify the second operand for a dimension calculation.
使用
 1)包含单一的<DimOperator> 来计算尺寸
 2)可作为<Dim>的子元素来组织尺寸计算
 3)可作为 <DimOperator>子元素作为二次尺寸计算
 
Examples:
This example shows using <WidgetDim> to obtain dimensions from an attached child widget "__auto_titlebar__", and also from the target window itself:

...
<Area>
    <Dim type="LeftEdge" >
      <AbsoluteDim value="0" />
    </Dim>
    <Dim type="TopEdge" >
      <WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" />
    </Dim>
    <Dim type="Width" >
      <UnifiedDim scale="1" type="Width" />
    </Dim>
    <Dim type="BottomEdge" >
      <WidgetDim dimension="BottomEdge" />
    </Dim>
</Area>
...

<WidgetLook> Element
Purpose:
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.
目的:
 The <WidgetLook> 元素是系统中最重要的元素
 他定义了一个完整的部件"look",这个部件由falagard基础部件类创建以从本质上创建一个新的部件类型。
 
Attributes:
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.
属性
name
 指定一个WidgetLook的名字
 如果已经存在一个同样名字的WidgetLook在系统里,那么他回覆盖旧的
 必要属性
Usage:
Note: the sub-elements should appear in the order that they are defined here.
用法:
 注意。子元素必须按照下面定义循序出现:
 
The <WidgetLook> element can contain the following sub-elements:
Any number of <PropertyDefinition> sub-elements defining new properties.
Any number of <Property> sub-elements specifying default property values.
Any number of <NamedArea> sub-elements defining areas within the widget.
Any number of <Child> sub-elements defining component child widgets.
Any number of <ImagerySection> sub-elements defining imagery for the widget.
Any number of <StateImagery> sub-elements defining what to draw for widget states.
包含下面子元素
1)任意数量的<PropertyDefinition>子元素 定义新属性
2) 任意数量的<Property>指定默认属性值
3)任意数量的<NamedArea>在部件定义区域
4) 任意数量的<Child>子元素定义组成子部件
5)任意数量的<ImagerySection>子元素定义widget使用的图象
6)任意数量的 <StateImagery> 子元素定义widget绘制状态

The <WidgetLook> element may only appear as sub-elements of the root <Falagard> element.
The <WidgetLook>元素只作为根元素<Falagard>子元素出现

Examples:
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 propery:

<WidgetLook name="TaharezLook/ListHeader">
  <Property
    name="SegmentWidgetType"
    value="TaharezLook/ListHeaderSegment"
  />
  <StateImagery name="Enabled" />
  <StateImagery name="Disabled" />
</WidgetLook>

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/powerkoria/archive/2008/03/31/2233625.aspx