Futurebasic/Language/Reference/scroll button

Description
The  statement puts a new scrollbar in the current output window, or alters an existing scrollbar's characteristics. The parameters are interpreted as follows:

"Image was here"

To Create a New Scrollbar
 Choose an  value such that   is different from the ID's of all existing buttons and scrollbars in the window. If you use a negative, and the window contains a multistyled non-static edit field whose ID number is  , then the actions of the scrollbar are linked to the edit field (explained below).

Choose initial values for current, min, max and page. All of these parameters are optional; any of them that you omit will have the following default initial values:  = 0

= 0

= 255

= 16

 If creating a  scrollbar, specify the   parameter. This parameter is optional if you're creating a  or   scrollbar.

Specify the type. This parameter is optional; its default value is.



To Alter an Existing Scrollbar
 Set  to the ID number of an existing scrollbar in the window.

If you want to change any of the current, min, max or page values, specify the corresponding parameters. Any of these that you omit won't have their values changed.

If you want to change the rectangle of a  scrollbar, specify the new rectangle in the rect parameter. If you omit this parameter, the rectangle won't change. NOTE: the rect parameter is ignored when you're altering a  or   scrollbar.

You can't alter the type of an existing scrollbar. This parameter is ignored if the scrollbar already exists.



To Activate or De-activate a Scrollbar
You can use the  statement to activate (highlight) or de-activate (dim) an existing scrollbar.  To activate it, use: To de-activate it, use: 

Linking a Scrollbar's Action to an Edit Field
If you specify a negative  value when creating a new scrollbar, FB looks for a multisyled edit field (which can be static) whose ID number equals   in the current window. If such a field is found, the behavior of the scrollbar and the edit field become linked, as follows:

 When the user (or your program) moves the scrollbar thumb, the text in the edit field scrolls vertically;

When the user (or your program) alters the text in the field, or drags through it vertically, the scrollbar thumb moves correspondingly.

 When linking a scrollbar to an edit field, it's recommended that you use a vertical scrollbar. A horizontal scrollbar will not scroll the text horizontally, and its action is likely to look strange to the user.

You can't alter the,   nor   parameters of a scrollbar that's linked to an edit field. These values are automatically altered dynamically as the content and position of the text in the field changes. Also, you can't use the  statement to activate nor de-activate this kind of scrollbar; the scrollbar is active when the edit field contains more lines than will fit in the view rectangle, and is inactive otherwise.

Note: To link a scrollbar to an edit field, you must create the edit field first, and the scrollbar second.

Note: You can only link a scrollbar to a multistyled edit field (a field which was created using a negative  value).

Using the Scrollbar
To make the scrollbar usable, your program must call  periodically. Among other things,  tracks the motion and clicking of the mouse in the scrollbar, and moves the thumb in response to these user actions. Your program can also move the thumb explicitly by setting the  parameter in the  statement.

Whenever the user moves the thumb, a dialog event of type  is generated. The "id" value for this event equals the scrollbar's ID. You can determine the thumb's current position using the  function:

Note
To remove a scrollbar, use the  statement:

To find out information about a scrollbar, use the  function to get the scrollbar's control record.