1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
12 Description
: from VIEWER.W
- Template for SmartViewer Objects
14 ------------------------------------------------------------------------*/
18 /* *************************** Definitions
************************** */
20 /* _UIB-CODE-BLOCK-END
*/
24 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
26 /* ******************** Preprocessor Definitions
******************** */
28 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define DB-AWARE no
31 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
33 /* Name of first Frame and
/or Browse and
/or first Query
*/
34 &Scoped-define FRAME-NAME F-Main
37 &Scoped-define EXTERNAL-TABLES NewBatch
38 &Scoped-define FIRST-EXTERNAL-TABLE NewBatch
41 /* Need to scope the external tables to this procedure
*/
42 DEFINE QUERY external_tables
FOR NewBatch.
43 /* Standard List Definitions
*/
44 &Scoped-Define ENABLED-OBJECTS fil_BatchCode tgl_reverse tgl_Preview ~
46 &Scoped-Define DISPLAYED-FIELDS NewBatch.BatchCode NewBatch.Description
47 &Scoped-Define DISPLAYED-OBJECTS fil_BatchCode tgl_reverse tgl_Preview
49 /* Custom List Definitions
*/
50 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
52 /* _UIB-PREPROCESSOR-BLOCK-END
*/
57 /* *********************** Control Definitions
********************** */
60 /* Definitions of the field level widgets
*/
61 DEFINE BUTTON btn_Compare
66 DEFINE VARIABLE fil_BatchCode
AS INTEGER FORMAT ">>>>>>9" INITIAL 0
69 SIZE 8 BY 1.05 TOOLTIP "The posted batch to compare this batch with".
71 DEFINE RECTANGLE RECT-33
72 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
75 DEFINE VARIABLE tgl_Preview
AS LOGICAL INITIAL no
81 DEFINE VARIABLE tgl_reverse
AS LOGICAL INITIAL no
82 LABEL "Reversed Comparison"
88 /* ************************ Frame Definitions
*********************** */
91 NewBatch.BatchCode
AT ROW 1.5 COL 11 COLON-ALIGNED
94 NewBatch.Description
AT ROW 2.75 COL 11 COLON-ALIGNED
97 fil_BatchCode
AT ROW 5 COL 11 COLON-ALIGNED
98 tgl_reverse
AT ROW 6 COL 13
99 tgl_Preview
AT ROW 7 COL 13
100 btn_Compare
AT ROW 7 COL 41
101 RECT-33
AT ROW 1 COL 1
102 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
103 SIDE-LABELS NO-UNDERLINE THREE-D
104 AT COL 1 ROW 1 SCROLLABLE
108 /* *********************** Procedure Settings
************************ */
110 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
111 /* Settings for
THIS-PROCEDURE
113 External Tables
: TTPL.NewBatch
114 Allow
: Basic
,DB-Fields
116 Add Fields to
: EXTERNAL-TABLES
117 Other Settings
: PERSISTENT-ONLY
COMPILE
120 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
121 /* then cleanup and return.
*/
122 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
123 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
124 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
128 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
130 /* ************************* Create Window
************************** */
132 &ANALYZE-SUSPEND _CREATE-WINDOW
133 /* DESIGN Window definition
(used by the UIB
)
134 CREATE WINDOW V-table-Win
ASSIGN
137 /* END WINDOW DEFINITION
*/
141 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
142 /* ************************* Included-Libraries
*********************** */
144 {src
/adm
/method
/viewer.i
}
145 {inc
/method
/m-mntvwr.i
}
147 /* _UIB-CODE-BLOCK-END
*/
153 /* *********** Runtime Attributes and AppBuilder Settings
*********** */
155 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
156 /* SETTINGS
FOR WINDOW V-table-Win
157 VISIBLE,,RUN-PERSISTENT
*/
158 /* SETTINGS
FOR FRAME F-Main
159 NOT-VISIBLE Size-to-Fit
*/
161 FRAME F-Main
:SCROLLABLE = FALSE
162 FRAME F-Main
:HIDDEN = TRUE.
164 /* SETTINGS
FOR FILL-IN NewBatch.BatchCode
IN FRAME F-Main
166 /* SETTINGS
FOR FILL-IN NewBatch.Description
IN FRAME F-Main
168 /* _RUN-TIME-ATTRIBUTES-END
*/
172 /* Setting information for Queries and Browse Widgets fields
*/
174 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
175 /* Query rebuild information for
FRAME F-Main
178 */ /* FRAME F-Main
*/
185 /* ************************ Control Triggers
************************ */
187 &Scoped-define SELF-NAME btn_Compare
188 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Compare V-table-Win
189 ON CHOOSE OF btn_Compare
IN FRAME F-Main
/* Compare
*/
192 RUN dispatch
( 'exit'
:U
).
195 /* _UIB-CODE-BLOCK-END
*/
201 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
204 /* *************************** Main Block
*************************** */
206 /* _UIB-CODE-BLOCK-END
*/
210 /* ********************** Internal Procedures
*********************** */
212 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
213 PROCEDURE adm-row-available
:
214 /*------------------------------------------------------------------------------
215 Purpose
: Dispatched to this procedure when the Record-
216 Source has a new row available. This procedure
217 tries to get the new row
(or foriegn keys
) from
218 the Record-Source and process it.
220 ------------------------------------------------------------------------------*/
222 /* Define variables needed by this internal procedure.
*/
223 {src
/adm
/template
/row-head.i
}
225 /* Create a list of all the tables that we need to get.
*/
226 {src
/adm
/template
/row-list.i
"NewBatch"}
228 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
229 {src
/adm
/template
/row-get.i
}
231 /* FIND each record specified by the RECORD-SOURCE.
*/
232 {src
/adm
/template
/row-find.i
"NewBatch"}
234 /* Process the newly available records
(i.e. display fields
,
235 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
236 {src
/adm
/template
/row-end.i
}
240 /* _UIB-CODE-BLOCK-END
*/
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
244 PROCEDURE disable_UI
:
245 /*------------------------------------------------------------------------------
246 Purpose
: DISABLE the User Interface
248 Notes
: Here we clean-up the user-interface by deleting
249 dynamic widgets we have created and
/or hide
250 frames. This procedure is usually called when
251 we are ready to
"clean-up" after running.
252 ------------------------------------------------------------------------------*/
253 /* Hide all frames.
*/
255 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
258 /* _UIB-CODE-BLOCK-END
*/
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
262 PROCEDURE enable-appropriate-fields
:
263 /*------------------------------------------------------------------------------
265 ------------------------------------------------------------------------------*/
266 DO WITH FRAME {&FRAME-NAME}:
267 /* nothing to do as yet
*/
272 /* _UIB-CODE-BLOCK-END
*/
275 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
276 PROCEDURE inst-initialize
:
277 /*------------------------------------------------------------------------------
279 ------------------------------------------------------------------------------*/
283 /* _UIB-CODE-BLOCK-END
*/
286 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-row-available V-table-Win
287 PROCEDURE inst-row-available
:
288 /*------------------------------------------------------------------------------
290 ------------------------------------------------------------------------------*/
292 RUN enable-appropriate-fields.
296 /* _UIB-CODE-BLOCK-END
*/
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
300 PROCEDURE run-report
:
301 /*------------------------------------------------------------------------------
302 Purpose
: Actually run the rent charge program.
303 ------------------------------------------------------------------------------*/
304 RUN notify
( 'set-busy
,container-source'
:U
).
306 DEF VAR report-options
AS CHAR NO-UNDO.
308 DO WITH FRAME {&FRAME-NAME}:
309 ASSIGN fil_BatchCode tgl_Reverse .
312 report-options
= "UnpostedBatch," + STRING(NewBatch.BatchCode
)
313 + "PostedBatch," + STRING(fil_BatchCode
)
314 + (IF tgl_Reverse
THEN "~nReverse" ELSE "")
315 + (IF tgl_Preview
THEN "~nPreview" ELSE "") .
317 RUN process
/report
/batch-compare.p
( report-options
).
319 RUN notify
( 'set-idle
,container-source'
:U
).
323 /* _UIB-CODE-BLOCK-END
*/
326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
327 PROCEDURE send-records
:
328 /*------------------------------------------------------------------------------
329 Purpose
: Send record
ROWID's for all tables used by
331 Parameters
: see template
/snd-head.i
332 ------------------------------------------------------------------------------*/
334 /* Define variables needed by this internal procedure.
*/
335 {src
/adm
/template
/snd-head.i
}
337 /* For each requested table
, put it's
ROWID in the output list.
*/
338 {src
/adm
/template
/snd-list.i
"NewBatch"}
340 /* Deal with any unexpected table requests before closing.
*/
341 {src
/adm
/template
/snd-end.i
}
345 /* _UIB-CODE-BLOCK-END
*/
348 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
349 PROCEDURE state-changed
:
350 /* -----------------------------------------------------------
354 -------------------------------------------------------------*/
355 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
356 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
359 /* Object instance CASEs can go here to replace standard behavior
361 {src
/adm
/template
/vstates.i
}
365 /* _UIB-CODE-BLOCK-END
*/