Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>sbsetrange() scroll bar function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SBSETRANGE()                                           Scroll Bar Function
 Purpose..: Set the adjustment range of the scroll bar
-------------------------------------------------------------------------------
 Syntax...: sbSetRange( <aSBar>, <nMin>, <nMax> ) --> NIL

 Arguments: <aSBar>     = scroll bar structure returned via
                          a call to sbNew().

            <nMin>      = initial element to which the scroll bar is
                          to be applied. This value is one usually. But if
                          you want the scroll bar to represent only a part
                          of an array or text file or a delimited string,
                          then set it to that value.

            <nMax>      = final element to which the scroll bar is
                          to be applied. If the area to be scrolled is
                          an array, then this value would be len ( aRay ).
                          But if you want the scroll bar to represent
                          only a part of an array or text file or a
                          delimited string, then set it to that value.

 Returns..: NIL

 Source...: SCRLBAR.PRG
-------------------------------------------------------------------------------
 Example..: . The example creates a new vertical
              scroll bar structure, changes the thumb character,
              the bar fill character, the decrement control character,
              the increment control character and the color specification.

              To this, we add the appropriate range for scroll
              a text file. The screen length is taken from the line
              total to keep a blank screen from being displayed when the
              bottom of the file is hit.

                aVertSB := sbNew( SB_VSCROLL )
                sbChrThumb( aVertSB, "." )
                sbChrBar  ( aVertSB, "#" )
                sbChrDec  ( aVertSB, "." )
                sbChrInc  ( aVertSB, "." )
                sbClrSpec ( aVertSB, "W+/B, B/*W, W+/B" )
                sbSetRange( aVertSB, 1, nTotLines - nScrLength + 1 )

See Also: sbNew() sbSetPos()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson