Kbase P99152: How to change SIDE-LABLES to talbe name
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/07/2005 |
|
Status: Unverified
GOAL:
How to change SIDE-LABELS to field name
GOAL:
How to display SIDE-LABELS to field name
FIX:
The following test code will change the SIDE-LABLE to field name
DEFINE VARIABLE h AS HANDLE NO-UNDO.
DEFINE VARIABLE hslh AS HANDLE NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEF FRAME f WITH 1 DOWN SIDE-LABELS.
VIEW FRAME f.
IF YES THEN RUN changeSideLabelsToFieldName (FRAME f:HANDLE).
i = 0.
FOR EACH customer NO-LOCK:
DISPLAY customer EXCEPT comment WITH FRAME f.
i = i + 1.
IF i = 8 THEN LEAVE.
END.
WAIT-FOR CLOSE OF THIS-PROCEDURE.
PROCEDURE changeSideLabelsToFieldName:
DEFINE INPUT PARAMETER hFrame AS HANDLE NO-UNDO.
/* this block automatically changes the column labels to the name of the field */
h = hFrame:FIRST-CHILD. /* first field group = first iteration */
h = h:FIRST-CHILD. /* first widget => first field */
DO WHILE h <> ?:
IF CAN-QUERY(h,"SIDE-LABEL-HANDLE")
AND VALID-HANDLE(h:SIDE-LABEL-HANDLE)
THEN ASSIGN
hslh = h:SIDE-LABEL-HANDLE
hslh:SCREEN-VALUE = h:NAME NO-ERROR. /* An error can occur if the side label was already far on the left */
h = h:NEXT-SIBLING.
END.
END PROCEDURE.