Add %age area column to vacancies section.
[capital-apms-progress.git] / forecast / b-scenario-assumptions.w
blob6706defd2acfed303df7913ca4df01b5ee61a702
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 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
8 /*------------------------------------------------------------------------
9 File:
10 Description:
12 ------------------------------------------------------------------------*/
14 CREATE WIDGET-POOL.
16 /* *************************** Definitions ************************** */
18 /* _UIB-CODE-BLOCK-END */
19 &ANALYZE-RESUME
22 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
24 /* ******************** Preprocessor Definitions ******************** */
26 &Scoped-define PROCEDURE-TYPE SmartBrowser
28 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
30 /* Name of first Frame and/or Browse and/or first Query */
31 &Scoped-define FRAME-NAME F-Main
32 &Scoped-define BROWSE-NAME br_table
34 /* Internal Tables (found by Frame, Query & Browse Queries) */
35 &Scoped-define INTERNAL-TABLES ScenarioAssumption
37 /* Define KEY-PHRASE in case it is used by any query. */
38 &Scoped-define KEY-PHRASE TRUE
40 /* Definitions for BROWSE br_table */
41 &Scoped-define FIELDS-IN-QUERY-br_table ScenarioAssumption.ScenarioCode ~
42 ScenarioAssumption.Scope ScenarioAssumption.Region ~
43 ScenarioAssumption.EntityType ScenarioAssumption.EntityCode ~
44 ScenarioAssumption.MonthCode ScenarioAssumption.TypeScope ~
45 ScenarioAssumption.AssumptionType ScenarioAssumption.AssumptionValue
46 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
47 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
48 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH ScenarioAssumption WHERE ~{&KEY-PHRASE} NO-LOCK ~
49 ~{&SORTBY-PHRASE}.
50 &Scoped-define TABLES-IN-QUERY-br_table ScenarioAssumption
51 &Scoped-define FIRST-TABLE-IN-QUERY-br_table ScenarioAssumption
54 /* Definitions for FRAME F-Main */
56 /* Standard List Definitions */
57 &Scoped-Define ENABLED-OBJECTS br_table
59 /* Custom List Definitions */
60 /* List-1,List-2,List-3,List-4,List-5,List-6 */
62 /* _UIB-PREPROCESSOR-BLOCK-END */
63 &ANALYZE-RESUME
66 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
67 /* Actions: ? adm/support/keyedit.w ? ? ? */
68 /* STRUCTURED-DATA
69 <KEY-OBJECT>
70 &BROWSE-NAME
71 </KEY-OBJECT>
72 <FOREIGN-KEYS>
73 </FOREIGN-KEYS>
74 <EXECUTING-CODE>
75 **************************
76 * Set attributes related to FOREIGN KEYS
78 RUN set-attribute-list (
79 'Keys-Accepted = "",
80 Keys-Supplied = ""':U).
81 /**************************
82 </EXECUTING-CODE> */
84 /* _UIB-CODE-BLOCK-END */
85 &ANALYZE-RESUME
87 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
88 /* Actions: ? adm/support/advqedit.w ? ? ? */
89 /* STRUCTURED-DATA
90 <KEY-OBJECT>
91 &BROWSE-NAME
92 </KEY-OBJECT>
93 <SORTBY-OPTIONS>
94 </SORTBY-OPTIONS>
95 <SORTBY-RUN-CODE>
96 ************************
97 * Set attributes related to SORTBY-OPTIONS */
98 RUN set-attribute-list (
99 'SortBy-Options = ""':U).
100 /************************
101 </SORTBY-RUN-CODE>
102 <FILTER-ATTRIBUTES>
103 </FILTER-ATTRIBUTES> */
105 /* _UIB-CODE-BLOCK-END */
106 &ANALYZE-RESUME
109 /* *********************** Control Definitions ********************** */
112 /* Definitions of the field level widgets */
113 /* Query definitions */
114 &ANALYZE-SUSPEND
115 DEFINE QUERY br_table FOR
116 ScenarioAssumption SCROLLING.
117 &ANALYZE-RESUME
119 /* Browse definitions */
120 DEFINE BROWSE br_table
121 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
122 QUERY br_table NO-LOCK DISPLAY
123 ScenarioAssumption.ScenarioCode COLUMN-LABEL "Scenario"
124 ScenarioAssumption.Scope
125 ScenarioAssumption.Region
126 ScenarioAssumption.EntityType
127 ScenarioAssumption.EntityCode COLUMN-LABEL " Code"
128 ScenarioAssumption.MonthCode
129 ScenarioAssumption.TypeScope
130 ScenarioAssumption.AssumptionType COLUMN-LABEL "Ass.Type"
131 ScenarioAssumption.AssumptionValue
132 /* _UIB-CODE-BLOCK-END */
133 &ANALYZE-RESUME
134 WITH NO-ASSIGN SEPARATORS SIZE 73.14 BY 14.6
135 FONT 10.
138 /* ************************ Frame Definitions *********************** */
140 DEFINE FRAME F-Main
141 br_table AT ROW 1 COL 1
142 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
143 SIDE-LABELS NO-UNDERLINE THREE-D
144 AT COL 1 ROW 1 SCROLLABLE
145 BGCOLOR 16 FGCOLOR 0 FONT 10.
148 /* *********************** Procedure Settings ************************ */
150 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
151 /* Settings for THIS-PROCEDURE
152 Type: SmartBrowser
153 Allow: Basic,Browse
154 Frames: 1
155 Add Fields to: EXTERNAL-TABLES
156 Other Settings: PERSISTENT-ONLY COMPILE
159 /* This procedure should always be RUN PERSISTENT. Report the error, */
160 /* then cleanup and return. */
161 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
162 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
163 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
164 RETURN.
165 END.
167 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
169 /* ************************* Create Window ************************** */
171 &ANALYZE-SUSPEND _CREATE-WINDOW
172 /* DESIGN Window definition (used by the UIB)
173 CREATE WINDOW B-table-Win ASSIGN
174 HEIGHT = 15.3
175 WIDTH = 73.57.
176 /* END WINDOW DEFINITION */
178 &ANALYZE-RESUME
181 /* *************** Runtime Attributes and UIB Settings ************** */
183 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
184 /* SETTINGS FOR WINDOW B-table-Win
185 NOT-VISIBLE,,RUN-PERSISTENT */
186 /* SETTINGS FOR FRAME F-Main
187 NOT-VISIBLE Size-to-Fit */
188 /* BROWSE-TAB br_table 1 F-Main */
189 ASSIGN
190 FRAME F-Main:SCROLLABLE = FALSE
191 FRAME F-Main:HIDDEN = TRUE.
193 /* _RUN-TIME-ATTRIBUTES-END */
194 &ANALYZE-RESUME
197 /* Setting information for Queries and Browse Widgets fields */
199 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
200 /* Query rebuild information for BROWSE br_table
201 _TblList = "TTPL.ScenarioAssumption"
202 _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
203 _FldNameList[1] > TTPL.ScenarioAssumption.ScenarioCode
204 "ScenarioAssumption.ScenarioCode" "Scenario" ? "integer" ? ? ? ? ? ? no ?
205 _FldNameList[2] = TTPL.ScenarioAssumption.Scope
206 _FldNameList[3] = TTPL.ScenarioAssumption.Region
207 _FldNameList[4] = TTPL.ScenarioAssumption.EntityType
208 _FldNameList[5] > TTPL.ScenarioAssumption.EntityCode
209 "ScenarioAssumption.EntityCode" " Code" ? "integer" ? ? ? ? ? ? no ?
210 _FldNameList[6] = TTPL.ScenarioAssumption.MonthCode
211 _FldNameList[7] = TTPL.ScenarioAssumption.TypeScope
212 _FldNameList[8] > TTPL.ScenarioAssumption.AssumptionType
213 "ScenarioAssumption.AssumptionType" "Ass.Type" ? "character" ? ? ? ? ? ? no ?
214 _FldNameList[9] = TTPL.ScenarioAssumption.AssumptionValue
215 _Query is NOT OPENED
216 */ /* BROWSE br_table */
217 &ANALYZE-RESUME
219 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
220 /* Query rebuild information for FRAME F-Main
221 _Options = "NO-LOCK"
222 _Query is NOT OPENED
223 */ /* FRAME F-Main */
224 &ANALYZE-RESUME
229 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
230 /* ************************* Included-Libraries *********************** */
232 {src/adm/method/browser.i}
233 {inc/method/m-drlvwr.i}
235 /* _UIB-CODE-BLOCK-END */
236 &ANALYZE-RESUME
241 /* ************************ Control Triggers ************************ */
243 &Scoped-define BROWSE-NAME br_table
244 &Scoped-define SELF-NAME br_table
245 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
246 ON ROW-ENTRY OF br_table IN FRAME F-Main
248 /* This code displays initial values for newly added or copied rows. */
249 {src/adm/template/brsentry.i}
250 END.
252 /* _UIB-CODE-BLOCK-END */
253 &ANALYZE-RESUME
256 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
257 ON ROW-LEAVE OF br_table IN FRAME F-Main
259 /* Do not disable this code or no updates will take place except
260 by pressing the Save button on an Update SmartPanel. */
261 {src/adm/template/brsleave.i}
262 END.
264 /* _UIB-CODE-BLOCK-END */
265 &ANALYZE-RESUME
268 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
269 ON VALUE-CHANGED OF br_table IN FRAME F-Main
271 /* This ADM trigger code must be preserved in order to notify other
272 objects when the browser's current row changes. */
273 {src/adm/template/brschnge.i}
274 END.
276 /* _UIB-CODE-BLOCK-END */
277 &ANALYZE-RESUME
280 &UNDEFINE SELF-NAME
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
285 /* *************************** Main Block *************************** */
287 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
288 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
289 &ENDIF
291 /* _UIB-CODE-BLOCK-END */
292 &ANALYZE-RESUME
295 /* ********************** Internal Procedures *********************** */
297 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
298 PROCEDURE adm-row-available :
299 /*------------------------------------------------------------------------------
300 Purpose: Dispatched to this procedure when the Record-
301 Source has a new row available. This procedure
302 tries to get the new row (or foriegn keys) from
303 the Record-Source and process it.
304 Parameters: <none>
305 ------------------------------------------------------------------------------*/
307 /* Define variables needed by this internal procedure. */
308 {src/adm/template/row-head.i}
310 /* Process the newly available records (i.e. display fields,
311 open queries, and/or pass records on to any RECORD-TARGETS). */
312 {src/adm/template/row-end.i}
314 END PROCEDURE.
316 /* _UIB-CODE-BLOCK-END */
317 &ANALYZE-RESUME
320 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
321 PROCEDURE disable_UI :
322 /*------------------------------------------------------------------------------
323 Purpose: DISABLE the User Interface
324 Parameters: <none>
325 Notes: Here we clean-up the user-interface by deleting
326 dynamic widgets we have created and/or hide
327 frames. This procedure is usually called when
328 we are ready to "clean-up" after running.
329 ------------------------------------------------------------------------------*/
330 /* Hide all frames. */
331 HIDE FRAME F-Main.
332 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
333 END PROCEDURE.
335 /* _UIB-CODE-BLOCK-END */
336 &ANALYZE-RESUME
339 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
340 PROCEDURE send-records :
341 /*------------------------------------------------------------------------------
342 Purpose: Send record ROWID's for all tables used by
343 this file.
344 Parameters: see template/snd-head.i
345 ------------------------------------------------------------------------------*/
347 /* Define variables needed by this internal procedure. */
348 {src/adm/template/snd-head.i}
350 /* For each requested table, put it's ROWID in the output list. */
351 {src/adm/template/snd-list.i "ScenarioAssumption"}
353 /* Deal with any unexpected table requests before closing. */
354 {src/adm/template/snd-end.i}
356 END PROCEDURE.
358 /* _UIB-CODE-BLOCK-END */
359 &ANALYZE-RESUME
362 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
363 PROCEDURE state-changed :
364 /* -----------------------------------------------------------
365 Purpose:
366 Parameters: <none>
367 Notes:
368 -------------------------------------------------------------*/
369 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
370 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
372 CASE p-state:
373 /* Object instance CASEs can go here to replace standard behavior
374 or add new cases. */
375 {src/adm/template/bstates.i}
376 END CASE.
377 END PROCEDURE.
379 /* _UIB-CODE-BLOCK-END */
380 &ANALYZE-RESUME