User Tools

Site Tools


prop_vscrollpos.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:VscrollPos ====== Previous pageReturn to chapter overviewNext page

Returns the position of the vertical scroll bar's “thumb.” Valid values are from 0 to 255 on a window, IMAGE, or TEXT control with the VSCROLL attribute.

Valid values are from 0 to 100 on a LIST, or COMBO control with the VSCROLL attribute (when the IMM attribute is set on). If the IMM attribute is omitted, the values range from 0 to the number of items available for display in the LIST or COMBO (as specified by the FROM() attribute) minus one. If FROM(QUEUE) is specified, then the range is 0 to RECORDS(QUEUE) - 1. If FROM('list'), then the range is 0 to the number of items in 'list' - 1. For example, if FROM('Mr.|Mrs.|Ms.|Dr.'), Then the range is 0 to 3, because 4 is the number of items in the list.

The value of PROP:VScrollPos with IMM off specifies the exact number of items in the list or QUEUE that precede the first item displayed. For example, if row 5 of a QUEUE is the first item displayed, then the value of PROP:VScrollPos is 4.

Setting this property causes the control or window's contents to be scrolled vertically (unless the IMM attribute is on the LIST or COMBO, then only the “thumb” moves).

Example:

Que  QUEUE

     STRING(50)

    END

WinView WINDOW('View'),AT(0,0,320,200),MDI,SYSTEM

        LIST,AT(0,0,320,200),USE(?List),FROM(Que),IMM,VSCROLL

       END

CODE

OPEN(WinView)

Fil:KeyField = 'A' ;  DO BuildListQue

ACCEPT

 CASE FIELD()

 OF ?List

  CASE EVENT()

  OF EVENT:ScrollDrag

   EXECUTE INT(?List{PROP:VscrollPos}/10) + 1

    Fil:KeyField = 'A'

    Fil:KeyField = 'C'

    Fil:KeyField = 'E'

    Fil:KeyField = 'G'

    Fil:KeyField = 'K'

    Fil:KeyField = 'M'

    Fil:KeyField = 'P'

    Fil:KeyField = 'S'

    Fil:KeyField = 'V'

    Fil:KeyField = 'Y'

   END  

   DO BuildListQue  

  END

 END

END

FREE(Que)

BuildListQue ROUTINE

FREE(Queue)

SET(Fil:SomeKey,Fil:SomeKey)      !Set to selected key field

LOOP ?List{PROP:Items} TIMES      !Process number of recs visible in list

 NEXT(SomeFile) ;  IF ERRORCODE() THEN BREAK.  !Break at end of file

 Que = Fil:KeyField               !Assign field to display to QUEUE

 ADD(Que)                         ! and add it to the QUEUE

END

SEE ALSO:

X AND Y ORIGIN

PROP:VSCROLL

prop_vscrollpos.htm.txt · Last modified: 2021/04/15 15:57 (external edit)