The Lederhosen project - The Second Coming

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Revision as of 01:33, 20 March 2014 by Ident (Talk | contribs) (The following contains an example of inheritanced based on Vanilla/Button)

Jump to: navigation, search

My proposal is to make falagard widgets derivable. Basically they should work the same way once they are loaded into the internal data structures, but in XML the possibility will be given to inherit each widget from a parent widget, modifying certain properties and elements to skin the original widget in a specific way. This should allow slimmer LNF's that rely on one generic LNF containing general widget designs. These slimmer LNF's will merely contain that information that is necessary to give the widget a new look based on user-defined imagery, fonts, etc. The TaharezLook is the most complete LNF of all and will therefore be used as basis for creating the one inheriting LNF, which will contain all the inheriting widgets.

The following contains an example of inheritanced based on Vanilla/Button

Original Vanilla/Button:

<WidgetLook name="Vanilla/Button">
        <PropertyDefinition redrawOnWrite="true" initialValue="FFFFFFFF" type="ColourRect" name="NormalTextColour"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="FFFFFFFF" type="ColourRect" name="HoverTextColour"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="FFFFFFFF" type="ColourRect" name="PushedTextColour"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="FF888888" type="ColourRect" name="DisabledTextColour"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="True" type="bool" name="UseStandardImagery"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="" type="Image" name="NormalImage"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="" type="Image" name="HoverImage"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="" type="Image" name="PushedImage"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="Stretched" type="VerticalFormatting" name="VertImageFormatting"/>
        <PropertyDefinition redrawOnWrite="true" initialValue="Stretched" type="HorizontalFormatting" name="HorzImageFormatting"/>
        <Property name="WantsMultiClickEvents" value="False"/>
        <Property name="Size" value="{{0, 96}, {0, 32}}" />
        <ImagerySection name="label">
            <TextComponent>
                <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>
                <VertFormat type="CentreAligned"/>
                <HorzFormat type="WordWrapCentreAligned"/>
            </TextComponent>
        </ImagerySection>
        <ImagerySection name="normal_image">
            <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_image">
            <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_image">
            <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="Frame" look="Vanilla/Shared" controlProperty="UseStandardImagery">
                    <Colours topLeft="FF7F7F7F" bottomLeft="FF7F7F7F" topRight="FF7F7F7F" bottomRight="FF7F7F7F"/>
                </Section>
                <Section section="normal_image"/>
                <Section section="label">
                    <ColourProperty name="NormalTextColour"/>
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Hover">
            <Layer>
                <Section section="Frame" look="Vanilla/Shared" controlProperty="UseStandardImagery">
                    <Colours topLeft="FF9F9F9F" bottomLeft="FF9F9F9F" topRight="FF9F9F9F" bottomRight="FF9F9F9F"/>
                </Section>
                <Section section="hover_image"/>
                <Section section="label">
                    <ColourProperty name="HoverTextColour"/>
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Pushed">
            <Layer>
                <Section section="Frame" look="Vanilla/Shared" controlProperty="UseStandardImagery">
                    <Colours topLeft="FF6F6F6F" bottomLeft="FF6F6F6F" topRight="FF6F6F6F" bottomRight="FF6F6F6F"/>
                </Section>
                <Section section="pushed_image"/>
                <Section section="label">
                    <ColourProperty name="PushedTextColour"/>
                </Section>
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="Frame" look="Vanilla/Shared" controlProperty="UseStandardImagery">
                    <Colours topLeft="FF3F3F3F" bottomLeft="FF3F3F3F" topRight="FF3F3F3F" bottomRight="FF3F3F3F"/>
                </Section>
                <Section section="normal_image">
                    <Colours topLeft="FF3F3F3F" bottomLeft="FF3F3F3F" topRight="FF3F3F3F" bottomRight="FF3F3F3F"/>
                </Section>
                <Section section="label">
                    <ColourProperty name="DisabledTextColour"/>
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>