SG_ScrollBarGadget

Syntax:

Result=SG_ScrollBarGadget(SG_GadgetID_L.l, X_Pos_L.l, Y_Pos_L.l, Width_L.l, Height_L.l, StartValue_L.l, EndValue_L.l, PageLenght_L.l, [Flags_L])

Parameters:

SG_GadgetID_L

=

The number of the gadget

X_Pos_L

=

the x-position of the gadget

Y_Pos_L

=

the y position of the gadget

Width_L

=

the width of the gadget

Height_L

=

the height of the gadget

StartValue_L

=

is the lowest value, the gadget can return

EndValue_L

=

is the highest value, the gadget can return

[Flags_L]

=

'Flags' are always optional and can be composed of one or several (using the bitwise OR operator '|') of the following constants:

#PB_ScrollBar_Vertical : The scrollbar is vertical (instead of horizontal, which is the default).

=


Return Values:

Result

=

contains a pointer to the internal gadget structur. See the source of this lib for more information


Description:

Creates a scrollbar gadget in the current screen. It's widely used when displaying only a part of an object. The Minimum-Maximum range should be between 0 and 10,000. The 'PageLength' is the number which defines a page. For example you can have a picture which is 100 pixels width and you only see 25 pixels. What you see is a called a 'page', in this example, the page length will be 25, the Mininum will be 0 and the Maximum will be 100. SG_GadgetID_L will be the numeric identifier returned by SG_EventScreenGadgetID() command.

The following commands can be used to act on this gadget:

- SG_GetGadgetState(): Returns the current slider position (value between the Minimum-Maximum range).

- SG_SetGadgetState(): Changes the current slider position.


Example:


Remarks:

There are some restriction to the values for pagelenght and max / min.

If pagelenght = 0, the pagelenght change automatically to 1.

if max - min = 0, max will be increased by 1.

So be careful what value you set. Otherwise the functionality can be somewhat different because of the internal changes.



Supported OS:   Windows