User Tools

Site Tools

Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:SelStart (or PROP:Selected) and PROP:SelEnd ====== Previous pageReturn to chapter overviewNext page

PROP:SelStart (also named PROP:Selected) sets or retrieves the beginning (inclusive) character to mark as a block in an ENTRY or TEXT control. It positions the data entry cursor left of the character, and sets PROP:SelEnd to zero (0) to indicate no block is marked. It also identifies the currently highlighted entry in a LIST or COMBO control (usually coded as PROP:Selected for this purpose). For COMBO controls, PROP:Selected should be applied to the PROP:ListFeq of the COMBO, and not to the combo FEQ directly.

PROP:SelEnd sets or retrieves the ending (inclusive) character to mark as a block in an ENTRY or TEXT control. A value of -1 is a special value that indicates that the selection goes to the end of the target control's text.


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








 OF ?List

  GET(Q,?List{PROP:Selected})     !Get highlighted entry from queue

 OF ?Fil:Field

  SETCLIPBOARD(Fil:Field[?Fil:Field{PROP:SelStart} : ?Fil:Field{PROP:SelEnd}])

                !Place highlighted string slice in Windows' clipboard



Example: using a COMBO control in an EIP configuration

CASE EVENT()                       ! Trap the event

 OF EVENT:NewSelection            ! If the event is a new selection

                                  ! And it's a key we want…

 IF KEYCODE() <;> UpKey AND KEYCODE() <;> DownKey AND |    

    KEYCODE() <;> PgDnKey AND KEYCODE() <;> PgUpKey


  Loc:Offset = SELF.FEQ{PROP:SelStart} - 1    ! Figure out where the cursor is

                                              !in the item field

  ! Put the entered code into a local variable:

  Loc:ItemCode = SUB(ItemList.Q.SON:ItemCode,1,Loc:Offset)

  ! Loop through the local item queue:

  LOOP Loc:LqRecordCount = 1 to RECORDS(LQ:Queue)

   GET(LQ:Queue, Loc:LqRecordCount)

   IF LEFT(LQ:ItemCode,LEN(CLIP(Loc:ItemCode))) = CLIP(Loc:ItemCode)

    IF Loc:LqRecordCount > 1

     Loc:LQ:Position = Loc:LqRecordCount - 1   ! The record we want is the one

                                               ! before the one we're on.


     Loc:LQ:Position = 1                       ! Otherwise it's the first..



   ! Position to the LIST COMBO control:


   CHANGE(SELF.FEQ, LQ:ItemCode)          ! Change the queue to reflect it





Example: highlight a specific row in a List control without changing focus

?List1{PROP:Selected} = 6        !put the highlight bar on the sixth row

See Also: PROP:ListFEQ

prop_selstart.htm.txt · Last modified: 2021/04/15 15:57 by