Code: Select all
<!--
***************************************************
TaharezLook/Editbox
***************************************************
-->
<WidgetLook name="TaharezLook/Editbox">
<Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
<NamedArea name="TextArea">
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
<Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
</Area>
</NamedArea>
<ImagerySection name="container_normal">
<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="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" />
<Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" />
<Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" />
</FrameComponent>
</ImagerySection>
<ImagerySection name="selection">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
</Area>
<Image imageset="TaharezLook" image="TextSelectionBrush" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="Carat">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
</Area>
<Image imageset="TaharezLook" image="EditBoxCarat" />
<VertFormat type="Stretched" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<StateImagery name="Enabled">
<Layer>
<Section section="container_normal" />
</Layer>
</StateImagery>
<StateImagery name="ReadOnly">
<Layer>
<Section section="container_normal" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="container_normal">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</Section>
</Layer>
</StateImagery>
<StateImagery name="ActiveSelection">
<Layer>
<Section section="selection">
<ColourProperty name="ActiveSelectionColour" />
</Section>
</Layer>
</StateImagery>
<StateImagery name="InactiveSelection">
<Layer>
<Section section="selection">
<ColourProperty name="InactiveSelectionColour" />
</Section>
</Layer>
</StateImagery>
</WidgetLook>
I want to create it in code. Right now I have a layout which defines some stuff by default:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
<Window Type="DefaultWindow" Name="Root" >
<Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedAreaRect" Value="{{0.000000,0.000000},{0.000000,0.000000},{1.000000,0.000000},{1.000000,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Window Type="TaharezLook/Button" Name="PlaySound" >
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="Text" Value="Play Sound" />
<Property Name="UnifiedAreaRect" Value="{{0.100000,0.000000},{0.100000,0.000000},{0.227499,0.000000},{0.190846,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
<Window Type="TaharezLook/Button" Name="Quit" >
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="Text" Value="Quit" />
<Property Name="UnifiedAreaRect" Value="{{0.095000,0.000000},{0.211959,0.000000},{0.231250,0.000000},{0.298206,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
</Window>
</Window>
</GUILayout>
I don't want the editbox to show up by default, only from code.
So I tried this:
Code: Select all
CEGUI::Window* win = CEGUI::WindowManager::getSingleton().createWindow(type, name);
rootWindow->addChildWindow(win);
However, createWindow always returns 0.
Where should I put the WindowLook XML block inside my layout to make this work? I tried several places and createWindow still returns 0.