Falagard question (modifying Vanilla skin)

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

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Falagard question (modifying Vanilla skin)

Postby Nitro » Sun Dec 13, 2009 17:13

Hello,

simple question: How do I make the close button in a FrameWindow of the vanilla skin appear in the titlebar instead of somewhere below it?

I tried modifying the looknfeel, even copied and pasted the FrameWindow code from the TaharezLook and WindowsLook, but that only made the button appear on the right-hand side center of the frame. I have the feeling I am missing something very essential.

Below is the FrameWindow part of the vanilla look'n'feel. You would think it's as easy as setting TopEdge AbsoluteDim to something like -20, but then the button disappears (I suppose it's either clipped or ends up behind the titlebar).

Any ideas?

-Matthias

Code: Select all

    <WidgetLook name="Vanilla/FrameWindow">
        <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" />
        <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" />
        <PropertyDefinition name="ClientAreaColour" initialValue="FF333333" redrawOnWrite="true" />
        <Property name="NSSizingCursorImage" value="set:Vanilla-Images image:MouseArrow" />
        <Property name="EWSizingCursorImage" value="set:Vanilla-Images image:MouseArrow" />
        <Property name="NWSESizingCursorImage" value="set:Vanilla-Images image:MouseArrow" />
        <Property name="NESWSizingCursorImage" value="set:Vanilla-Images image:MouseArrow" />
        <Property name="RollUpEnabled" value="False" />
        <Property name="UnifiedMinSize" value="{{0.1,0},{0.1,0}}" />
        <Property name="AutoRenderingSurface" value="False" />
        <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="Vanilla/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="Vanilla/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>
        <ImagerySection name="withtitle_frame">
            <FrameComponent>
                <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>
                <Image type="TopLeftCorner" imageset="Vanilla-Images" image="FrameTopLeft" />
                <Image type="TopRightCorner" imageset="Vanilla-Images" image="FrameTopRight" />
                <Image type="BottomLeftCorner" imageset="Vanilla-Images" image="FrameBottomLeft" />
                <Image type="BottomRightCorner" imageset="Vanilla-Images" image="FrameBottomRight" />
                <Image type="LeftEdge" imageset="Vanilla-Images" image="FrameLeft" />
                <Image type="TopEdge" imageset="Vanilla-Images" image="FrameTop" />
                <Image type="RightEdge" imageset="Vanilla-Images" image="FrameRight" />
                <Image type="BottomEdge" imageset="Vanilla-Images" image="FrameBottom" />
                <Image type="Background" imageset="Vanilla-Images" image="GenericBrush" />
                <ColourProperty name="ClientAreaColour" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="notitle_frame">
            <FrameComponent>
                <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>
                <Image type="TopLeftCorner" imageset="Vanilla-Images" image="FrameTopLeft" />
                <Image type="TopRightCorner" imageset="Vanilla-Images" image="FrameTopRight" />
                <Image type="BottomLeftCorner" imageset="Vanilla-Images" image="FrameBottomLeft" />
                <Image type="BottomRightCorner" imageset="Vanilla-Images" image="FrameBottomRight" />
                <Image type="LeftEdge" imageset="Vanilla-Images" image="FrameLeft" />
                <Image type="TopEdge" imageset="Vanilla-Images" image="FrameTop" />
                <Image type="RightEdge" imageset="Vanilla-Images" image="FrameRight" />
                <Image type="BottomEdge" imageset="Vanilla-Images" image="FrameBottom" />
                <Image type="Background" imageset="Vanilla-Images" image="GenericBrush" />
                <ColourProperty name="ClientAreaColour" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="withtitle_noframe_client_area">
            <FrameComponent>
                <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>
                <Image type="TopLeftCorner" imageset="Vanilla-Images" image="FrameTopLeft" />
                <Image type="TopRightCorner" imageset="Vanilla-Images" image="FrameTopRight" />
                <Image type="BottomLeftCorner" imageset="Vanilla-Images" image="FrameBottomLeft" />
                <Image type="BottomRightCorner" imageset="Vanilla-Images" image="FrameBottomRight" />
                <Image type="LeftEdge" imageset="Vanilla-Images" image="FrameLeft" />
                <Image type="TopEdge" imageset="Vanilla-Images" image="FrameTop" />
                <Image type="RightEdge" imageset="Vanilla-Images" image="FrameRight" />
                <Image type="BottomEdge" imageset="Vanilla-Images" image="FrameBottom" />
                <Image type="Background" imageset="Vanilla-Images" image="GenericBrush" />
                <ColourProperty name="ClientAreaColour" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="notitle_noframe_client_area">
            <FrameComponent>
                <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>
                <Image type="TopLeftCorner" imageset="Vanilla-Images" image="FrameTopLeft" />
                <Image type="TopRightCorner" imageset="Vanilla-Images" image="FrameTopRight" />
                <Image type="BottomLeftCorner" imageset="Vanilla-Images" image="FrameBottomLeft" />
                <Image type="BottomRightCorner" imageset="Vanilla-Images" image="FrameBottomRight" />
                <Image type="LeftEdge" imageset="Vanilla-Images" image="FrameLeft" />
                <Image type="TopEdge" imageset="Vanilla-Images" image="FrameTop" />
                <Image type="RightEdge" imageset="Vanilla-Images" image="FrameRight" />
                <Image type="BottomEdge" imageset="Vanilla-Images" image="FrameBottom" />
                <Image type="Background" imageset="Vanilla-Images" image="GenericBrush" />
                <ColourProperty name="ClientAreaColour" />
            </FrameComponent>
        </ImagerySection>
        <StateImagery name="ActiveWithTitleWithFrame">
            <Layer>
                <Section section="withtitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="InactiveWithTitleWithFrame">
            <Layer>
                <Section section="withtitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="DisabledWithTitleWithFrame">
            <Layer>
                <Section section="withtitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="ActiveWithTitleNoFrame">
            <Layer>
                <Section section="withtitle_noframe_client_area" />
            </Layer>
        </StateImagery>
        <StateImagery name="InactiveWithTitleNoFrame">
            <Layer>
                <Section section="withtitle_noframe_client_area" />
            </Layer>
        </StateImagery>
        <StateImagery name="DisabledWithTitleNoFrame">
            <Layer>
                <Section section="withtitle_noframe_client_area" />
            </Layer>
        </StateImagery>
        <StateImagery name="ActiveNoTitleWithFrame">
            <Layer>
                <Section section="notitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="InactiveNoTitleWithFrame">
            <Layer>
                <Section section="notitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="DisabledNoTitleWithFrame">
            <Layer>
                <Section section="notitle_frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="ActiveNoTitleNoFrame">
            <Layer>
                <Section section="notitle_noframe_client_area" />
            </Layer>
        </StateImagery>
        <StateImagery name="InactiveNoTitleNoFrame">
            <Layer>
                <Section section="notitle_noframe_client_area" />
            </Layer>
        </StateImagery>
        <StateImagery name="DisabledNoTitleNoFrame">
            <Layer>
                <Section section="notitle_noframe_client_area" />
            </Layer>
        </StateImagery>
    </WidgetLook>

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

Re: Falagard question (modifying Vanilla skin)

Postby CrazyEddie » Sun Dec 13, 2009 17:39

Hi,

I think I missed this in the update.

Adding:

Code: Select all

<Property name="NonClient" value="True" />

in the Child definition for "__auto_closebutton__", should fix it. I'll get this change into SVN later tonight :D

CE.

User avatar
Nitro
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Jan 12, 2005 12:06

Re: Falagard question (modifying Vanilla skin)

Postby Nitro » Sun Dec 13, 2009 17:47

Ohhhh damnit. I tried that before, but it made my application crash. Now I realize why... The Moved/Sized events are fired now when I do addChildWindow(). They didn't do this when the NonClient flag wasn't there. I should've debugged further I guess :)

Thanks again, CrazyGeniusEddy :)

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Falagard question (modifying Vanilla skin)

Postby emarcotte » Wed Jan 20, 2010 00:34

CrazyEddie wrote:

Code: Select all

<Property name="NonClient" value="True" />



Damn. I been looking for this one for a while :)

My looknfeel is much cleaner now. My framewindow's titlebar was part of client area and so all my dialogs' content had to be offset by the titlebar (ugly). Now all is good. Forum search wins again


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests