Navigation: Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:SelStart (or PROP:Selected) and PROP:SelEnd ====== | |
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.
Example:
WinView WINDOW('View'),AT(0,0,320,200),MDI,MAX,HVSCROLL
ENTRY(@S30),AT(0,0,320,180),USE(Fil:Field),ALRT(F10Key)
LIST,AT(6,6,120,90),USE(?List),FORMAT('120L'),FROM(Q),IMM
END
CODE
OPEN(WinView)
ACCEPT
CASE ACCEPTED()
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
END
END
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
UPDAT