0.8.4 - Falagard - System button to close windows bug or looknfeel mistake?

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

Bertram
Quite a regular
Quite a regular
Posts: 73
Joined: Wed Oct 02, 2013 14:46

0.8.4 - Falagard - System button to close windows bug or looknfeel mistake?

Postby Bertram » Wed Mar 30, 2016 22:02

Hi there guys, :D

It's been a long time, eh, and I hope you guy are doing fine. Congrats for the 0.8.5 release, btw.

Here is the problem I'd like to talk about this time:

In short, the system button autocreated for framewindows titlebars hoverable/clickable zone is shifted bottom-right by 50% of the size of the button.
This means that when you hover/click on the top-left part of the button, it doesn't react.

Other buttons, created with the same widget type behave just fine.

Am I doing something wrong or is it a bug? How could I debug this, or help you fix this one?

We have the following looknfeel parts:

For the frameWindows:

Code: Select all

    <WidgetLook name="OD/FrameWindow">
        <PropertyLinkDefinition initialValue="FFFFFFFF" name="CaptionColour" targetProperty="CaptionColour" widget="__auto_titlebar__" />
        <PropertyLinkDefinition name="TitlebarFont" targetProperty="Font" widget="__auto_titlebar__" />
        <Property name="NSSizingCursorImage" value="OpenDungeonsSkin/MouseNoSoCursor" />
        <Property name="EWSizingCursorImage" value="OpenDungeonsSkin/MouseEsWeCursor" />
        <Property name="NWSESizingCursorImage" value="OpenDungeonsSkin/MouseNwSeCursor" />
        <Property name="NESWSizingCursorImage" value="OpenDungeonsSkin/MouseNeSwCursor" />
        <NamedArea name="ClientWithTitleWithFrame">
            <Area />

        </NamedArea>
        <NamedArea name="ClientWithTitleNoFrame">
            <Area>
                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
                <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
                <Dim type="BottomEdge"><WidgetDim dimension="BottomEdge" /></Dim>
            </Area>
        </NamedArea>
        <NamedArea name="ClientNoTitleWithFrame">
            <Area>
                <Dim type="LeftEdge"><ImageDim dimension="Width" name="OpenDungeonsSkin/WindowTopLeft" /></Dim>
                <Dim type="TopEdge"><ImageDim dimension="Height" name="OpenDungeonsSkin/WindowTopEdge" /></Dim>
                <Dim type="RightEdge">
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="RightEdge" />
                        <ImageDim dimension="Width" name="OpenDungeonsSkin/WindowTopRight" />
                    </OperatorDim>
                </Dim>
                <Dim type="BottomEdge">
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="BottomEdge" />
                        <ImageDim dimension="Height" name="OpenDungeonsSkin/WindowBottomEdge" />
                    </OperatorDim>
                </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 nameSuffix="__auto_titlebar__" type="OD/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 padding="12" type="LineSpacing" />
                </Dim>
            </Area>
            <Property name="AlwaysOnTop" value="False" />
            <Property name="WantsMultiClickEvents" value="False" />
        </Child>
        <Child nameSuffix="__auto_closebutton__" type="OD/SystemButton">
            <Area>
                <Dim type="LeftEdge">
                    <OperatorDim op="Subtract"><UnifiedDim scale="1" type="LeftEdge" />
                        <OperatorDim op="Add">
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/SysAreaRight" />
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/SysAreaMiddle" />
                        </OperatorDim>
                    </OperatorDim>
                </Dim>
                <Dim type="TopEdge">
                    <OperatorDim op="Multiply">
                        <AbsoluteDim value="0.5" />
                        <OperatorDim op="Subtract">
                            <WidgetDim dimension="Height" widget="__auto_titlebar__" />
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" />
                        </OperatorDim>
                    </OperatorDim>
                </Dim>
                <Dim type="Width"><ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" /></Dim>
                <Dim type="Height"><ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" /></Dim>
            </Area>
            <Property name="AlwaysOnTop" value="True" />
            <Property name="NormalImage" value="OpenDungeonsSkin/CloseButtonNormal" />
            <Property name="HoverImage" value="OpenDungeonsSkin/CloseButtonHover" />
            <Property name="PushedImage" value="OpenDungeonsSkin/CloseButtonPressed" />
        </Child>
        <ImagerySection name="withtitle_frame">
            <FrameComponent>
                <Area>
                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="TopEdge">
                        <WidgetDim dimension="BottomEdge" widget="__auto_titlebar__" />
                        <UnifiedDim offset="0" type="Height" />
                    </Dim>
                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
                </Area>
                <Image component="TopEdge" name="OpenDungeonsSkin/WindowTopEdge" />
                <Image component="TopLeftCorner" name="OpenDungeonsSkin/WindowTopLeft" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/WindowTopRight" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/WindowBottomLeft" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/WindowBottomRight" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/WindowLeftEdge" />
                <Image component="RightEdge" name="OpenDungeonsSkin/WindowRightEdge" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/WindowBottomEdge" />
                <Image component="Background" name="OpenDungeonsSkin/ClientBrush" />
                <VertFormat type="Tiled" />
                <HorzFormat type="Tiled" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="notitle_frame">
            <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 component="TopLeftCorner" name="OpenDungeonsSkin/WindowTopLeft" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/WindowTopRight" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/WindowBottomLeft" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/WindowBottomRight" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/WindowLeftEdge" />
                <Image component="RightEdge" name="OpenDungeonsSkin/WindowRightEdge" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/WindowBottomEdge" />
                <Image component="Background" name="OpenDungeonsSkin/ClientBrush" />
                <VertFormat type="Tiled" />
                <HorzFormat type="Tiled" />
            </FrameComponent>
        </ImagerySection>
        <ImagerySection name="withtitle_noframe_client_area">
            <ImageryComponent>
                <Area>
                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="TopEdge">
                        <WidgetDim dimension="BottomEdge" widget="__auto_titlebar__" />
                        <UnifiedDim offset="0" type="Height" />
                    </Dim>
                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
                </Area>
                <Image name="OpenDungeonsSkin/ClientBrush" />
                <VertFormat type="Tiled" />
                <HorzFormat type="Tiled" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="notitle_noframe_client_area">
            <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 name="OpenDungeonsSkin/ClientBrush" />
                <VertFormat type="Tiled" />
                <HorzFormat type="Tiled" />
            </ImageryComponent>
        </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">
                    <Colours bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" topLeft="FF7F7F7F" topRight="FF7F7F7F" />
                </Section>
            </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">
                    <Colours bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" topLeft="FF7F7F7F" topRight="FF7F7F7F" />
                </Section>
            </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">
                    <Colours bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" topLeft="FF7F7F7F" topRight="FF7F7F7F" />
                </Section>
            </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">
                    <Colours bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" topLeft="FF7F7F7F" topRight="FF7F7F7F" />
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>


