Some work on TextButton (still unfinished)

dev-ui
krzys-h 2014-03-07 18:16:21 +01:00
parent 714d383726
commit d0ea7b6749
5 changed files with 402 additions and 19 deletions

View File

@ -1,8 +1,17 @@
<?xml version="1.0" ?>
<Imageset imagefile="../../textures/button1.png" name="ColobotButton1" version="2">
<Imageset version="2" name="ColobotButton1" imagefile="../../textures/button1.png" autoScaled="vertical" nativeHorzRes="2560" nativeVertRes="1920">
<Image name="ButtonBgChecked" width="128" height="128" xPos="0" yPos="0" />
<Image name="ButtonBgHover" width="128" height="128" xPos="128" yPos="0" />
<Image name="ButtonBgNormal" width="128" height="128" xPos="256" yPos="0" />
<Image name="ButtonBgNormalTL" width="12" height="12" xPos="256" yPos="0" />
<Image name="ButtonBgNormalT" width="104" height="12" xPos="268" yPos="0" />
<Image name="ButtonBgNormalTR" width="12" height="12" xPos="372" yPos="0" />
<Image name="ButtonBgNormalL" width="12" height="12" xPos="256" yPos="12" />
<Image name="ButtonBgNormalC" width="104" height="104" xPos="268" yPos="12" />
<Image name="ButtonBgNormalR" width="12" height="12" xPos="372" yPos="12" />
<Image name="ButtonBgNormalBL" width="12" height="12" xPos="256" yPos="116" />
<Image name="ButtonBgNormalB" width="104" height="12" xPos="268" yPos="116" />
<Image name="ButtonBgNormalBR" width="12" height="12" xPos="372" yPos="116" />
<Image name="ButtonBgPushed" width="128" height="128" xPos="384" yPos="0" />
<Image name="SomeBar1" width="384" height="64" xPos="512" yPos="0" />
<Image name="SomeBar2" width="384" height="64" xPos="512" yPos="64" />
@ -33,5 +42,41 @@
<Image name="FlyUp" width="128" height="128" xPos="512" yPos="384" />
<Image name="FlyDown" width="128" height="128" xPos="640" yPos="384" />
<Image name="Home" width="128" height="128" xPos="768" yPos="384" />
<Image name="Grab" width="128" height="128" xPos="896" yPos="384" />
<Image name="Hand" width="128" height="128" xPos="896" yPos="384" />
<Image name="Grab" width="128" height="128" xPos="0" yPos="512" />
<Image name="InFront" width="128" height="128" xPos="128" yPos="512" />
<Image name="Behind" width="128" height="128" xPos="256" yPos="512" />
<Image name="EnergyCell" width="128" height="128" xPos="384" yPos="512" />
<Image name="SomethingGray" width="128" height="128" xPos="512" yPos="512" />
<Image name="SomethingRed" width="128" height="128" xPos="640" yPos="512" />
<Image name="SomethingBlue" width="128" height="128" xPos="768" yPos="512" />
<Image name="ShieldExtend" width="128" height="128" xPos="896" yPos="512" />
<Image name="Sniff" width="128" height="128" xPos="0" yPos="640" />
<Image name="ShowRange" width="128" height="128" xPos="128" yPos="640" />
<Image name="Shoot" width="128" height="128" xPos="256" yPos="640" />
<Image name="Head1" width="128" height="128" xPos="384" yPos="640" />
<Image name="Head2" width="128" height="128" xPos="512" yPos="640" />
<Image name="Head3" width="128" height="128" xPos="640" yPos="640" />
<Image name="Head4" width="128" height="128" xPos="768" yPos="640" />
<Image name="ShieldContract" width="128" height="128" xPos="896" yPos="640" />
<Image name="Right" width="128" height="128" xPos="0" yPos="768" />
<Image name="Top" width="128" height="128" xPos="128" yPos="768" />
<Image name="Bottom" width="128" height="128" xPos="256" yPos="768" />
<Image name="Minimize" width="128" height="128" xPos="384" yPos="768" />
<Image name="Maximize" width="128" height="128" xPos="512" yPos="768" />
<Image name="SatComProgram" width="128" height="128" xPos="640" yPos="768" />
<Image name="Maximize2" width="128" height="128" xPos="768" yPos="768" />
<Image name="Left" width="128" height="128" xPos="896" yPos="768" />
<Image name="New" width="128" height="128" xPos="0" yPos="896" />
<Image name="Open" width="128" height="128" xPos="128" yPos="896" />
<Image name="Save" width="128" height="128" xPos="256" yPos="896" />
<Image name="Undo" width="128" height="128" xPos="384" yPos="896" />
<Image name="Cut" width="128" height="128" xPos="512" yPos="896" />
<Image name="Copy" width="128" height="128" xPos="640" yPos="896" />
<Image name="Paste" width="128" height="128" xPos="768" yPos="896" />
<Image name="SatCom" width="128" height="128" xPos="896" yPos="896" />
</Imageset>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" ?>
<Imageset version="2" name="ColobotButton2" imagefile="../../textures/button2.png" autoScaled="vertical" nativeHorzRes="2560" nativeVertRes="1920">
<Image name="ResearchTracked" width="128" height="128" xPos="0" yPos="0" />
<Image name="ResearchWinged" width="128" height="128" xPos="128" yPos="0" />
<Image name="ResearchThumper" width="128" height="128" xPos="256" yPos="0" />
<Image name="ResearchShooter" width="128" height="128" xPos="384" yPos="0" />
<Image name="ResearchDefenseTower" width="128" height="128" xPos="512" yPos="0" />
<Image name="ResearchPhazerShooter" width="128" height="128" xPos="640" yPos="0" />
<Image name="ResearchShielder" width="128" height="128" xPos="768" yPos="0" />
<Image name="ResearchNuclearPlant" width="128" height="128" xPos="896" yPos="0" />
<Image name="SomeButton1" width="128" height="128" xPos="0" yPos="128" />
<Image name="SomeButton2" width="128" height="128" xPos="128" yPos="128" />
<Image name="SomeDPad" width="128" height="128" xPos="256" yPos="128" />
<Image name="SomeBar1" width="32" height="128" xPos="384" yPos="128" />
<Image name="SomeBar2" width="96" height="32" xPos="416" yPos="128" />
<Image name="SomeBar3" width="96" height="32" xPos="416" yPos="160" />
<Image name="SomeBar4" width="32" height="64" xPos="416" yPos="192" />
<Image name="SomeBar5" width="32" height="64" xPos="448" yPos="192" />
<Image name="SomeBar6" width="32" height="64" xPos="480" yPos="192" />
<Image name="SomeButton3" width="128" height="128" xPos="512" yPos="128" />
<Image name="SatComStandby" width="128" height="128" xPos="640" yPos="128" />
<Image name="SomeShadow" width="128" height="128" xPos="768" yPos="128" />
<Image name="SomethingVertical" width="128" height="128" xPos="896" yPos="128" />
<Image name="WhatIsThis" width="256" height="256" xPos="0" yPos="256" />
<Image name="FontSize1" width="128" height="128" xPos="256" yPos="256" />
<Image name="FontSize2" width="128" height="128" xPos="384" yPos="256" />
<Image name="SomeButton4" width="128" height="128" xPos="512" yPos="256" />
<Image name="ProgramStop" width="128" height="128" xPos="640" yPos="256" />
<Image name="ProgramContinue" width="128" height="128" xPos="768" yPos="256" />
<Image name="Compile" width="128" height="128" xPos="896" yPos="256" />
<Image name="FontSize3" width="128" height="128" xPos="256" yPos="384" />
<Image name="FontSize4" width="128" height="128" xPos="384" yPos="384" />
<Image name="ButtonBar1" width="32" height="128" xPos="512" yPos="384" />
<Image name="ButtonBar2" width="32" height="128" xPos="544" yPos="384" />
<Image name="ButtonBar3" width="32" height="128" xPos="576" yPos="384" />
<Image name="ButtonBar4" width="32" height="128" xPos="608" yPos="384" />
<Image name="ProgramStep" width="128" height="128" xPos="640" yPos="384" />
<Image name="SomeButton5" width="128" height="128" xPos="640" yPos="384" />
<Image name="SomthingHorizontal" width="128" height="128" xPos="640" yPos="384" />
</Imageset>

