CloseButtonEnabled inside WidgetLook

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Jacky_J
Just popping in
Just popping in
Posts: 3
Joined: Fri Oct 13, 2006 04:31

CloseButtonEnabled inside WidgetLook

Postby Jacky_J » Sun Oct 15, 2006 09:43

I'm trying to add CloseButtonEnabled as a property to my FrameWindow looknfeel element, however CEGUI.log is giving me:

Exception: WindowManager::getWindow - A Window object with the name 'MainWindow__auto_closebutton__' does not exist within the system

I can add it to the .layout file just fine, but i would rather add it to the .looknfeel as to reduce redundancy. Is it possible to do this?

Thanks

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sun Oct 15, 2006 10:12

Hi Jacky_J,

welcome to the forums :-)

Where exactly did you add the property line? I tried myself and added this line to the Windowslook/FrameWindow:

<Property name="CloseButtonEnabled" value="False" />

as the last property right before this line:
<NamedArea name="ClientWithTitleWithFrame">

And i got no errors of whatsoever... By default the button is enabled.
Which version of cegui do you use?

Good luck!

Jacky_J
Just popping in
Just popping in
Posts: 3
Joined: Fri Oct 13, 2006 04:31

Postby Jacky_J » Mon Oct 16, 2006 05:19

Yeah, i tried putting the line in different places within the element with no luck. It's weird because

<Property name="SizingEnabled" value="False" />
<Property name="RollUpEnabled" value="False" />

both work but when i try to put CloseButtonEnabled in there it doesn't recognize it.

I'm using CEGUI 0.4.1 with falagard skinning.
Anyway, I'm sure it's something simple. Here's the relevant code:

Code: Select all

<WidgetLook name="Jacky/StaticWindow">
      <Property name="SizingEnabled" value="False" />
      <Property name="RollUpEnabled" value="False" />
      <Property name="CloseButtonEnabled" value="False" />
      <ImagerySection name="ImageBorders">
         <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="JackyImages" image="FrameTopLeft" />
            <Image type="TopRightCorner" imageset="JackyImages" image="FrameTopRight" />
            <Image type="BottomLeftCorner" imageset="JackyImages" image="FrameBottomLeft" />
            <Image type="BottomRightCorner" imageset="JackyImages" image="FrameBottomRight" />
            <Image type="LeftEdge" imageset="JackyImages" image="FrameLeft" />
            <Image type="TopEdge" imageset="JackyImages" image="FrameTop" />
            <Image type="RightEdge" imageset="JackyImages" image="FrameRight" />
            <Image type="BottomEdge" imageset="JackyImages" image="FrameBottom" />
            <HorzFormat type="Tiled" />            
            <VertFormat type="Tiled" />
         </FrameComponent>
      </ImagerySection>      
      <ImagerySection name="ImageBackground">
         <ImageryComponent>
            <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="Background" imageset="JackyImages" image="FrameBackground" />
            <HorzFormat type="Stretched" />            
            <VertFormat type="Stretched" />
         </ImageryComponent>
      </ImagerySection>
      <NamedArea name="ClientWithTitleWithFrame">
         <Area>
            <Dim type="LeftEdge"><AbsoluteDim value="7" /></Dim>
            <Dim type="TopEdge"><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
            <Dim type="RightEdge"><UnifiedDim scale="1" offset="-7" type="RightEdge" /></Dim>
            <Dim type="BottomEdge"><UnifiedDim scale="1" offset="-7" type="BottomEdge" /></Dim>
         </Area>
      </NamedArea>
      <NamedArea name="ClientWithTitleNoFrame">
         <Area>
            <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
            <Dim type="TopEdge"><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
            <Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
            <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
         </Area>
      </NamedArea>
      <NamedArea name="ClientNoTitleWithFrame">
         <Area>
            <Dim type="LeftEdge"><AbsoluteDim value="7" /></Dim>
            <Dim type="TopEdge"><AbsoluteDim value="7" /></Dim>
            <Dim type="RightEdge"><UnifiedDim scale="1" offset="-7" type="RightEdge" /></Dim>
            <Dim type="BottomEdge"><UnifiedDim scale="1" offset="-7" type="BottomEdge" /></Dim>
         </Area>
      </NamedArea>
      <NamedArea name="ClientNoTitleNoFrame">
         <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>
      </NamedArea>   
      <Child type="Jacky/Titlebar" nameSuffix="__auto_titlebar__">
         <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" ><FontDim type="LineSpacing" padding="14" /></Dim>
         </Area>
         <Property name="AlwaysOnTop" value="False" />
      </Child>
      <Child type="Jacky/Button" nameSuffix="__auto_closebutton__">
         <Area>
            <Dim type="LeftEdge" ><AbsoluteDim value="-7" /></Dim>
            <Dim type="TopEdge" ><AbsoluteDim value="7" /></Dim>
            <Dim type="Width" ><AbsoluteDim value="7" /></Dim>
            <Dim type="Height" ><AbsoluteDim value="7" /></Dim>
         </Area>
         <HorzAlignment type="RightAligned" />
         <Property name="AlwaysOnTop" value="True" />
      </Child>
      <StateImagery name="ActiveWithTitleWithFrame" />
      <StateImagery name="InactiveWithTitleWithFrame" />
      <StateImagery name="DisabledWithTitleWithFrame" />
      <StateImagery name="ActiveWithTitleNoFrame" />
      <StateImagery name="InactiveWithTitleNoFrame" />
      <StateImagery name="DisabledWithTitleNoFrame" />
      <StateImagery name="ActiveNoTitleWithFrame">
         <Layer>
            <Section section="ImageBorders" />
            <Section section="ImageBackground">
               <Colours topLeft="330000FF" topRight="330000FF" bottomLeft="33AA00FF" bottomRight="33AA00FF" />
            </Section>
         </Layer>
      </StateImagery>
      <StateImagery name="InactiveNoTitleWithFrame">
         <Layer>
            <Section section="ImageBorders" />
            <Section section="ImageBackground">
               <Colours topLeft="330000FF" topRight="330000FF" bottomLeft="33AA00FF" bottomRight="33AA00FF" />
            </Section>
         </Layer>
      </StateImagery>
      <StateImagery name="DisabledNoTitleWithFrame" />
      <StateImagery name="ActiveNoTitleNoFrame" />
      <StateImagery name="InactiveNoTitleNoFrame" />
      <StateImagery name="DisabledNoTitleNoFrame" />
   </WidgetLook>