And for the button/SystemButton used:
In the scheme file:

Code: Select all

...
<FalagardMapping lookNFeel="OD/Button" renderer="Core/Button" targetType="CEGUI/PushButton" windowType="OD/Button" />
<FalagardMapping lookNFeel="OD/Button" renderer="Core/Button" targetType="CEGUI/PushButton" windowType="OD/SystemButton" />
...


Code: Select all

    <WidgetLook name="OD/Button">
        <Property name="WantsMultiClickEvents" value="False" />
        <PropertyDefinition initialValue="FFFFFFFF" name="NormalTextColour" redrawOnWrite="true" />
        <PropertyDefinition initialValue="FFFFFFFF" name="HoverTextColour" redrawOnWrite="true" />
        <PropertyDefinition initialValue="FFFFFFFF" name="PushedTextColour" redrawOnWrite="true" />
        <PropertyDefinition initialValue="FF7F7F7F" name="DisabledTextColour" redrawOnWrite="true" />
        <PropertyDefinition initialValue="CentreAligned" name="VertLabelFormatting" />
        <PropertyDefinition initialValue="CentreAligned" name="HorzLabelFormatting" />
        <PropertyDefinition initialValue="" name="NormalImage" redrawOnWrite="true" />
        <PropertyDefinition initialValue="" name="HoverImage" redrawOnWrite="true" />
        <PropertyDefinition initialValue="" name="PushedImage" redrawOnWrite="true" />
        <PropertyDefinition initialValue="" name="DisabledImage" redrawOnWrite="true" />
        <PropertyDefinition initialValue="Stretched" name="VertImageFormatting" redrawOnWrite="true" />
        <PropertyDefinition initialValue="Stretched" name="HorzImageFormatting" redrawOnWrite="true" />
        <ImagerySection name="label">
            <TextComponent>
                <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>
                <VertFormatProperty name="VertLabelFormatting" />
                <HorzFormatProperty name="HorzLabelFormatting" />
            </TextComponent>
        </ImagerySection>
        <ImagerySection name="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 component="TopLeftCorner" name="OpenDungeonsSkin/ButtonTopLeftNormal" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/ButtonTopRightNormal" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/ButtonBottomLeftNormal" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/ButtonBottomRightNormal" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/ButtonLeftNormal" />
                <Image component="RightEdge" name="OpenDungeonsSkin/ButtonRightNormal" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/ButtonBottomNormal" />
                <Image component="TopEdge" name="OpenDungeonsSkin/ButtonTopNormal" />
                <Image component="Background" name="OpenDungeonsSkin/ButtonMiddleNormal" />
            </FrameComponent>
            <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>
                <ImageProperty name="NormalImage" />
                <VertFormatProperty name="VertImageFormatting" />
                <HorzFormatProperty name="HorzImageFormatting" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="hover">
            <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 component="TopLeftCorner" name="OpenDungeonsSkin/ButtonTopLeftHighlight" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/ButtonTopRightHighlight" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/ButtonBottomLeftHighlight" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/ButtonBottomRightHighlight" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/ButtonLeftHighlight" />
                <Image component="RightEdge" name="OpenDungeonsSkin/ButtonRightHighlight" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/ButtonBottomHighlight" />
                <Image component="TopEdge" name="OpenDungeonsSkin/ButtonTopHighlight" />
                <Image component="Background" name="OpenDungeonsSkin/ButtonMiddleHighlight" />
            </FrameComponent>
            <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>
                <ImageProperty name="HoverImage" />
                <VertFormatProperty name="VertImageFormatting" />
                <HorzFormatProperty name="HorzImageFormatting" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="pushed">
            <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 component="TopLeftCorner" name="OpenDungeonsSkin/ButtonTopLeftPushed" />
                <Image component="TopRightCorner" name="OpenDungeonsSkin/ButtonTopRightPushed" />
                <Image component="BottomLeftCorner" name="OpenDungeonsSkin/ButtonBottomLeftPushed" />
                <Image component="BottomRightCorner" name="OpenDungeonsSkin/ButtonBottomRightPushed" />
                <Image component="LeftEdge" name="OpenDungeonsSkin/ButtonLeftPushed" />
                <Image component="RightEdge" name="OpenDungeonsSkin/ButtonRightPushed" />
                <Image component="BottomEdge" name="OpenDungeonsSkin/ButtonBottomPushed" />
                <Image component="TopEdge" name="OpenDungeonsSkin/ButtonTopPushed" />
                <Image component="Background" name="OpenDungeonsSkin/ButtonMiddlePushed" />
            </FrameComponent>
            <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>
                <ImageProperty name="PushedImage" />
                <VertFormatProperty name="VertImageFormatting" />
                <HorzFormatProperty name="HorzImageFormatting" />
            </ImageryComponent>
        </ImagerySection>
        <StateImagery name="Normal">
            <Layer>
                <Section section="normal" />
                <Section section="label">
                    <ColourProperty name="NormalTextColour" />
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Hover">
            <Layer>
                <Section section="hover" />
                <Section section="label">
                    <ColourProperty name="HoverTextColour" />
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Pushed">
            <Layer>
                <Section section="pushed" />
                <Section section="label">
                    <ColourProperty name="PushedTextColour" />
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="PushedOff">
            <Layer>
                <Section section="hover" />
                <Section section="label">
                    <ColourProperty name="HoverTextColour" />
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="normal">
                    <Colours bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" topLeft="FF7F7F7F" topRight="FF7F7F7F" />
                </Section>
                <Section section="label">
                    <ColourProperty name="DisabledTextColour" />
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>



