I'm not sure but I might have found a bug or I'm doing something incorrectly. So here's my static text lookNfeel code:
Code: Select all
<!--
***************************************************
Game/StaticText
***************************************************
-->
<WidgetLook name="Game/StaticText">
<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
<Property name="FrameEnabled" value="False" />
<Property name="BackgroundEnabled" value="False" />
<NamedArea name="WithFrameTextRenderArea">
<Area>
<Dim type="LeftEdge" >
<ImageDim imageset="Game" image="StaticTopLeft" dimension="Width" >
<DimOperator op="Subtract">
<AbsoluteDim value="10" />
</DimOperator>
</ImageDim>
</Dim>
<Dim type="TopEdge" >
<ImageDim imageset="Game" image="StaticTop" dimension="Height" >
</ImageDim>
</Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<ImageDim imageset="Game" image="StaticTopRight" dimension="Width" >
<DimOperator op="Subtract">
<AbsoluteDim value="15" />
</DimOperator>
</ImageDim>
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<NamedArea name="WithFrameTextRenderAreaHScroll">
<Area>
<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<NamedArea name="WithFrameTextRenderAreaVScroll">
<Area>
<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<NamedArea name="WithFrameTextRenderAreaHVScroll">
<Area>
<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<NamedArea name="NoFrameTextRenderArea">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
</Area>
</NamedArea>
<NamedArea name="NoFrameTextRenderAreaHScroll">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<NamedArea name="NoFrameTextRenderAreaVScroll">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
</Area>
</NamedArea>
<NamedArea name="NoFrameTextRenderAreaHVScroll">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" >
<UnifiedDim scale="1" type="RightEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
</NamedArea>
<Child type="Game/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
<Dim type="Height" ><AbsoluteDim value="12" /></Dim>
</Area>
<VertAlignment type="BottomAligned" />
</Child>
<Child type="Game/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><AbsoluteDim value="12" /></Dim>
<Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
</Area>
<HorzAlignment type="RightAligned" />
</Child>
<StateImagery name="Enabled" />
<StateImagery name="Disabled" />
<StateImagery name="EnabledFrame">
<Layer>
<Section look="Game/StaticShared" section="frame" />
</Layer>
</StateImagery>
<StateImagery name="DisabledFrame">
<Layer>
<Section look="Game/StaticShared" section="frame" />
</Layer>
</StateImagery>
<StateImagery name="WithFrameEnabledBackground">
<Layer>
<Section look="Game/StaticShared" section="background" />
</Layer>
</StateImagery>
<StateImagery name="WithFrameDisabledBackground">
<Layer>
<Section look="Game/StaticShared" section="background" />
</Layer>
</StateImagery>
<StateImagery name="NoFrameEnabledBackground">
<Layer>
<Section look="Game/StaticShared" section="background_noframe" />
</Layer>
</StateImagery>
<StateImagery name="NoFrameDisabledBackground">
<Layer>
<Section look="Game/StaticShared" section="background_noframe" />
</Layer>
</StateImagery>
</WidgetLook>
and when I'm trying to display some static text with such property set:
Code: Select all
MyText->setProperty("HorzFormatting", "WordWrapLeftAligned");
the word wrapping works but it doesn't seem to calculate correctly the area of rendering text becouse in lookNfeel above I'm substracting from my right dimension some value. In some places my text is just cut, not wrapped to next line. But setting right dimension to unified dim = 1 without substracting anything makes the text is wrapped correctly but it doesn't suit its frame then . Here's picture:
Cegui.log:
Code: Select all
26/10/2012 20:01:01 (Std) * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
26/10/2012 20:01:01 (Std) ********************************************************************************
26/10/2012 20:01:01 (Std) ---- Version 0.7.8 (Build: Aug 9 2012 Microsoft Windows MSVC++ 10.0 32 bit) ----
26/10/2012 20:01:01 (Std) ---- Renderer module is: CEGUI::Direct3D9Renderer - Official Direct3D 9 based 2nd generation renderer module. ----
26/10/2012 20:01:01 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
26/10/2012 20:01:01 (Std) ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
26/10/2012 20:01:01 (Std) ---- Scripting module is: None ----
26/10/2012 20:01:01 (Std) ********************************************************************************
26/10/2012 20:01:01 (Std) * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
I will be very grateful if you could find some time to look up this problem!