Page 1 of 1

Misaligned Thumb on Sliders

Posted: Mon May 03, 2010 23:07
by AdiumCommodore
Hi there,

I'm using CEGUI 0.71 with the Direct3D9 renderer and I've come across a strange bug with my sliders. Before I click the slider it's perfectly fine but after it's been clicked on at all the thumb jumps above the actual bar part. Horizontally it's also offset from the bar as well (goes further to the left, not as far to the right).

This should clarify exactly what I mean.

Image

The slider's is used in a group of controls (Editbox which affects the slider contents,StaticText displaying a label, DefaultWindow to house these). I'm creating and placing these dynamically according to the needs of my app. I tried creating a layout which included a slider and didn't call any methods on any of the GUI displayed and still had this problem.

The layout file for my group of controls is

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
    <Window Type="DefaultWindow" Name="LabelledEditSlider" >
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0,250},{0,92}}" />
        <Window Type="WindowsLook/Slider" Name="LabelledEditSlider/Slider" >
            <Property Name="CurrentValue" Value="0" />
            <Property Name="MaximumValue" Value="1" />
            <Property Name="ClickStepSize" Value="0.01" />
            <Property Name="UnifiedAreaRect" Value="{{0,2},{0,40},{0,148},{0,90}" />
        </Window>
        <Window Type="WindowsLook/StaticText" Name="LabelledEditSlider/Label" >
            <Property Name="Text" Value="Property Name" />
            <Property Name="HorzExtent" Value="136" />
            <Property Name="VertExtent" Value="19.4435" />
            <Property Name="UnifiedAreaRect" Value="{{0,2},{0,2},{0,248},{0,48}}" />
        </Window>
        <Window Type="WindowsLook/Editbox" Name="LabelledEditSlider/Edit" >
            <Property Name="Text" Value="5000" />
            <Property Name="MaxTextLength" Value="1073741823" />
            <Property Name="UnifiedAreaRect" Value="{{0.738867,0},{0.46117,0},{0.99668,0},{0.889556,0}}" />
            <Property Name="TextParsingEnabled" Value="False" />
        </Window>
    </Window>
</GUILayout>


Thanks in advance for any help.

Re: Misaligned Thumb on Sliders

Posted: Tue May 04, 2010 06:24
by sky_answer
Check scrollbar's 'ThumbTrackArea'. (.looknfeel file)

Re: Misaligned Thumb on Sliders

Posted: Tue May 04, 2010 10:02
by AdiumCommodore
I'm not exactly sure what to do there to fix the problem. I haven't altered the looknfeel files that came with the SDK at all. I tried messing around with the thumbtrackarea in WindowsLook.looknfeel and got the horizontal bug mostly fixed but even with setting the topedge and bottom edge to an absolute fixed value I still have the jumping problem.

So instead of this

Code: Select all

        <NamedArea name="ThumbTrackArea">
            <Area>
                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
            </Area>
        </NamedArea>


What should ThumbTrackArea in WindowsLook/Slider be?

Re: Misaligned Thumb on Sliders

Posted: Wed May 05, 2010 08:30
by CrazyEddie
I need to test this out. I will get back to your later.

CE

Re: Misaligned Thumb on Sliders

Posted: Thu May 06, 2010 09:14
by CrazyEddie
I ran some basic tests using the layout posted - both with current stable code and the actual 0.7.1 code - but could not reproduce the issue. The issue is somewhat reminiscent of some bugs we had that affected positioning of components with absolute positions and/or sizes (these are fixed in the stable branch). What you might be able to try, if you're not already doing so, is to ensure you explicitly inform CEGUI if the display or host window size by calling the CEGUI::System::notifyDisplaySizeChanged function somewhere in your initialisation.

CE.

Re: Misaligned Thumb on Sliders

Posted: Fri May 07, 2010 11:27
by AdiumCommodore
Thanks for that reply Eddie, I tried that but it made no difference. I have however done further experimentation. I'm creating a number of these instances of that layout and attaching to them a parent window. What I've noticed is that the slider jumps by the same height/width that the parent window is from the full-screen root window. It seems that the thumb's move area isn't being updated when the slider's parent window changes.

Re: Misaligned Thumb on Sliders

Posted: Fri May 07, 2010 12:31
by AdiumCommodore
I seem to have solved the problem. If I load and attach the instances of the layout to its parent window and then change the position of the parent window everything works fine. I guess that when the parent window's position gets updated the slider control is correctly notified and updates the thumb accordingly.

Re: Misaligned Thumb on Sliders

Posted: Sat May 08, 2010 11:02
by CrazyEddie
Thanks for that work-around. It definitely sounds like a couple of bugs I already fixed.

However now I have an idea about how to reproduce this, I will try again, in case I missed some cases :)

CE.