Here is the interesting part from FrameWindow, IMHO:

Code: Select all

        <Child nameSuffix="__auto_closebutton__" type="OD/SystemButton">
            <Area>
                <Dim type="LeftEdge">
                    <OperatorDim op="Subtract"><UnifiedDim scale="1" type="LeftEdge" />
                        <OperatorDim op="Add">
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/SysAreaRight" />
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/SysAreaMiddle" />
                        </OperatorDim>
                    </OperatorDim>
                </Dim>
                <Dim type="TopEdge">
                    <OperatorDim op="Multiply">
                        <AbsoluteDim value="0.5" />
                        <OperatorDim op="Subtract">
                            <WidgetDim dimension="Height" widget="__auto_titlebar__" />
                            <ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" />
                        </OperatorDim>
                    </OperatorDim>
                </Dim>
                <Dim type="Width"><ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" /></Dim>
                <Dim type="Height"><ImageDim dimension="Width" name="OpenDungeonsSkin/CloseButtonNormal" /></Dim>
            </Area>
            <Property name="AlwaysOnTop" value="True" />
            <Property name="NormalImage" value="OpenDungeonsSkin/CloseButtonNormal" />
            <Property name="HoverImage" value="OpenDungeonsSkin/CloseButtonHover" />
            <Property name="PushedImage" value="OpenDungeonsSkin/CloseButtonPressed" />
        </Child>


Cheers,

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: 0.8.4 - Falagard - System button to close windows bug or looknfeel mistake?

Postby Ident » Sat Apr 02, 2016 22:51

Can you make a guess what is actually not at the right spot: the rendering or the click area?

Other buttons, created with the same widget type behave just fine.

Can you specify this a bit more? I am not sure I get it. You tried other buttons for the otherwise identical FrameWindow code and they worked?

To be honest I have never encountered this but it definitely sounds like a bug.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests