1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &Scoped-define FRAME-NAME D-Dialog
8 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS D-Dialog
9 /*------------------------------------------------------------------------
13 Description
: from cntnrdlg.w
- ADM SmartDialog Template
24 ------------------------------------------------------------------------*/
25 /* This .W file was created with the Progress UIB.
*/
26 /*----------------------------------------------------------------------*/
28 /* Create an unnamed pool to store all the widgets created
29 by this procedure. This is a good default which assures
30 that this procedure's triggers and internal procedures
31 will execute in this procedure's storage
, and that proper
32 cleanup will occur on deletion of the procedure.
*/
36 /* *************************** Definitions
************************** */
38 /* Parameters Definitions
--- */
40 /* Local Variable Definitions
--- */
42 &SCOPED-DEFINE REPORT-ID "Current Printer"
44 /* _UIB-CODE-BLOCK-END
*/
48 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
50 /* ******************** Preprocessor Definitions
******************** */
52 &Scoped-define PROCEDURE-TYPE SmartDialog
54 &Scoped-define ADM-CONTAINER DIALOG-BOX
56 /* Name of first Frame and
/or Browse and
/or first Query
*/
57 &Scoped-define FRAME-NAME D-Dialog
59 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
60 &Scoped-define INTERNAL-TABLES RP
62 /* Definitions for
DIALOG-BOX D-Dialog
*/
63 &Scoped-define FIELDS-IN-QUERY-D-Dialog RP.Char1
64 &Scoped-define ENABLED-FIELDS-IN-QUERY-D-Dialog RP.Char1
65 &Scoped-define ENABLED-TABLES-IN-QUERY-D-Dialog RP
66 &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-D-Dialog RP
67 &Scoped-define OPEN-QUERY-D-Dialog OPEN QUERY D-Dialog FOR EACH RP SHARE-LOCK.
68 &Scoped-define TABLES-IN-QUERY-D-Dialog RP
69 &Scoped-define FIRST-TABLE-IN-QUERY-D-Dialog RP
72 /* Standard List Definitions
*/
73 &Scoped-Define ENABLED-FIELDS RP.Char1
74 &Scoped-define FIELD-PAIRS~
75 ~
{&FP1}Char1 ~{&FP2}Char1 ~{&FP3}
76 &Scoped-define ENABLED-TABLES RP
77 &Scoped-define FIRST-ENABLED-TABLE RP
78 &Scoped-Define ENABLED-OBJECTS RECT-4 btn-config Btn_OK Btn_Cancel
79 &Scoped-Define DISPLAYED-FIELDS RP.Char1
81 /* Custom List Definitions
*/
82 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
84 /* _UIB-PREPROCESSOR-BLOCK-END
*/
89 /* *********************** Control Definitions
********************** */
91 /* Define a dialog box
*/
93 /* Definitions of the field level widgets
*/
94 DEFINE BUTTON btn-config
95 LABEL "Select &Printer"
99 DEFINE BUTTON Btn_Cancel
AUTO-END-KEY
104 DEFINE BUTTON Btn_OK
AUTO-GO
109 DEFINE RECTANGLE RECT-4
110 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
113 /* Query definitions
*/
115 DEFINE QUERY D-Dialog
FOR
119 /* ************************ Frame Definitions
*********************** */
121 DEFINE FRAME D-Dialog
122 RP.Char1
AT ROW 1.95 COL 1.43
123 LABEL "Current Printer" FORMAT "X(50)"
127 btn-config
AT ROW 3.5 COL 2.29
128 Btn_OK
AT ROW 3.5 COL 40.29
129 Btn_Cancel
AT ROW 3.5 COL 51.57
130 RECT-4
AT ROW 1.4 COL 1
131 SPACE(0.42) SKIP(0.24)
132 WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
133 SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
135 TITLE "Select a printer"
136 DEFAULT-BUTTON Btn_OK
CANCEL-BUTTON Btn_Cancel.
139 /* *********************** Procedure Settings
************************ */
141 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
142 /* Settings for
THIS-PROCEDURE
144 Allow
: Basic
,Browse
,DB-Fields
,Query
,Smart
145 Other Settings
: COMPILE
147 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
150 /* *************** Runtime Attributes and UIB Settings
************** */
152 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
153 /* SETTINGS
FOR DIALOG-BOX D-Dialog
156 FRAME D-Dialog
:SCROLLABLE = FALSE
157 FRAME D-Dialog
:HIDDEN = TRUE.
159 /* SETTINGS
FOR Fill-in RP.Char1
IN FRAME D-Dialog
160 ALIGN-L EXP-LABEL EXP-FORMAT
*/
161 /* _RUN-TIME-ATTRIBUTES-END
*/
165 /* Setting information for Queries and Browse Widgets fields
*/
167 &ANALYZE-SUSPEND _QUERY-BLOCK DIALOG-BOX D-Dialog
168 /* Query rebuild information for
DIALOG-BOX D-Dialog
170 _Options
= "SHARE-LOCK"
172 */ /* DIALOG-BOX D-Dialog
*/
178 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB D-Dialog
179 /* ************************* Included-Libraries
*********************** */
181 {src
/adm
/method
/containr.i
}
182 {inc
/method
/m-utils.i
}
183 {inc
/method
/m-sysmgr.i
}
185 /* _UIB-CODE-BLOCK-END
*/
191 /* ************************ Control Triggers
************************ */
193 &Scoped-define SELF-NAME D-Dialog
194 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog
195 ON WINDOW-CLOSE
OF FRAME D-Dialog
/* Select a printer
*/
197 /* Add Trigger to equate WINDOW-CLOSE to END-ERROR.
*/
198 APPLY "END-ERROR":U
TO SELF.
201 /* _UIB-CODE-BLOCK-END
*/
205 &Scoped-define SELF-NAME btn-config
206 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn-config D-Dialog
207 ON CHOOSE OF btn-config
IN FRAME D-Dialog
/* Select Printer
*/
209 SYSTEM-DIALOG PRINTER-SETUP.
212 /* _UIB-CODE-BLOCK-END
*/
216 &Scoped-define SELF-NAME Btn_OK
217 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK D-Dialog
218 ON CHOOSE OF Btn_OK
IN FRAME D-Dialog
/* OK */
220 DEF VAR idx
AS INT NO-UNDO.
222 DO WITH FRAME {&FRAME-NAME}:
226 idx
= LOOKUP( RP.Char1
, RP.Char1
:LIST-ITEMS ).
227 RP.Char2
= ENTRY( idx
, RP.Char1
:PRIVATE-DATA ).
232 /* _UIB-CODE-BLOCK-END
*/
238 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK D-Dialog
241 /* *************************** Main Block
*************************** */
243 {src
/adm
/template
/dialogmn.i
}
245 /* _UIB-CODE-BLOCK-END
*/
249 /* ********************** Internal Procedures
*********************** */
251 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects D-Dialog _ADM-CREATE-OBJECTS
252 PROCEDURE adm-create-objects
:
253 /*------------------------------------------------------------------------------
254 Purpose
: Create handles for all SmartObjects used in this procedure.
255 After SmartObjects are initialized
, then SmartLinks are added.
257 ------------------------------------------------------------------------------*/
261 /* _UIB-CODE-BLOCK-END
*/
265 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available D-Dialog _ADM-ROW-AVAILABLE
266 PROCEDURE adm-row-available
:
267 /*------------------------------------------------------------------------------
268 Purpose
: Dispatched to this procedure when the Record-
269 Source has a new row available. This procedure
270 tries to get the new row
(or foriegn keys
) from
271 the Record-Source and process it.
273 ------------------------------------------------------------------------------*/
275 /* Define variables needed by this internal procedure.
*/
276 {src
/adm
/template
/row-head.i
}
278 /* Process the newly available records
(i.e. display fields
,
279 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
280 {src
/adm
/template
/row-end.i
}
284 /* _UIB-CODE-BLOCK-END
*/
288 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE
289 PROCEDURE disable_UI
:
290 /*------------------------------------------------------------------------------
291 Purpose
: DISABLE the User Interface
293 Notes
: Here we clean-up the user-interface by deleting
294 dynamic widgets we have created and
/or hide
295 frames. This procedure is usually called when
296 we are ready to
"clean-up" after running.
297 ------------------------------------------------------------------------------*/
298 /* Hide all frames.
*/
302 /* _UIB-CODE-BLOCK-END
*/
306 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE
307 PROCEDURE enable_UI
:
308 /*------------------------------------------------------------------------------
309 Purpose
: ENABLE the User Interface
311 Notes
: Here we display
/view
/enable the widgets in the
312 user-interface. In addition
, OPEN all queries
313 associated with each
FRAME and
BROWSE.
314 These statements here are based on the
"Other
315 Settings" section of the widget Property Sheets.
316 ------------------------------------------------------------------------------*/
320 ENABLE RECT-4 RP.Char1 btn-config Btn_OK Btn_Cancel
323 {&OPEN-BROWSERS-IN-QUERY-D-Dialog}
326 /* _UIB-CODE-BLOCK-END
*/
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-initialize D-Dialog
331 PROCEDURE local-initialize
:
332 /*------------------------------------------------------------------------------
333 Purpose
: Override standard ADM method
335 ------------------------------------------------------------------------------*/
337 /* Code placed here will execute PRIOR to standard behavior.
*/
339 /* Dispatch standard ADM method.
*/
340 RUN dispatch
IN THIS-PROCEDURE ( INPUT 'initialize'
:U
) .
342 /* Code placed here will execute AFTER standard behavior.
*/
343 DEF VAR user-name
AS CHAR NO-UNDO.
344 DEF VAR c-parent
AS CHAR NO-UNDO.
345 DEF VAR parent
AS HANDLE NO-UNDO.
347 RUN get-username
IN sys-mgr
( OUTPUT user-name
).
349 FIND RP
WHERE RP.UserName
= user-name
AND RP.ReportID
= {&REPORT-ID} NO-ERROR.
351 IF NOT AVAILABLE(RP
) THEN
354 ASSIGN RP.ReportID
= {&REPORT-ID}
355 RP.UserName
= user-name
356 RP.Char1
= SESSION:PRINTER-NAME
357 RP.Char2
= SESSION:PRINTER-PORT.
360 DISPLAY RP.Char1
WITH FRAME {&FRAME-NAME}.
364 /* _UIB-CODE-BLOCK-END
*/
368 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records D-Dialog _ADM-SEND-RECORDS
369 PROCEDURE send-records
:
370 /*------------------------------------------------------------------------------
371 Purpose
: Send record
ROWID's for all tables used by
373 Parameters
: see template
/snd-head.i
374 ------------------------------------------------------------------------------*/
376 /* Define variables needed by this internal procedure.
*/
377 {src
/adm
/template
/snd-head.i
}
379 /* For each requested table
, put it's
ROWID in the output list.
*/
380 {src
/adm
/template
/snd-list.i
"RP"}
382 /* Deal with any unexpected table requests before closing.
*/
383 {src
/adm
/template
/snd-end.i
}
387 /* _UIB-CODE-BLOCK-END
*/
391 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog
392 PROCEDURE state-changed
:
393 /* -----------------------------------------------------------
397 -------------------------------------------------------------*/
398 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
399 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
402 /* _UIB-CODE-BLOCK-END
*/