Progress
Programming
Handbook


Setting Up Dynamic Frames

Progress allows you to create dynamic one-down frames. You cannot create dynamic down frames. You can populate a dynamic frame only with dynamic field-level widgets and you must explicitly specify their position within that frame. When Progress builds a static frame and populates it with static widgets, it creates an intelligent default size for the frame and intelligent default placement for the widgets. Progress does not do this with dynamic frames. You must explicitly define frame size and widget placement.

The following code creates a dynamic frame, then populates it with an editor widget and a quit button:

p-dynfrm.p
DEFINE VARIABLE ed AS WIDGET-HANDLE.
DEFINE VARIABLE frame1 AS WIDGET-HANDLE.
DEFINE VARIABLE button1 AS WIDGET-HANDLE.

CREATE FRAME frame1
ASSIGN
        WIDTH-CHARS = 50
        HEIGHT-CHARS = 28
        SENSITIVE = YES.
VIEW frame1.

CREATE BUTTON button1
ASSIGN
        X = 20
        Y = 20
        LABEL = "quit"
        FRAME = frame1
        SENSITIVE = YES
        TRIGGERS:
            ON CHOOSE STOP.
        END TRIGGERS.
VIEW button1.

CREATE EDITOR ed
ASSIGN
        WIDTH-CHARS = 20
        HEIGHT-CHARS = 7
        X = 70
        Y = 0
        FRAME = frame1
        SENSITIVE = YES.
VIEW ed.
WAIT-FOR GO OF frame1. 

By default, Progress places the dynamic frame in the current window. To place the frame in a different window, set the PARENT attribute to the widget handle of that window.

This is the output of p-dynfrm.p:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095