Progress
ADM 2 Guide


Templates

The container class has the following templates, located in the directory %DLC%\src\adm2\template:

Following is the cntnrfrm.w frame template (the other templates are similar):

Frame Template

cntnrfrm.w
&ANALYZE-SUSPEND _VERSION-NUMBER AB_v9r12 GUI ADM2 
/* Procedure Description 
"ADM2 SmartFrame Object Template 
Use this template to create a new frame which supports SmartObjects. Draw  
your SmartObjects on this container and establish the appropriate SmartLinks  
to connect them." 
*/ 
&ANALYZE-RESUME 
&Scoped-define WINDOW-NAME CURRENT-WINDOW 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS fFrameWin  
/*------------------------------------------------------------------------ 
  File:  
  Description: from cntnrfrm.w - ADM2 SmartFrame Template 
  Input Parameters: 
      <none> 
  Output Parameters: 
      <none> 
------------------------------------------------------------------------*/ 
/*          This .W file was created with the Progress AppBuilder.      */ 
/*----------------------------------------------------------------------*/ 
/* Create an unnamed pool to store all the widgets created  
     by this procedure. This is a good default which assures 
     that this procedure’s triggers and internal procedures  
     will execute in this procedure’s storage, and that proper 
     cleanup will occur on deletion of the procedure. */ 
CREATE WIDGET-POOL. 
/* ***************************  Definitions  ************************** */ 
/* Parameters Definitions ---                                           */ 
/* Local Variable Definitions ---                                       */ 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK 
/* ********************  Preprocessor Definitions  ******************** */ 
&Scoped-define PROCEDURE-TYPE SmartFrame 
&Scoped-define DB-AWARE no 
&Scoped-define ADM-CONTAINER FRAME 
&Scoped-define ADM-SUPPORTED-LINKS 
Data-Target,Data-Source,Page-Target,Update-Source,Update-Target 
/* Name of first Frame and/or Browse and/or first Query                 */ 
&Scoped-define FRAME-NAME fMain 
/* Custom List Definitions                                              */ 
/* List-1,List-2,List-3,List-4,List-5,List-6                            */ 
/* _UIB-PREPROCESSOR-BLOCK-END */ 
&ANALYZE-RESUME 
/* ***********************  Control Definitions  ********************** */ 
/* ************************  Frame Definitions  *********************** */ 
DEFINE FRAME fMain 
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY  
         SIDE-LABELS NO-UNDERLINE THREE-D  
         AT COL 1 ROW 1 
         SIZE 79.86 BY 11.92. 
/* *********************** Procedure Settings ************************ */ 
&ANALYZE-SUSPEND _PROCEDURE-SETTINGS 
/* Settings for THIS-PROCEDURE 
   Type: SmartFrame Template 
   Allow: Basic,Browse,DB-Fields,Query,Smart 
   Container Links: 
Data-Target,Data-Source,Page-Target,Update-Source,Update-Target 
   Other Settings: PERSISTENT-ONLY 
 */ 
/* This procedure should always be RUN PERSISTENT.  Report the error,  */ 
/* then cleanup and return.                                            */ 
IF NOT THIS-PROCEDURE:PERSISTENT THEN DO: 
  MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT." 
          VIEW-AS ALERT-BOX ERROR BUTTONS OK. 
  RETURN. 
END. 
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS 
/* *************************  Create Window  ************************** */ 
&ANALYZE-SUSPEND _CREATE-WINDOW 
/* DESIGN Window definition (used by the UIB)  
  CREATE WINDOW fFrameWin ASSIGN 
         HEIGHT             = 11.91 
         WIDTH              = 79.8. 
/* END WINDOW DEFINITION */ 
*/ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "SmartFrameCues" fFrameWin _INLINE 
/* Actions: adecomm/_so-cue.w ? adecomm/_so-cued.p ? adecomm/_so-cuew.p */ 
/* SmartFrame,ab,49268 
A SmartFrame is a SmartContainer--a procedure object that serves as a  
container for SmartObject instances. 
A SmartFrame instantiates and initializes the SmartObject instances it  
contains. At initialization, the SmartFrame sets the position of the  
instances and links them together. 
USING A SMARTFRAME 
Step 1 
Build your desired SmartObject masters, save, and close them. 
Step 2 
Draw instances of the SmartObject masters into the SmartFrame. 
Step 3 
Add all necessary SmartLinks between SmartObject instances. 
Note: During assembly, the PROGRESS Advisor suggests links and creates  
them for you. However, you can also add and remove SmartLinks with the  
SmartLinks dialog box. To access this dialog, choose the Procedure button  
from the UIB main window. Then choose the SmartLinks button from the  
Procedure Settings dialog box. 
*/ 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB fFrameWin 
/* ************************* Included-Libraries *********************** */ 
{src/adm2/containr.i} 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
/* ***********  Runtime Attributes and AppBuilder Settings  *********** */ 
&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES 
/* SETTINGS FOR WINDOW fFrameWin 
  VISIBLE,,RUN-PERSISTENT                                               */ 
/* SETTINGS FOR FRAME fMain 
   NOT-VISIBLE                                                          */ 
ASSIGN  
       FRAME fMain:HIDDEN           = TRUE. 
/* _RUN-TIME-ATTRIBUTES-END */ 
&ANALYZE-RESUME 
/* Setting information for Queries and Browse Widgets fields            */ 
&ANALYZE-SUSPEND _QUERY-BLOCK FRAME fMain 
/* Query rebuild information for FRAME fMain 
     _Options          = "" 
     _Query            is NOT OPENED 
*/  /* FRAME fMain */ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK fFrameWin 
/* ***************************  Main Block  *************************** */ 
&IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN 
   /* Now enable the interface  if in test mode - otherwise this happens when 
      the object is explicitly initialized from its container. */ 
   RUN initializeObject. 
&ENDIF 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
/* **********************  Internal Procedures  *********************** */ 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects fFrameWin  
_ADM-CREATE-OBJECTS 
PROCEDURE adm-create-objects : 
/*------------------------------------------------------------------------- 
  Purpose:     Create handles for all SmartObjects used in this procedure. 
               After SmartObjects are initialized, then SmartLinks are added. 
  Parameters:  <none> 
--------------------------------------------------------------------------/ 
END PROCEDURE. 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI fFrameWin 
_DEFAULT-DISABLE 
PROCEDURE disable_UI : 
/*------------------------------------------------------------------------- 
  Purpose:     DISABLE the User Interface 
  Parameters:  <none> 
  Notes:       Here we clean-up the user-interface by deleting 
               dynamic widgets we have created and/or hide  
               frames.  This procedure is usually called when 
               we are ready to "clean-up" after running. 
--------------------------------------------------------------------------/ 
  /* Hide all frames. */ 
  HIDE FRAME fMain. 
  IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE. 
END PROCEDURE. 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI fFrameWin  
_DEFAULT-ENABLE 
PROCEDURE enable_UI : 
/*------------------------------------------------------------------------- 
  Purpose:     ENABLE the User Interface 
  Parameters:  <none> 
  Notes:       Here we display/view/enable the widgets in the 
               user-interface.  In addition, OPEN all queries 
               associated with each FRAME and BROWSE. 
               These statements here are based on the "Other  
               Settings" section of the widget Property Sheets. 
-------------------------------------------------------------------------*/ 
  {&OPEN-BROWSERS-IN-QUERY-fMain} 
END PROCEDURE. 
/* _UIB-CODE-BLOCK-END */ 
&ANALYZE-RESUME 


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