/*------------------------------------------------------------------------------
  height-chars-4070.p     FRAME HEIGHT-CHARS below the height its widgets need

  A frame with three fields on three rows is shown, then its HEIGHT-CHARS is set
  to 1.  OpenEdge raises warning 4070 ("Unable to set the HEIGHT of the FRAME
  fInfo too small to contain all visible widgets.") in an alert box.
  The heights before and after are written to height-chars-4070.log and shown
  at the end.
------------------------------------------------------------------------------*/

DEFINE VARIABLE cA      AS CHARACTER NO-UNDO LABEL "A" FORMAT "x(8)" INITIAL "first".
DEFINE VARIABLE cB      AS CHARACTER NO-UNDO LABEL "B" FORMAT "x(8)" INITIAL "second".
DEFINE VARIABLE cC      AS CHARACTER NO-UNDO LABEL "C" FORMAT "x(8)" INITIAL "third".
DEFINE VARIABLE dBefore AS DECIMAL   NO-UNDO.
DEFINE VARIABLE dAfter  AS DECIMAL   NO-UNDO.

DEFINE FRAME fInfo
   cA SKIP
   cB SKIP
   cC
   WITH SIDE-LABELS THREE-D.

/* warnings and errors go to an alert box, independent of the message area */
SESSION:SYSTEM-ALERT-BOXES = yes.

DISPLAY cA cB cC WITH FRAME fInfo.
dBefore = FRAME fInfo:HEIGHT-CHARS.

FRAME fInfo:HEIGHT-CHARS = 1.

dAfter = FRAME fInfo:HEIGHT-CHARS.

OUTPUT TO "height-chars-4070.log".
PUT UNFORMATTED "HEIGHT-CHARS before: " STRING(dBefore) " after: " STRING(dAfter) SKIP.
OUTPUT CLOSE.

MESSAGE "HEIGHT-CHARS before:" dBefore "after:" dAfter VIEW-AS ALERT-BOX.