Code: Select all

<?xml version="1.0" ?>
<GUILayout>

   <Window Type="Jacky/StaticWindow" Name="MainWindow">
      <Property Name="RelativeMinSize" Value="w:0.2 h:0.2" />
      <Property Name="RelativeMaxSize" Value="w:0.8 h:0.8" />
      <Property Name="Position" Value="x:0.3 y:0.1" />
      <Property Name="Size" Value="w:0.3 h:0.5" />
      <Property Name="Text" Value="Window" />
      <Property Name="DragMovingEnabled" Value="False" />
      <Property Name="TitlebarEnabled" Value="False" />
         
      <Window Type="Jacky/Button" Name="Button0">
         <Property Name="Position" Value="x:0.10 y:0.25" />
         <Property Name="Size" Value="w:0.5 h:0.12" />
         <Property Name="Text" Value="Single Player" />
      </Window>

      <Window Type="Jacky/Button" Name="Button1">
         <Property Name="Position" Value="x:0.10 y:0.50" />
         <Property Name="Size" Value="w:0.5 h:0.12" />
         <Property Name="Text" Value="Options" />
      </Window>
      
   </Window>
</GUILayout>


Code: Select all

<?xml version="1.0" ?>
<GUIScheme Name="JackySkin">
   <LookNFeel Filename="jacky.looknfeel" />
   <Imageset Name="JackyImages" Filename="jacky.imageset" />
   <WindowSet Filename="CEGUIFalagardBase" />
   <FalagardMapping WindowType="Jacky/Button" TargetType="Falagard/Button" LookNFeel="Jacky/Button" />
   <FalagardMapping WindowType="Jacky/StaticWindow" TargetType="Falagard/FrameWindow" LookNFeel="Jacky/StaticWindow" />
   <FalagardMapping WindowType="Jacky/Titlebar" TargetType="Falagard/Titlebar" LookNFeel="Jacky/Titlebar" />
</GUIScheme>


Thanks again.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Oct 16, 2006 08:15

I think this is an "order of operation" type bug in, at least the 0.4.x series, code. Basically what that means is that I believe that CEGUI is trying to initialise the properties before the child windows are created - so at that stage the close button does indeed not exist.

I have a feeling that this has been fixed in later versions of the code - though am by no means certain, since I have not tested it.

If it is such a bug in the system, then until we come out with a fixed version, the only solution, unfortunately, is to apply the property to each window in the layouts :(

CE.


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 25 guests