Now with added FM Call Register section.
[capital-apms-progress.git] / win / d-selprt.w
blobf4efa272962159c394d0871ab741be4995d4e596
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 /* Connected Databases
4 ttpl PROGRESS
5 */
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 /*------------------------------------------------------------------------
11 File:
13 Description: from cntnrdlg.w - ADM SmartDialog Template
15 Input Parameters:
16 <none>
18 Output Parameters:
19 <none>
21 Author:
23 Created:
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. */
34 CREATE WIDGET-POOL.
36 /* *************************** Definitions ************************** */
38 /* Parameters Definitions --- */
40 /* Local Variable Definitions --- */
42 &SCOPED-DEFINE REPORT-ID "Current Printer"
44 /* _UIB-CODE-BLOCK-END */
45 &ANALYZE-RESUME
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 */
85 &ANALYZE-RESUME
89 /* *********************** Control Definitions ********************** */
91 /* Define a dialog box */
93 /* Definitions of the field level widgets */
94 DEFINE BUTTON btn-config
95 LABEL "Select &Printer"
96 SIZE 15.43 BY 1.25
97 FONT 9.
99 DEFINE BUTTON Btn_Cancel AUTO-END-KEY
100 LABEL "&Cancel"
101 SIZE 9.57 BY 1.1
102 BGCOLOR 8 FONT 9.
104 DEFINE BUTTON Btn_OK AUTO-GO
105 LABEL "&OK"
106 SIZE 9.86 BY 1.1
107 BGCOLOR 8 FONT 9.
109 DEFINE RECTANGLE RECT-4
110 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
111 SIZE 61.57 BY 3.8.
113 /* Query definitions */
114 &ANALYZE-SUSPEND
115 DEFINE QUERY D-Dialog FOR
116 RP SCROLLING.
117 &ANALYZE-RESUME
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)"
124 VIEW-AS FILL-IN
125 SIZE 50.86 BY 1.05
126 FONT 10
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
134 FONT 10
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
143 Type: SmartDialog
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
155 ASSIGN
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 */
162 &ANALYZE-RESUME
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
169 _TblList = "TTPL.RP"
170 _Options = "SHARE-LOCK"
171 _Query is NOT OPENED
172 */ /* DIALOG-BOX D-Dialog */
173 &ANALYZE-RESUME
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 */
186 &ANALYZE-RESUME
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 */
196 DO:
197 /* Add Trigger to equate WINDOW-CLOSE to END-ERROR. */
198 APPLY "END-ERROR":U TO SELF.
199 END.
201 /* _UIB-CODE-BLOCK-END */
202 &ANALYZE-RESUME
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.
210 END.
212 /* _UIB-CODE-BLOCK-END */
213 &ANALYZE-RESUME
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}:
224 ASSIGN
225 RP.Char1
226 idx = LOOKUP( RP.Char1, RP.Char1:LIST-ITEMS ).
227 RP.Char2 = ENTRY( idx, RP.Char1:PRIVATE-DATA ).
228 END.
230 END.
232 /* _UIB-CODE-BLOCK-END */
233 &ANALYZE-RESUME
236 &UNDEFINE SELF-NAME
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 */
246 &ANALYZE-RESUME
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.
256 Parameters: <none>
257 ------------------------------------------------------------------------------*/
259 END PROCEDURE.
261 /* _UIB-CODE-BLOCK-END */
262 &ANALYZE-RESUME
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.
272 Parameters: <none>
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}
282 END PROCEDURE.
284 /* _UIB-CODE-BLOCK-END */
285 &ANALYZE-RESUME
288 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE
289 PROCEDURE disable_UI :
290 /*------------------------------------------------------------------------------
291 Purpose: DISABLE the User Interface
292 Parameters: <none>
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. */
299 HIDE FRAME D-Dialog.
300 END PROCEDURE.
302 /* _UIB-CODE-BLOCK-END */
303 &ANALYZE-RESUME
306 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE
307 PROCEDURE enable_UI :
308 /*------------------------------------------------------------------------------
309 Purpose: ENABLE the User Interface
310 Parameters: <none>
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 ------------------------------------------------------------------------------*/
317 IF AVAILABLE RP THEN
318 DISPLAY RP.Char1
319 WITH FRAME D-Dialog.
320 ENABLE RECT-4 RP.Char1 btn-config Btn_OK Btn_Cancel
321 WITH FRAME D-Dialog.
322 VIEW FRAME D-Dialog.
323 {&OPEN-BROWSERS-IN-QUERY-D-Dialog}
324 END PROCEDURE.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-initialize D-Dialog
331 PROCEDURE local-initialize :
332 /*------------------------------------------------------------------------------
333 Purpose: Override standard ADM method
334 Notes:
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
353 CREATE RP.
354 ASSIGN RP.ReportID = {&REPORT-ID}
355 RP.UserName = user-name
356 RP.Char1 = SESSION:PRINTER-NAME
357 RP.Char2 = SESSION:PRINTER-PORT.
358 END.
360 DISPLAY RP.Char1 WITH FRAME {&FRAME-NAME}.
362 END PROCEDURE.
364 /* _UIB-CODE-BLOCK-END */
365 &ANALYZE-RESUME
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
372 this file.
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}
385 END PROCEDURE.
387 /* _UIB-CODE-BLOCK-END */
388 &ANALYZE-RESUME
391 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog
392 PROCEDURE state-changed :
393 /* -----------------------------------------------------------
394 Purpose:
395 Parameters: <none>
396 Notes:
397 -------------------------------------------------------------*/
398 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
399 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
400 END PROCEDURE.
402 /* _UIB-CODE-BLOCK-END */
403 &ANALYZE-RESUME