&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1 &ANALYZE-RESUME /* Connected Databases anadat PROGRESS */ &Scoped-define WINDOW-NAME CURRENT-WINDOW &Scoped-define FRAME-NAME D-Dialog /* Temp-Table and Buffer definitions */ DEFINE SHARED TEMP-TABLE XTermOut NO-UNDO LIKE TermOut. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS D-Dialog /*------------------------------------------------------------------------ File: Description: from cntnrdlg.w - ADM SmartDialog Template Input Parameters: Output Parameters: Author: Created: ------------------------------------------------------------------------*/ /* This .W file was created with the Progress UIB. */ /*----------------------------------------------------------------------*/ /* 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 --- */ DEF INPUT PARAMETER DialogTitel AS CHAR. /* Local Variable Definitions --- */ /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK /* ******************** Preprocessor Definitions ******************** */ &Scoped-define PROCEDURE-TYPE SmartDialog &Scoped-define DB-AWARE no &Scoped-define ADM-CONTAINER DIALOG-BOX /* Name of designated FRAME-NAME and/or first browse and/or first query */ &Scoped-define FRAME-NAME D-Dialog &Scoped-define BROWSE-NAME Br_Liste /* Internal Tables (found by Frame, Query & Browse Queries) */ &Scoped-define INTERNAL-TABLES XTermOut /* Definitions for BROWSE Br_Liste */ &Scoped-define FIELDS-IN-QUERY-Br_Liste XTermOut.Zeile &Scoped-define ENABLED-FIELDS-IN-QUERY-Br_Liste &Scoped-define QUERY-STRING-Br_Liste FOR EACH XTermOut NO-LOCK &Scoped-define OPEN-QUERY-Br_Liste OPEN QUERY Br_Liste FOR EACH XTermOut NO-LOCK. &Scoped-define TABLES-IN-QUERY-Br_Liste XTermOut &Scoped-define FIRST-TABLE-IN-QUERY-Br_Liste XTermOut /* Definitions for DIALOG-BOX D-Dialog */ &Scoped-define OPEN-BROWSERS-IN-QUERY-D-Dialog ~ ~{&OPEN-QUERY-Br_Liste} /* Standard List Definitions */ &Scoped-Define ENABLED-OBJECTS Br_Liste /* Custom List Definitions */ /* List-1,List-2,List-3,List-4,List-5,List-6 */ /* _UIB-PREPROCESSOR-BLOCK-END */ &ANALYZE-RESUME /* *********************** Control Definitions ********************** */ /* Define a dialog box */ /* Definitions of the field level widgets */ /* Query definitions */ &ANALYZE-SUSPEND DEFINE QUERY Br_Liste FOR XTermOut SCROLLING. &ANALYZE-RESUME /* Browse definitions */ DEFINE BROWSE Br_Liste &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS Br_Liste D-Dialog _STRUCTURED QUERY Br_Liste DISPLAY XTermOut.Zeile FORMAT "x(250)":U /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME WITH NO-LABELS NO-ASSIGN NO-ROW-MARKERS NO-COLUMN-SCROLLING MULTIPLE SIZE 180 BY 21.43 BGCOLOR 15 FONT 14. /* ************************ Frame Definitions *********************** */ DEFINE FRAME D-Dialog Br_Liste AT ROW 1.48 COL 3 SPACE(1.99) SKIP(0.41) WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE TITLE "Listenausgabe". /* *********************** Procedure Settings ************************ */ &ANALYZE-SUSPEND _PROCEDURE-SETTINGS /* Settings for THIS-PROCEDURE Type: SmartDialog Allow: Basic,Browse,DB-Fields,Query,Smart Other Settings: COMPILE Temp-Tables and Buffers: TABLE: XTermOut T "SHARED" NO-UNDO AnaDat TermOut END-TABLES. */ &ANALYZE-RESUME _END-PROCEDURE-SETTINGS &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB D-Dialog /* ************************* Included-Libraries *********************** */ {src/adm/method/containr.i} /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME /* *********** Runtime Attributes and AppBuilder Settings *********** */ &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES /* SETTINGS FOR DIALOG-BOX D-Dialog FRAME-NAME */ /* BROWSE-TAB Br_Liste 1 D-Dialog */ ASSIGN FRAME D-Dialog:SCROLLABLE = FALSE. ASSIGN Br_Liste:SELECTABLE IN FRAME D-Dialog = TRUE. /* _RUN-TIME-ATTRIBUTES-END */ &ANALYZE-RESUME /* Setting information for Queries and Browse Widgets fields */ &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE Br_Liste /* Query rebuild information for BROWSE Br_Liste _TblList = "Temp-Tables.XTermOut" _FldNameList[1] = Temp-Tables.XTermOut.Zeile _Query is OPENED */ /* BROWSE Br_Liste */ &ANALYZE-RESUME &ANALYZE-SUSPEND _QUERY-BLOCK DIALOG-BOX D-Dialog /* Query rebuild information for DIALOG-BOX D-Dialog _Options = "SHARE-LOCK" _Query is NOT OPENED */ /* DIALOG-BOX D-Dialog */ &ANALYZE-RESUME /* ************************ Control Triggers ************************ */ &Scoped-define SELF-NAME D-Dialog &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog ON ENTRY OF FRAME D-Dialog /* Listenausgabe */ DO: SELF:TITLE = DialogTitel. END. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog ON WINDOW-CLOSE OF FRAME D-Dialog /* Listenausgabe */ DO: /* Add Trigger to equate WINDOW-CLOSE to END-ERROR. */ APPLY "END-ERROR":U TO SELF. END. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &Scoped-define BROWSE-NAME Br_Liste &Scoped-define SELF-NAME Br_Liste &Scoped-define SELF-NAME XTermOut.Zeile &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL XTermOut.Zeile Br_Liste _BROWSE-COLUMN D-Dialog ON RIGHT-MOUSE-CLICK OF BROWSE Br_Liste /* Zeile */ DO: RUN AUSGABE_IN_LISTE. RETURN NO-APPLY. END. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &UNDEFINE SELF-NAME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK D-Dialog /* *************************** Main Block *************************** */ {src/adm/template/dialogmn.i} PROCEDURE ShellExecuteA EXTERNAL "shell32.dll" : DEFINE INPUT PARAMETER lphwnd AS LONG. DEFINE INPUT PARAMETER lpOperation AS CHARACTER. DEFINE INPUT PARAMETER lpFile AS CHARACTER. DEFINE INPUT PARAMETER lpParameters AS CHARACTER. DEFINE INPUT PARAMETER lpDirectory AS CHARACTER. DEFINE INPUT PARAMETER nShowCmd AS LONG. DEFINE RETURN PARAMETER hInstance AS LONG. END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME /* ********************** Internal Procedures *********************** */ &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects D-Dialog _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: ------------------------------------------------------------------------------*/ END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available D-Dialog _ADM-ROW-AVAILABLE PROCEDURE adm-row-available : /*------------------------------------------------------------------------------ Purpose: Dispatched to this procedure when the Record- Source has a new row available. This procedure tries to get the new row (or foriegn keys) from the Record-Source and process it. Parameters: ------------------------------------------------------------------------------*/ /* Define variables needed by this internal procedure. */ {src/adm/template/row-head.i} /* Process the newly available records (i.e. display fields, open queries, and/or pass records on to any RECORD-TARGETS). */ {src/adm/template/row-end.i} END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE AUSGABE_IN_LISTE D-Dialog PROCEDURE AUSGABE_IN_LISTE : /*------------------------------------------------------------------------------ Purpose: Notes: ------------------------------------------------------------------------------*/ DEFINE VARIABLE cDateiName AS CHARACTER NO-UNDO. DEFINE VARIABLE o-i AS INTEGER NO-UNDO. cDateiName = SUBSTITUTE('&1&2':U, SESSION:TEMP-DIR, 'Liste.csv'). OUTPUT TO value(cDateiName) NO-MAP NO-CONVERT. FOR EACH XTermOut: PUT CONTROL XTermOut.Zeile CHR(10). END. OUTPUT CLOSE. RUN shellExecuteA (0, "open", cDateiName, "", "", 0, OUTPUT o-i). END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE PROCEDURE disable_UI : /*------------------------------------------------------------------------------ Purpose: DISABLE the User Interface Parameters: 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 D-Dialog. END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE PROCEDURE enable_UI : /*------------------------------------------------------------------------------ Purpose: ENABLE the User Interface Parameters: 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. ------------------------------------------------------------------------------*/ ENABLE Br_Liste WITH FRAME D-Dialog. {&OPEN-BROWSERS-IN-QUERY-D-Dialog} END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-apply-entry D-Dialog PROCEDURE local-apply-entry : /*------------------------------------------------------------------------------ Purpose: Override standard ADM method Notes: ------------------------------------------------------------------------------*/ /* Code placed here will execute PRIOR to standard behavior. */ /* Dispatch standard ADM method. */ RUN dispatch IN THIS-PROCEDURE ( INPUT 'apply-entry':U ) . /* Code placed here will execute AFTER standard behavior. */ END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records D-Dialog _ADM-SEND-RECORDS PROCEDURE send-records : /*------------------------------------------------------------------------------ Purpose: Send record ROWID's for all tables used by this file. Parameters: see template/snd-head.i ------------------------------------------------------------------------------*/ /* Define variables needed by this internal procedure. */ {src/adm/template/snd-head.i} /* For each requested table, put it's ROWID in the output list. */ {src/adm/template/snd-list.i "XTermOut"} /* Deal with any unexpected table requests before closing. */ {src/adm/template/snd-end.i} END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog PROCEDURE state-changed : /* ----------------------------------------------------------- Purpose: Parameters: Notes: -------------------------------------------------------------*/ DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO. END PROCEDURE. /* _UIB-CODE-BLOCK-END */ &ANALYZE-RESUME