Consultor Eletrônico



Kbase P106792: 4GL/ABL: CLEAR ALL statement clears side lables of dynamic fill-in widgets
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/11/2010
Status: Unverified

SYMPTOM(s):

4GL/ABL: CLEAR ALL statement clears side labels of dynamic fill-in widgets

The CLEAR ALL statement clears SCREEN-VALUE of dynamically created text widgets, even if they are used as Labels of other widgets

DEFINE VARIABLE cText AS CHARACTER NO-UNDO.
DEFINE VARIABLE hLabel AS HANDLE NO-UNDO.
DEFINE VARIABLE hFillIn AS HANDLE NO-UNDO.
DEFINE FRAME frTest
cText AT ROW 1 COL 20 COLON-ALIGNED VIEW-AS FILL-IN SIZE 32 BY 1
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D AT COL 1 ROW 1 SCROLLABLE .
cText = 'x'.
/* display frame */
DISPLAY cText WITH FRAME frTest.
/* clear frame fields */
CLEAR FRAME frTest ALL.
/* resize frame */
FRAME frTest:HEIGHT = 2.
/* create dynamic widget */
CREATE TEXT hLabel
ASSIGN
FORMAT = 'X(10)'
SCREEN-VALUE = 'Test label'
FRAME = FRAME frTest:HANDLE
ROW = 2
COL = 7
.
/* create dynamic widget */
CREATE FILL-IN hFillIn
ASSIGN
FRAME = FRAME frTest:HANDLE
SIDE-LABEL-HANDLE = hLabel
DATA-TYPE = 'CHARACTER'
FORMAT = 'X(20)'
ROW = 2
COL = 21
SENSITIVE = YES
SUBTYPE = 'NATIVE'
VISIBLE = YES
.
/* clear frame fields again */
PAUSE.
CLEAR FRAME frTest ALL.
/* Workaround: Reassign the SCREEN-VALUE of the label */
ASSIGN hLabel:SCREEN-VALUE = "NEW LABEL".
PAUSE.

CAUSE:

The CLEAR statement was implemented in pre-version 7 days and, hence, does not handle dynamic objects very well. There are no plans to change this behavior to avoid breaking existing applications. The fill-in labels of dynamic fill-in widgets of a dynamic frame are not 'genuine' fill-in labels, these are dynamic text widget with a screen-value acting as a label. The CLEAR ALL statement, which was implemented before the dynamic widget days, include the clearing of the data in the text widget in its action.
Documentation Bug# OE00202500 has been logged requesting this behavior be documented.

CAUSE:

Bug# OE00202500

FIX:

After clearing the frame, reassign the SCREEN-VALUE of dynamically created widgets, including those used as labels.