Kbase P24397: How to position the cursor at the end of a FILL-IN field in
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/17/2004 |
|
Status: Unverified
GOAL:
How to position the cursor at the end of a FILL-IN field in GUI and TTY?
FIX:
The example code below, illustrates how to position the cursor at the end of a FILL-IN field in both Character and GUI environments.
DEFINE VARIABLE FirstFill AS CHARACTER FORMAT "x(32)"
LABEL "Enter Search String"
VIEW-AS FILL-IN NO-UNDO.
DEFINE VARIABLE SecondFill AS CHARACTER FORMAT "x(25)"
LABEL "Enter Search String"
VIEW-AS FILL-IN NO-UNDO.
DEFINE FRAME F-Main
SKIP
FirstFill AT 9 FORMAT "x(26)"
SecondFill AT 36
WITH CENTERED ROW 2 WIDTH 80 NO-BOX NO-LABELS.
MAIN-BLOCK:
DO:
ENABLE ALL WITH FRAME F-Main.
END.
ON ENTRY OF PartNum IN FRAME f-main
DO:
/* Moved the APPLY "entry" here (from move-cursor.ip) to
** balance it with the RETURN NO-APPLY that is required.
*/
APPLY "entry" TO SELF.
RUN move-cursor.ip.
RETURN NO-APPLY.
END.
WAIT-FOR "ENDKEY", "GO" OF THIS-PROCEDURE.
PROCEDURE move-cursor.ip.
partnum:DISABLE-AUTO-ZAP IN FRAME f-main = TRUE.
&IF "{&WINDOW-SYSTEM}" = "TTY" &THEN
/* The "right-end" event moves the cursor to the end of a character field */
APPLY "right-end" TO FirstFill.
&ELSE
/* The "end" event moves the cursor to the end of a GUI field */
APPLY "end" TO SecondFill.
&ENDIF
END.