Progress
Portability Guide


Executing the Window Procedure File at Runtime

When you execute the multi-layout window procedure file, the master layout definition is realized with the window’s HIDDEN attribute specified. The standard run-time attributes are executed, followed by the CASE statement causing one of the customized sets of changes to execute. The window is visible if you do not specify the HIDDEN attribute for the window.

To support multiple layouts at run time, the AppBuilder creates a special internal procedure named window-name-Layouts (where window-name is the name of the window you are designing). This procedure contains a CASE statement whose key values are the names of all the layouts. The procedure is called with the name of the desired layout. As part of a window procedure file’s startup code, the logical expressions of all the defined layouts are evaluated until one is found to be TRUE. The window-name-Layouts procedure is then called with the name of that layout.

This is an example of run-time adjustment code:

IF SESSION:WINDOW-SYSTEM = ’WINDOWS’:U THEN
   RUN Cust-Window-Layouts  (INPUT "Standard Windows").

ELSE IF TERMINAL = ’wy370’
   THEN RUN Cust-Window-Layouts (INPUT "WYSE 370").

ELSE IF SYSTEM:DISPLAY-TYPE = ’TTY’:U
   THEN RUN Cust-Window-Layouts (INPUT "STANDARD TTY"). 

In the following example, the AppBuilder generates an internal procedure that uses the CASE statement for adjustments:

PROCEDURE Cust-window-layouts.
   DEFINE INPUT PARAMETER layout AS CHARACTER NO-UNDO.

CASE layout:
   WHEN "Standard Windows" THEN DO:

ASSIGN
   Btn_Done:COL IN FRAME FRAME-A = 34
   Btn_Done:ROW IN FRAME FRAME-A = 15.5.

ASSIGN
   Btn_Next:COL IN FRAME FRAME-A = 75
   Btn_Next:HEIGHT IN FRAME FRAME-A = 1.5
   Btn_Next:ROW IN FRAME FRAME-A = 13
   Btn_Next:WIDTH IN FRAME FRAME-A = 5.

END. /* Standard Windows Layout Case */

WHEN "WYSE 370" THEN DO:

   ASSIGN
     FRAME FRAME-A:BGCOLOR  = 7
            .
            .
            . 


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