scrollbar feature request!

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

scrollbar feature request!

Postby agamemnus » Wed Jul 14, 2010 18:53

EDIT:

Thread turned into feature request.

"maybe there should be an option for the scrollbar to attach to the outside of a window? This might involve the stuff in viewtopic.php?f=1&t=4859; I dunno."


Check this out:
http://img375.imageshack.us/i/hardcoded15px.png/

It seems the total allotted clearance is 15.

I was making a scrollbar yesterday night and today. I have as of yet been unable to make it look correct without reducing the scrollbar size to 15.

I can't find this number, but it seems that the 15 is somehow hard-coded somewhere.

If anyone would like to check the bug, just make a scrollbar with a size over 15 (or just modify the width/height of a Taharez scrollbar to 16+) and you'll see, I think, that it will not expand the clearance.
Last edited by agamemnus on Wed Jul 21, 2010 15:20, edited 1 time in total.

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

Re: Scrollbar height clearance is hardcoded?

Postby emarcotte » Thu Jul 15, 2010 10:38

When you say "just modify the width/height of a scrollbar to 16+" do you mean in the size of the images in the imageset or actual dimensions in the looknfeel?

Looking at the looknfeel (http://crayzedsgui.svn.sourceforge.net/ ... iew=markup) I don't see anything hard coded there... maybe its in the source or image set somewhere that its set to 15. Can't play with it here, but when I get home maybe I'll poke around :)

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Scrollbar height clearance is hardcoded?

Postby agamemnus » Thu Jul 15, 2010 16:01

I mean the dimensions in the looknfeel (in scrollablepane). Well, it depends on the scrollbar implementation. The scrollbar implementation must resize its elements according to the scrollbar height for this to work, but that requires a very particular implementation. Still, the elements should resize mostly OK in TaharezLook.

It doesn't have to do with the images themselves since my scrollbar is a completely different image from TaharezLook.tga.

I think it's hard coded in the source, but I can't tell how exactly. There's no obvious "15" in the source that does this.

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

Re: Scrollbar height clearance is hardcoded?

Postby CrazyEddie » Fri Jul 16, 2010 09:08

Sizes and other such aspects are not hard coded, that can be freely specified in the looknfeel XML.

CE

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Scrollbar height clearance is hardcoded?

Postby agamemnus » Fri Jul 16, 2010 18:43

What, then, is the clearance parameter?

I can assure you that there's nothing in either the scrollbar thumb, horizontal scrollbar, or scrollable pane that indicates a clearance of "15". (I set the size of the scrollbar itself in the scrollable pane to 15, though... anything more and it gets cut off at the bottom)

Code: Select all


    <!--
    ***************************************************
        TaharezLook/HorizontalScrollbarThumb
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/HorizontalScrollbarThumb">
        <Property name="HorzFree" value="True" />
        <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.0" type="Width" /></Dim>
                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
                </Area>
                <Image type="LeftEdge" imageset="scrollbar" image="horzScrollThumbLeftNormal" />
                <Image type="RightEdge" imageset="scrollbar" image="horzScrollThumbRightNormal" />
                <Image type="Background" imageset="scrollbar" image="horzScrollThumbMiddleNormal" />
            </FrameComponent>
        </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.0" type="Width" /></Dim>
                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
                </Area>
                <Image type="LeftEdge" imageset="scrollbar" image="horzScrollThumbLeftHover" />
                <Image type="RightEdge" imageset="scrollbar" image="horzScrollThumbRightHover" />
                <Image type="Background" imageset="scrollbar" image="horzScrollThumbMiddleHover" />
            </FrameComponent>
        </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="normal" />
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="normal">
                    <Colors topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                </Section>
            </Layer>
        </StateImagery>
    </WidgetLook>

  <!--
  ***************************************************
   TaharezLook/HorizontalScrollbar
  ***************************************************
  -->
  <WidgetLook name="TaharezLook/HorizontalScrollbar">
   <NamedArea name="ThumbTrackArea">
    <Area>
     <Dim type="LeftEdge" ><ImageDim imageset="scrollbar" image="horzScrollThumbMiddleNormal" dimension="Width" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="RightEdge" >
     <UnifiedDim scale="1.0" type="RightEdge">
       <DimOperator op="Subtract">
        <ImageDim imageset="scrollbar" image="horzScrollThumbMiddleNormal" dimension="Width" />
       </DimOperator>
      </UnifiedDim>
     </Dim>
     <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
    </Area>
   </NamedArea>
   
   <Child type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
    <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><ImageDim imageset="scrollbar" image="horzScrollLeftNormal" dimension="Width" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
    </Area>
    <Property name="normalImage" value="set:scrollbar image:horzScrollLeftNormal" />
    <Property name="hoverImage" value="set:scrollbar image:horzScrollLeftHover" />
    <Property name="pushedImage" value="set:scrollbar image:horzScrollLeftNormal" />
   </Child>
 
   <Child type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
    <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><ImageDim imageset="scrollbar" image="horzScrollRightNormal" dimension="Width" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
    </Area>
    <HorzAlignment type="RightAligned" />
    <Property name="normalImage" value="set:scrollbar image:horzScrollRightNormal" />
    <Property name="hoverImage" value="set:scrollbar image:horzScrollRightHover" />
    <Property name="pushedImage" value="set:scrollbar image:horzScrollRightNormal" />
   </Child>
 
   <Child type="TaharezLook/HorizontalScrollbarThumb" nameSuffix="__auto_thumb__">
    <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
     <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
     <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
    </Area>
    <Property name="UnifiedMinSize" value="{{0, 5},{0,0}}" />
   </Child>
      
   <ImagerySection name="main">
    <ImageryComponent>
     <Area>
      <Dim type="LeftEdge" ><ImageDim imageset="scrollbar" image="horzScrollLeftNormal" dimension="Width" /></Dim>
      <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
      <Dim type="RightEdge" >
      <UnifiedDim scale="1.0" type="RightEdge">
        <DimOperator op="Subtract">
         <ImageDim imageset="scrollbar" image="horzScrollRightNormal" dimension="Width"/>
       </DimOperator>
      </UnifiedDim>
      </Dim>
      <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
     </Area>
     <Image imageset="scrollbar" image="horzScrollSegment" />
     <VertFormat type="Stretched" />
     <HorzFormat type="Stretched" />
    </ImageryComponent>
   </ImagerySection>
   
   <StateImagery name="Enabled">
    <Layer>
     <Section section="main" />
    </Layer>
   </StateImagery>
   <StateImagery name="Disabled">
    <Layer>
     <Section section="main">
      <Colors topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
     </Section>
    </Layer>
   </StateImagery>
  </WidgetLook>

  <!--
  ***************************************************
   TaharezLook/ScrollablePane
  ***************************************************
  -->
    <WidgetLook name="TaharezLook/ScrollablePane">
        <NamedArea name="ViewableArea">
            <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>
        <NamedArea name="ViewableAreaHScroll">
            <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>
        <NamedArea name="ViewableAreaVScroll">
            <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>
        <NamedArea name="ViewableAreaHVScroll">
            <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>
      
        <Child type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
            <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
           <Dim type="TopEdge" ><UnifiedDim scale="1" offset="-15" type="Height"/></Dim>
        <Dim type="RightEdge" ><UnifiedDim scale="1" offset="0" type="Width" /></Dim>
         <Dim type="BottomEdge" ><UnifiedDim scale="1" offset="0" type="Height" /></Dim>
            </Area>
            <Property name="NonClient" value="True" />
        </Child>
        <Child type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
            <Area>
     <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
           <Dim type="TopEdge" ><UnifiedDim scale="1" offset="0" type="Height"/></Dim>
        <Dim type="RightEdge" ><UnifiedDim scale="1" offset="-15" type="Width" /></Dim>
         <Dim type="BottomEdge" ><UnifiedDim scale="1" offset="0" type="Height" /></Dim>
            </Area>
            <HorzAlignment type="RightAligned" />
            <Property name="NonClient" value="True" />
        </Child>
        <StateImagery name="Enabled" />
        <StateImagery name="Disabled" />
    </WidgetLook>


Code: Select all

<Imageset Name="scrollbar" Imagefile="scrollbar.png" NativeHorzRes="800" NativeVertRes="600" AutoScaled="false" AntiAlias="false">
 <Image Name="horzScrollSegment" XPos="21" YPos="0" Width="10" Height="18" />
 
 <Image Name="horzScrollThumbLeftNormal" XPos="0" YPos="18" Width="5" Height="18"/>
 <Image Name="horzScrollThumbMiddleNormal" XPos="5" YPos="18" Width="16" Height="18"/>
 <Image Name="horzScrollThumbRightNormal" XPos="21" YPos="18" Width="5" Height="18"/>
 
 <Image Name="horzScrollThumbLeftHover" XPos="26" YPos="18" Width="5" Height="18"/>
 <Image Name="horzScrollThumbMiddleHover" XPos="31" YPos="18" Width="16" Height="18"/>
 <Image Name="horzScrollThumbRightHover" XPos="47" YPos="18" Width="5" Height="18"/>
 
 <Image Name="horzScrollLeftHover" XPos="0" YPos="0" Width="21" Height="18"/>
 <Image Name="horzScrollRightHover" XPos="31" YPos="0" Width="21" Height="18"/>
 <Image Name="horzScrollLeftNormal" XPos="0" YPos="0" Width="21" Height="18" />
 <Image Name="horzScrollRightNormal" XPos="31" YPos="0" Width="21" Height="18" />
</Imageset>


Scrollbar:
http://img688.imageshack.us/img688/9206/scrollbar.png

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

Re: Scrollbar height clearance is hardcoded?

Postby CrazyEddie » Wed Jul 21, 2010 08:54

Well, you have those -15 bits in the scrollbar child defs for the scrollable pane, so presumably it's related to that?

CE

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Scrollbar height clearance is hardcoded?

Postby agamemnus » Wed Jul 21, 2010 15:17

CrazyEddie wrote:Well, you have those -15 bits in the scrollbar child defs for the scrollable pane, so presumably it's related to that?

CE

No, that's not it, but I figured it out...

I had gotten wrapped up in the scrollablePane, but I didn't realize that the scrollbar getting attached won't resize anything it is attached to... the scrollablePane parent has a size of 90 and the windows have a size of 75... the clearance is 15!

Oof, my bad..

Still, I guess I can salvage this thread and turn this into a feature request.. maybe there should be an option for the scrollbar to attach to the outside of a window? :wink:

This might involve the stuff in viewtopic.php?f=1&t=4859; I dunno.

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

Re: scrollbar feature request!

Postby CrazyEddie » Thu Jul 22, 2010 13:22

The way this is / should be handled is that the inner rect / content area / client area(s) get defined in such a way that they correctly exclude active scrollbars (so for scrollable pane, you have all those ViewableArea[[H|V]Scroll] NamedArea definitions. The scrollbars are marked as NonClient, and it's job done.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 18 guests