<?xml version = "1.0"?> <Falagard> <!-- 定义一个按钮 --> <WidgetLook name = "RainLeaf/Button"> <!-- ImagearySection为定义一些常见的外观 --> <ImagerySection name = "Normal_imagery"> <!-- 定义绘制ImagerySection的ImageryCompnents --> <ImageryComponent> <!-- 加入Area节点的定义,告诉系统应该在哪里把图像显示出来。(控件坐标) --> <Area> <!-- 定义左上坐标,使用绝对值 --> <Dim type = "LeftEdge"><AbsoluteDim value = "0"></Dim> <Dim type = "TopEdge"><AbsoluteDim value = "0"></Dim> <!-- 显示区域大小定义 宽度和外观 --> <Dim type = "Width"> <ImageDim imageset = "TaharezLook" image = "ButtonLeftNormal" dimension = "Width"/> </Dim> <!-- 显示的高度和定义的高度一致,不需要名字来查找控件使用UnifiedDim来完成 --> <Dim type = "Height"> <UnifiedDim scale = "1.0" type = "Height"/> </Dim> </Area> <!-- 显示的图片 --> <Image imageset = "TaharezLook" image = "ButtonLeftNormal"/> <!-- 设置图片的垂直拉伸 --> <VertFormat type = "Stretched"/> </ImageryComponent> <!-- 右边图片的显示 --> <ImageryComponent> <Area> <Dim type = "LeftEdge"><AbsoluteDim value = "0"/></Dim> <Dim type = "TopEdge"><AbsoluteDim value = "0"/></Dim> <Dim type = "Width"><UnifiedDim scale = "1.0" type = "Width" /></Dim> <Dim type = "Height"><UnifiedDim scale = "1.0" type = "Height" /></Dim> </Area> <Image imageset = "TaharezLook" image = "ButtonLeftNormal"/> <VertFormat type = "Stretched"/> <HorzFormat type = "RightAligned"/> </ImageryComponent> <!-- 中间图片的显示 --> <ImageryComponent> <!-- 计算方法: 中间部件的宽度 = 控件宽度-(右部件宽度 + 左部件宽度)。 计算右边距: 中间部件的右边距= 控件宽度 - 右部件宽度 --> <Area> <Dim type = "LeftEdge"><ImageDim imageset = "TaharezLook" image = "ButtonLeftNormal" dimension = "Width"/> <Dim type = "RightEdge"> <!-- 得到控件的宽度 --> <UnifiedDim scale = "1.0" type = "Width"/> <!-- 添加减法运算的代码 --> <DimOperator op = "Subtract"> <!-- 右部件的宽度代码加入到减法操作当中去 --> <ImageDim imageset = "TaharezLook" image = "ButtonRightNormal" dimension = "Width" /> </DimOperator> </Dim> <Dim type ="TopEdge"><AbsoluteDim value="0"/></Dim> <Dim type ="Height"><UnifiedDim scale ="1.0" type="Height"/></Dim> </Area> <Image imageset ="TaharezLook" image="ButtonLeftNormal"/> <VertFormat type ="Stretched"/> <HorzFormat Type="Stretched"/> </Imagerycomponent> </ImagerySection> <ImagerySection name = "Hover_imagery"> <!--此处按照以上方式进行定义--> </ImagerySection> <ImagerySection name = "Pushed_imagery"> <!--此处按照以上方式进行定义--> </ImagerySection> <!-- 显示文本定义 --> <ImagerySection name = "lable"> <TextComponent> <Area> <Dim type = "LeftEdge"><AbsoluteDim value = "0"/></Dim> <Dim type = "TopEdge"><Absolutedim value = "0"/></Dim> <Dim type = "Width"><UnifiedDim scale = "1.0" type = "Width"/></Dim> <Dim type = "Height"><UnifiedDim scale = "1.0" type = "Height"/></Dim> </Area> <VertFormat type = "CentreAligned"/> <HorzFormat type = "WordWrapCentreAligned"/> </TextComponent> </ImagerySection> <!-- 定义状态外观 --> <StateImagery name = "Normal"> <!-- 层中指定以上定义过的显示方式 --> <Layer> <Section section = "normal_imagery"/> <Section section = "lable"/> </Layer> </StateImagery> <StateImagery name = "Hover"> <Layer> <Section section = "Hover_imagery"/> <Section section = "lable"/> </Layer> </StateImagery> <StateImagery name = "Pushed"> <Layer> <Section section = "Pushed_imagery"/> <Section section = "lable"/> </Layer> </StateImagery> <!-- Disabled复用,只是在颜色上面作出改动 --> <StateImagery name = "Disabled"> <Layer> <Section section = "normal_imagery"> <Colours topLeft = "FF7F7F7F" topRight = "FF7F7F7F" bottomLeft = "FF7F7F7F" bottomRight = "FF7F7F7F" /> </Section> <Section section = "lable"> <Colours topLeft = "FF7F7F7F" topRight = "FF7F7F7F" bottomLeft = "FF7F7F7F" bottomRight = "FF7F7F7F" /> </Section> </Layer> </StateImagery> </WidgetLook> </Falagard>