View File

@ -4,16 +4,15 @@
<Property name="MaxSize" value="{{1,0},{1,0}}" />
<Window type="DefaultWindow" name="root">
<!--<Window type="WindowsLook/StaticText" name="hello_world">
<Property name="Font" value="dvu_sans-12" />
<Property name="Text" value="CEGUI is working!" />
<Property name="UnifiedMaxSize" value="{{1,0},{1,0}}" />
<Property name="UnifiedAreaRect" value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
</Window>-->
<Window type="Colobot/ImageButton" name="test_button">
<Property name="Area" value="{{0,0},{0,0},{0,64},{0,64}}" />
<Property name="Disabled" value="false" />
<Property name="Image" value="ColobotButton1/Edit" />
</Window>
<Window type="Colobot/TextButton" name="test_button2">
<Property name="Area" value="{{0,0},{0,128},{0,192},{0,192}}" />
<Property name="Disabled" value="false" />
<Property name="Text" value="test" />
</Window>
</Window>
</GUILayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<Falagard version="7">
<WidgetLook name="Colobot/ImageButton">
<PropertyDefinition name="Image" initialValue="ColobotButton1/ButtonDead" redrawOnWrite="true" />
<PropertyDefinition name="Image" initialValue="" redrawOnWrite="true" />
<ImagerySection name="background_normal">
<ImageryComponent>
@ -135,13 +135,11 @@
</ImageryComponent>
</ImagerySection>
<!-- TODO: background_dead = ColobotButton1/Disabled -->
<!-- TODO: background_dead => ColobotButton1/Disabled -->
<StateImagery name="Normal">
<Layer>
<Section section="background_normal" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
@ -149,8 +147,6 @@
<StateImagery name="Hover">
<Layer>
<Section section="background_hover" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
@ -158,8 +154,6 @@
<StateImagery name="Pushed">
<Layer>
<Section section="background_pushed" />
</Layer>
<Layer>
<Section section="image_pushed" />
</Layer>
</StateImagery>
@ -167,10 +161,310 @@
<StateImagery name="Disabled">
<Layer>
<Section section="background_disabled" />
</Layer>
<Layer>
<Section section="image" />
</Layer>
</StateImagery>
</WidgetLook>
<WidgetLook name="Colobot/TextButton">
<PropertyDefinition name="Align" initialValue="WordWrapCentreAligned" redrawOnWrite="true" />
<PropertyDefinition name="VAlign" initialValue="CentreAligned" redrawOnWrite="true" />
<ImagerySection name="background_normal_top_left">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.05" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.05" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalTL" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_top">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.05" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.95" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.05" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalT" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_top_right">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.95" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="1" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.05" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalTR" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_left">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.05" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.05" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.95" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalL" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_right">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.95" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.05" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="1" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.95" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalR" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_bottom_left">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.95" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.05" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="1" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalBL" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_bottom">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.05" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.95" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.95" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="1" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalB" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_bottom_right">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.95" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.95" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="1" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="1" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalBR" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_normal_center">
<FrameComponent>
<Area>
<Dim type="LeftEdge"><UnifiedDim scale="0.05" offset="0" type="LeftEdge" /></Dim>
<Dim type="TopEdge"><UnifiedDim scale="0.05" offset="0" type="TopEdge" /></Dim>
<Dim type="RightEdge"><UnifiedDim scale="0.95" offset="0" type="RightEdge" /></Dim>
<Dim type="BottomEdge"><UnifiedDim scale="0.95" offset="0" type="BottomEdge" /></Dim>
</Area>
<Image name="ColobotButton1/ButtonBgNormalC" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="background_hover">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgHover" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="background_pushed">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgPushed" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="background_disabled">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton1/ButtonBgDisabled" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="label">
<TextComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="0" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="1" offset="0" type="BottomEdge" />
</Dim>
</Area>
<HorzFormatProperty name="Align" />
<VertFormatProperty name="VAlign" />
<Colours topLeft="FF000000" topRight="FF000000" bottomLeft="FF000000" bottomRight="FF000000" />
</TextComponent>
</ImagerySection>
<ImagerySection name="bar1">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="7" />
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="7" />
</Dim>
<Dim type="RightEdge">
<AbsoluteDim value="13" />
</Dim>
<Dim type="BottomEdge">
<OperatorDim op="Subtract">
<WidgetDim dimension="Height" />
<AbsoluteDim value="7" />
</OperatorDim>
</Dim>
</Area>
<Image name="ColobotButton2/ButtonBar1" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="bar2">
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<UnifiedDim scale="0.9875" offset="0" type="LeftEdge" />
</Dim>
<Dim type="TopEdge">
<UnifiedDim scale="0.010416667" offset="0" type="TopEdge" />
</Dim>
<Dim type="RightEdge">
<UnifiedDim scale="0.9921875" offset="0" type="RightEdge" />
</Dim>
<Dim type="BottomEdge">
<UnifiedDim scale="0.979166667" offset="0" type="BottomEdge" />
</Dim>
</Area>
<Image name="ColobotButton2/ButtonBar2" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="background_normal_center" />
<Section section="background_normal_top_left" />
<Section section="background_normal_top" />
<Section section="background_normal_top_right" />
<Section section="background_normal_left" />
<Section section="background_normal_right" />
<Section section="background_normal_bottom_left" />
<Section section="background_normal_bottom" />
<Section section="background_normal_bottom_right" />
<Section section="label" />
<Section section="bar1" />
<Section section="bar2" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="background_hover" />
<Section section="label" />
<Section section="bar1" />
<Section section="bar2" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="background_pushed" />
<Section section="label" />
<Section section="bar1" />
<Section section="bar2" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="background_disabled" />
<Section section="label" />
<Section section="bar1" />
<Section section="bar2" />
</Layer>
</StateImagery>
</WidgetLook>
</Falagard>

View File

@ -2,9 +2,11 @@
<GUIScheme version="5" name="Colobot">
<Imageset filename="mouse.imageset" />
<Imageset filename="button1.imageset" />
<Imageset filename="button2.imageset" />
<Font filename="dvu_sans-12.font" />
<LookNFeel filename="colobot.looknfeel" />
<WindowRendererSet filename="CEGUICoreWindowRendererSet" />
<Font filename="dvu_sans-12.font" />
<FalagardMapping windowType="Colobot/ImageButton" targetType="CEGUI/PushButton" renderer="Core/Button" lookNFeel="Colobot/ImageButton" />
<FalagardMapping windowType="Colobot/TextButton" targetType="CEGUI/PushButton" renderer="Core/Button" lookNFeel="Colobot/TextButton" />
</GUIScheme>