||<< Index >>||
scroll button [#]idExpr ¬
scroll buttonstatement puts a new scrollbar in the current output window, or alters an existing scrollbar's characteristics. The parameters are interpreted as follows:
|idExpr||An integer which identifies the scrollbar. If Abs(idExpr) is different from the ID numbers of all buttons and all other scrollbars in the current window, a new scrollbar is created, and is assigned an ID number equal to Abs(idExpr). If Abs(idExpr) equals the ID of an existing scrollbar, the scrollbar's characteristics are altered.|
|current||This sets the current "value" of the scrollbar, which, along with min and max, determines the position of the scrollbar's "thumb." It must be greater than or equal to min, and less than or equal to max.|
|min||The minimum value that the scrollbar can have. For vertical scrollbars, this corresponds to a thumb position at the top of the bar; for horizontal scrollbars, it corresponds to a thumb position at the left side of the bar. min must be in the range -32768 through +32767.|
|max||The maximum value that the scrollbar can have. For vertical scrollbars, this corresponds to a thumb position at the bottom of the bar; for horizontal scrollbars, it corresponds to a thumb position at the right side of the bar. max must be in the range -32768 through +32767, and must be greater than min.|
|page||This specifies the amount by which the scrollbar's value should change when the user clicks in the areas between the thumb and the scrollbar's end-arrows. Must be non-negative.|
|rect||For scrollbars of type _scrollOther, the rect parameter specifies the rectangle that defines the size and position of the scrollbar. You can specify it in either of two ways:|
(x1,y1)-(x2,y2) - Coordinates of two diagonally opposite points.
rectAddr& - Address of an 8-byte rectangle structure. If the specified rectangle is wider than it is tall, the scrollbar becomes a horizontal scrollbar. If the rectangle is taller than it is wide, the scrollbar becomes a vertical scrollbar. The standard recommended width for a vertical scrollbar (or height for a horizontal scrollbar) is 16 pixels.
Note: For scrollbars of type _scrollHorz or _scrollVert, the rect parameter is interpreted differently. See below for more details.
|type||Specify one of the following:|
The scrollbar occupies the rectangle specified in the rect parameter.
The scrollbar occupies the right edge of the window, and is resized as the window is resized. If you specify a rect parameter when creating the scrollbar, the top of the scrollbar is offset from the top of the window by y1 pixels.
The scrollbar occupies the bottom edge of the window, and is resized as the window is resized. If you specify a rect parameter when creating the scrollbar, the left side of the scrollbar is offset from the left side of the window by x1 pixels.
Note: _scrollVert and _scrollHorz scrollbars can only be put into windows of type _doc, _docZoom and _docNoGrow. If you try to create a _scrollVert or _scrollHorz scrollbar in any other type of window, the scrollbar won't appear.
idExprvalue such that
abs(idExpr)is different from the ID's of all existing buttons and scrollbars in the window.
_scrollOtherscrollbar, specify the
rectparameter. This parameter is optional if you're creating a
idExprto the ID number of an existing scrollbar in the window.
_scrollOtherscrollbar, 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
buttonstatement to activate (highlight) or de-activate (dim) an existing scrollbar.
button scrollbarID, _activeBtn
button scrollbarID, _grayBtn
HandleEventsperiodically. Among other things,
HandleEventstracks 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
currentparameter in the
_btnClickis generated. The "id" value for this event equals the scrollbar's ID. You can determine the thumb's current position using the
thumbPosition = button(scrollBarID)
button close scrollBarID
button&function to get the scrollbar's control record.