1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r2 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 DEF VAR user-name
AS CHAR INITIAL "Andrew" NO-UNDO.
17 &GLOB REPORT-ID "xperiod"
19 /* _UIB-CODE-BLOCK-END
*/
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions
******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
31 /* Name of first Frame and
/or Browse and
/or first Query
*/
32 &Scoped-define FRAME-NAME F-Main
35 &Scoped-define FIRST-EXTERNAL-TABLE RP
36 &Scoped-define EXTERNAL-TABLES RP
37 /* Need to scope the external tables to this procedure
*/
38 DEFINE QUERY external_tables
FOR RP.
40 /* Standard List Definitions
*/
41 &Scoped-Define ENABLED-FIELDS RP.Log1
42 &Scoped-define FIELD-PAIRS
43 &Scoped-Define ENABLED-TABLES RP
44 &Scoped-Define ENABLED-OBJECTS RECT-1 Btn_OK
45 &Scoped-Define DISPLAYED-FIELDS RP.Log1
47 /* Custom List Definitions
*/
48 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
50 /* _UIB-PREPROCESSOR-BLOCK-END
*/
55 /* *********************** Control Definitions
********************** */
58 /* Definitions of the field level widgets
*/
59 DEFINE BUTTON Btn_OK
AUTO-GO DEFAULT
64 DEFINE RECTANGLE RECT-1
65 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
69 /* ************************ Frame Definitions
*********************** */
72 RP.Log1
AT ROW 4.8 COL 7.29
77 Btn_OK
AT ROW 4.8 COL 41.57
79 "Cross Period Creditor Transactions" VIEW-AS TEXT
80 SIZE 49.72 BY 1.8 AT ROW 1.6 COL 2.14
82 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
83 SIDE-LABELS NO-UNDERLINE THREE-D
84 AT COL 1 ROW 1 SCROLLABLE
85 DEFAULT-BUTTON Btn_OK.
89 /* *********************** Procedure Settings
************************ */
91 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
92 /* Settings for
THIS-PROCEDURE
94 External Tables
: ttpl.RP
95 Allow
: Basic
,DB-Fields
97 Add Fields to
: EXTERNAL-TABLES
98 Other Settings
: PERSISTENT-ONLY
COMPILE
101 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
102 /* then cleanup and return.
*/
103 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
104 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
105 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
109 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
111 /* ************************* Create Window
************************** */
113 &ANALYZE-SUSPEND _CREATE-WINDOW
114 /* DESIGN Window definition
(used by the UIB
)
115 CREATE WINDOW V-table-Win
ASSIGN
122 /* *************** Runtime Attributes and UIB Settings
************** */
124 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
125 /* SETTINGS
FOR WINDOW V-table-Win
126 VISIBLE,,RUN-PERSISTENT
*/
127 /* SETTINGS
FOR FRAME F-Main
128 NOT-VISIBLE Size-to-Fit
*/
130 FRAME F-Main
:SCROLLABLE = FALSE
131 FRAME F-Main
:HIDDEN = TRUE.
133 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
135 /* _RUN-TIME-ATTRIBUTES-END
*/
139 /* Setting information for Queries and Browse Widgets fields
*/
141 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
142 /* Query rebuild information for
FRAME F-Main
145 */ /* FRAME F-Main
*/
151 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
152 /* ************************* Included-Libraries
*********************** */
154 {src
/adm
/method
/viewer.i
}
155 {inc
/method
/m-mntvwr.i
}
157 /* _UIB-CODE-BLOCK-END
*/
163 /* ************************ Control Triggers
************************ */
165 &Scoped-define SELF-NAME Btn_OK
166 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
167 ON CHOOSE OF Btn_OK
IN FRAME F-Main
/* OK */
172 /* _UIB-CODE-BLOCK-END
*/
178 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
181 /* *************************** Main Block
*************************** */
183 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
184 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
187 /************************ INTERNAL PROCEDURES
********************/
189 /* _UIB-CODE-BLOCK-END
*/
193 /* ********************** Internal Procedures
*********************** */
195 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
196 PROCEDURE adm-row-available
:
197 /*------------------------------------------------------------------------------
198 Purpose
: Dispatched to this procedure when the record-
199 source has a new row available. This procedure
200 tries to get the new row and display it.
202 ------------------------------------------------------------------------------*/
204 /* Define variables needed by this internal procedure.
*/
205 {src
/adm
/template
/row-head.i
}
207 /* Create a list of all the tables that we need to get.
*/
208 {src
/adm
/template
/row-list.i
"RP"}
210 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
211 {src
/adm
/template
/row-get.i
}
213 /* FIND each record specified by the RECORD-SOURCE.
*/
214 {src
/adm
/template
/row-find.i
"RP"}
216 /* Process the newly available records
(i.e. display fields
,
217 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
218 {src
/adm
/template
/row-end.i
}
222 /* _UIB-CODE-BLOCK-END
*/
226 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
227 PROCEDURE disable_UI
:
228 /*------------------------------------------------------------------------------
229 Purpose
: DISABLE the User Interface
231 Notes
: Here we clean-up the user-interface by deleting
232 dynamic widgets we have created and
/or hide
233 frames. This procedure is usually called when
234 we are ready to
"clean-up" after running.
235 ------------------------------------------------------------------------------*/
236 /* Hide all frames.
*/
238 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
241 /* _UIB-CODE-BLOCK-END
*/
245 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
246 PROCEDURE enable-appropriate-fields
:
247 /*------------------------------------------------------------------------------
248 Purpose
: As its name
!
249 ------------------------------------------------------------------------------*/
251 DO WITH FRAME {&FRAME-NAME}:
257 /* _UIB-CODE-BLOCK-END
*/
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
262 PROCEDURE inst-initialize
:
263 /*------------------------------------------------------------------------------
264 Purpose
: Initialise the necessary bits and pieces
265 ------------------------------------------------------------------------------*/
267 RUN get-username
IN sec-mgr
( OUTPUT user-name
).
268 FIND RP
WHERE RP.ReportID
= {&REPORT-ID}
269 AND RP.UserName
= user-name
272 IF NOT AVAILABLE( RP
) THEN DO:
275 RP.ReportID
= {&REPORT-ID}
276 RP.UserName
= user-name
280 RUN dispatch
( 'display-fields'
:U
).
281 RUN dispatch
( 'enable-fields'
:U
).
282 RUN enable-appropriate-fields.
286 /* _UIB-CODE-BLOCK-END
*/
290 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
291 PROCEDURE pre-destroy
:
292 /*------------------------------------------------------------------------------
294 ------------------------------------------------------------------------------*/
295 RUN check-modified
( 'clear'
:U
).
298 /* _UIB-CODE-BLOCK-END
*/
302 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
303 PROCEDURE run-report
:
304 /*------------------------------------------------------------------------------
305 Purpose
: Actually run the report program.
306 ------------------------------------------------------------------------------*/
307 DEF VAR c-win
AS HANDLE NO-UNDO.
308 DEF VAR report-options
AS CHAR NO-UNDO.
310 c-win
= CURRENT-WINDOW.
311 IF c-win
:LOAD-MOUSE-POINTER("WAIT":U
) THEN .
312 DISABLE Btn_OK
WITH FRAME {&FRAME-NAME}.
314 RUN dispatch
IN THIS-PROCEDURE ('update-record'
:U
).
317 report-options
= RP.Char1.
318 RUN process
/report
/xperiod.p
( report-options
,
319 RP.Log1
/* preview
*/
321 ENABLE Btn_OK
WITH FRAME {&FRAME-NAME}.
322 IF c-win
:LOAD-MOUSE-POINTER("ARROW":U
) THEN .
326 /* _UIB-CODE-BLOCK-END
*/
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
331 PROCEDURE send-records
:
332 /*------------------------------------------------------------------------------
333 Purpose
: Send record
ROWID's for all tables used by
335 Parameters
: see template
/snd-head.i
336 ------------------------------------------------------------------------------*/
338 /* Define variables needed by this internal procedure.
*/
339 {src
/adm
/template
/snd-head.i
}
341 /* For each requested table
, put it's
ROWID in the output list.
*/
342 {src
/adm
/template
/snd-list.i
"RP"}
344 /* Deal with any unexpected table requests before closing.
*/
345 {src
/adm
/template
/snd-end.i
}
349 /* _UIB-CODE-BLOCK-END
*/
353 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
354 PROCEDURE state-changed
:
355 /* -----------------------------------------------------------
359 -------------------------------------------------------------*/
360 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
361 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
364 /* Object instance CASEs can go here to replace standard behavior
366 {src
/adm
/template
/vstates.i
}
370 /* _UIB-CODE-BLOCK-END
*/