Documentation for Win32lib v0.60.6
Table of Contents

Scroll Control

These routines let you inspect and alter attributes of the scroll bar controls.


Including HScroll and VScroll and track bar controls HTrackBar and VTrackBar.

  • func getHScrollPos( window )   Gets the value of a window's horizontal scroll bar.
  • func getScrollChange( scroll )    Returns the amount that scroll will change.
  • func getScrollPos( object id)   Gets the value of a scroll control.
  • func getScrollRange( id )    Returns id's range of values.
  • func getThumbPos( object id)   Gets the position of the scroll thumb while being dragged.
  • func getVScrollPos( window )   Gets the value of a window's vertical scroll bar.
  • proc setHScrollPos( window, position )    Sets the value of a window's horizontal scroll.
  • proc setScrollChange( id, linesize, pagesize )   Adjust the amount that a scroll control will change.
  • proc setScrollPos( id, position )    Sets the value of id.
  • proc setScrollRange( id, low, high )   Sets the range of values of a control.
  • proc setVScrollPos( window, position )    Sets the value of a window's vertical scroll.
  • proc setWindowScrollRange( id, typeScroll, min, max, pageSize)   Set range of window scrollbar or normal scrollbar .

    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getHScrollPos
    ( window )

    Gets the value of a window's horizontal scroll bar.

    Returns: Position of the thumb on the scroll control.

    Category: Scroll Control

    Example:

              -- get value of TheScroll
              integer pos
              pos = getHScrollPos( myWindow )
    

    See Also: getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getScrollChange
    ( scroll )

    Returns the amount that scroll will change.

    Returns: { line change, page change }

    Category: Scroll Control

    This value is set by setScrollChange. The default value is {1,10}, indicating the small change and large change amounts.

    Example:

              -- get change amount for TheScroll
              sequence change
               change = getScrollChange( TheScroll )
    

    See Also: getHScrollPos, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getScrollPos
    ( object id)

    Gets the value of a scroll control.

    Returns: Position of the thumb on the scroll control.

    Category: Scroll Control

    id is the Id of a control. The control must be one of...

    For Window controls, the id parameter can also specify which of the vertical or horizontal scrollbars you are referring to. To do this, the form of id is { ctrl, bartype } where bartype is either SB_VERT or SB_HORZ.

    Example:

              -- get value of TheScroll
              integer pos,vpos,hpos
               pos = getScrollPos( TheScroll )
               vpos = getScrollPos( {MainWin, SB_VERT} )
               hpos = getScrollPos( {MainWin, SB_HORZ} )
    

    See Also: getHScrollPos, getScrollChange, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getScrollRange
    ( id )

    Returns id's range of values.

    Returns: { low, high }

    Category: Scroll Control

    Note that when id is a Window control, by default it refers to the vertical scrollbar. Alternatively you can specify either vertical or horizontal by using the syntax {id, scrollbar} where scrollbar is either SB_VERT or SB_HORZ.

    This value is set by setScrollRange.

    Example:

              -- get range of TheScroll
              sequence range
               range = getScrollRange( TheScroll )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getThumbPos
    ( object id)

    Gets the position of the scroll thumb while being dragged.

    Returns: Position of the thumb on the scroll control.

    Category: Scroll Control

    id is the Id of a control. The control must be one of...

    For Window controls, the id parameter can also specify which of the vertical or horizontal scrollbars you are referring to. To do this, the form of id is { ctrl, bartype } where bartype is either SB_VERT, SB_HORZ or SB_CTL (for HScroll or VScroll controls).

    Example:

              -- get value of TheScroll
              integer pos,vpos,hpos
               pos = getThumbPos( TheScroll )
               vpos = getThumbPos( {MainWin, SB_VERT} )
               hpos = getThumbPos( {MainWin, SB_HORZ} )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [func]
    getVScrollPos
    ( window )

    Gets the value of a window's vertical scroll bar.

    Returns: Position of the thumb on the scroll control.

    Category: Scroll Control

    Example:

              -- get value of TheScroll
              integer pos
              pos = getVScrollPos( myWindow )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setHScrollPos
    ( window, position )

    Sets the value of a window's horizontal scroll.

    Category: Scroll Control

    The value must be greater than zero. This will trigger an onScroll event.

    Example:

              -- set value of the TheScroll
               setHScrollPos( myWindow, 20 )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setScrollChange
    ( id, linesize, pagesize )

    Adjust the amount that a scroll control will change.

    Category: Scroll Control

    The linesize is the amount that the id will adjust when the up/down arrow is selected, and the pagesize is used when the page up/page down is selected.

    For trackbars, the pagesize is used to determine the distance between the tick marks.

    The default values are {1,10}.

    Example:

              -- set change amount for TheScroll
               setScrollChange( TheScroll, 1, 10 )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollPos, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setScrollPos
    ( id, position )

    Sets the value of id.

    Category: Scroll Control

    id is the Id of a control. The control must be one of...

    Note that when id is a Window control, by default it refers to the vertical scrollbar. Alternatively you can specify either vertical or horizontal by using the syntax {id, scrollbar} where scrollbar is either SB_VERT or SB_HORZ.

    The value must be greater than zero.

    This routine will trigger an onScroll event.

    Example:

              -- set value of the TheScroll
               setScrollPos( TheScroll, 20 )
              -- set the horizontal scrollbar
               setScrollPos( {myWindow, SB_HORZ}, 17)
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollRange, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setScrollRange
    ( id, low, high )

    Sets the range of values of a control.

    Category: Scroll Control

    id is the Id of the control to be affected. This must be either a...

    Note that when id is a Window control, by default it refers to the vertical scrollbar. Alternatively you can specify either vertical or horizontal by using the syntax {id, scrollbar} where scrollbar is either SB_VERT or SB_HORZ.
    The low value must be greater than zero.

    The initial values when a control is created are low=0, high=100.

    Example:

              -- set range for TheScroll
               setScrollRange( TheScroll, 1, 100 )
              -- set the horizontal scrollbar on a window.
               setScrollRange( {myWindow, SB_HORZ}, 1, 289)
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setVScrollPos, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setVScrollPos
    ( window, position )

    Sets the value of a window's vertical scroll.

    Category: Scroll Control

    The value must be greater than zero. This will trigger an onScroll event.

    Example:

              -- set value of the TheScroll
               setVScrollPos( myWindow, 20 )
    

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setWindowScrollRange


    Documentation for Win32lib v0.60.6
    Table of Contents

    [proc]
    setWindowScrollRange
    ( id, typeScroll, min, max, pageSize)

    Set range of window scrollbar or normal scrollbar .

    Category: Scroll Control

  • id: specifies either the scrollbar or Window with scrollbar
  • typeScroll : specifies type of the scrollbar
  • pageSize : specifies size of one page (allows to set size of proportional scrollbar) If this is less than 1, it is ignored.

    typeScroll can be one of the following :

  • SB_HORZ : window's (specified by id) horizontal scrollbar
  • SB_VERT : window's (specified by id) vertical scrollbar
  • SB_CTL : control (specified by id), either HScroll or VScroll

    See Also: getHScrollPos, getScrollChange, getScrollPos, getScrollRange, getThumbPos, getVScrollPos, setHScrollPos, setScrollChange, setScrollPos, setScrollRange, setVScrollPos