horizontal slider

Help and discussion regarding skinning, themes, and other artistic content.

Moderators: CEGUI MVP, CEGUI Team

orion
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Fri Apr 24, 2020 15:56

horizontal slider

Postby orion » Sat Feb 27, 2021 19:09

Hi All

any one got the code for the horizontal slider for the looknfeel i have attempetd to make one and it shows fine but it lags when using the thumb ie doesnt scroll correctly i tried looking at the windows looknfeel but cant really see where its diffrent than i have :(

any pointers welcomed

niello
Quite a regular
Quite a regular
Posts: 76
Joined: Tue May 24, 2011 05:54
Contact:

Re: horizontal slider

Postby niello » Wed Jan 19, 2022 08:02

Sorry for the late answer but I hope it is still useful for anyone. This is a slider I implemented for my project.

Slider code from the master branch handles it correctly, but 0.8.7 may need backporting, which souldn't be very hard, see:
https://github.com/cegui/cegui/blob/mas ... s/Slider.h
https://github.com/cegui/cegui/blob/mas ... Slider.cpp
https://github.com/cegui/cegui/blob/mas ... e/Slider.h
https://github.com/cegui/cegui/blob/mas ... Slider.cpp


Code: Select all

    <!--
    ***************************************************
        TaharezLook/SliderThumb
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/HorizontalSliderThumb">
        <Property name="HorzFree" value="true" />
        <Property name="CursorInputPropagationEnabled" value="true" />
        <ImagerySection name="normal">
            <ImageryComponent>
                <Image name="TaharezLook/HorzSliderThumbNormal" />
                <VertFormat type="Stretched" />
                <HorzFormat type="Stretched" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="hover">
            <ImageryComponent>
                <Image name="TaharezLook/HorzSliderThumbHover" />
                <VertFormat type="Stretched" />
                <HorzFormat type="Stretched" />
            </ImageryComponent>
        </ImagerySection>
        <StateImagery name="Normal">
            <Layer>
                <Section section="normal" />
            </Layer>
        </StateImagery>
        <StateImagery name="Hover">
            <Layer>
                <Section section="hover" />
            </Layer>
        </StateImagery>
        <StateImagery name="Pushed">
            <Layer>
                <Section section="hover" />
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="normal">
                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>

    <!--
    ***************************************************
        TaharezLook/Slider
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/HorizontalSlider">
        <Property name="VerticalSlider" value="false" />
        <Property name="CursorAutoRepeatEnabled" value="true" />
        <Property name="Size" value="{{0, 256}, {0, 16}}" />
        <NamedArea name="ThumbTrackArea" />
        <Child type="TaharezLook/HorizontalSliderThumb" nameSuffix="__auto_thumb__">
            <Area>
                <Dim type="Width" ><ImageDim name="TaharezLook/HorzSliderThumbNormal" dimension="Width" /></Dim>
            </Area>
        </Child>
        <ImagerySection name="main">
            <ImageryComponent>
                <Area>
                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
                    <Dim type="Height" ><UnifiedDim scale="1.0" offset="-6" type="Height" /></Dim>
                </Area>
                <Image name="TaharezLook/HorzSliderBody" />
                <VertFormat type="Stretched" />
                <HorzFormat type="Stretched" />
            </ImageryComponent>
        </ImagerySection>
        <StateImagery name="Enabled">
            <Layer>
                <Section section="main" />
            </Layer>
        </StateImagery>
        <StateImagery name="EnabledFocused">
            <Layer>
                <Section section="main" />
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="main">
                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>


Return to “Skins and Themes”

Who is online

Users browsing this forum: No registered users and 1 guest