1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
8 /*------------------------------------------------------------------------
12 ------------------------------------------------------------------------*/
16 /* *************************** Definitions
************************** */
18 /* _UIB-CODE-BLOCK-END
*/
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 ~
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
*/
66 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
67 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
75 **************************
76 * Set attributes related to FOREIGN
KEYS
78 RUN set-attribute-list
(
80 Keys-Supplied
= ""'
:U
).
81 /**************************
84 /* _UIB-CODE-BLOCK-END
*/
87 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
88 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
96 ************************
97 * Set attributes related to SORTBY-OPTIONS
*/
98 RUN set-attribute-list
(
99 'SortBy-Options
= ""'
:U
).
100 /************************
103 </FILTER-ATTRIBUTES
> */
105 /* _UIB-CODE-BLOCK-END
*/
109 /* *********************** Control Definitions
********************** */
112 /* Definitions of the field level widgets
*/
113 /* Query definitions
*/
115 DEFINE QUERY br_table
FOR
116 ScenarioAssumption
SCROLLING.
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
*/
134 WITH NO-ASSIGN SEPARATORS SIZE 73.14 BY 14.6
138 /* ************************ Frame Definitions
*********************** */
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
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.
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
176 /* END WINDOW DEFINITION
*/
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
*/
190 FRAME F-Main
:SCROLLABLE = FALSE
191 FRAME F-Main
:HIDDEN = TRUE.
193 /* _RUN-TIME-ATTRIBUTES-END
*/
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
216 */ /* BROWSE br_table
*/
219 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
220 /* Query rebuild information for
FRAME F-Main
223 */ /* FRAME F-Main
*/
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
*/
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
}
252 /* _UIB-CODE-BLOCK-END
*/
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
}
264 /* _UIB-CODE-BLOCK-END
*/
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
}
276 /* _UIB-CODE-BLOCK-END
*/
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
).
291 /* _UIB-CODE-BLOCK-END
*/
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.
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
}
316 /* _UIB-CODE-BLOCK-END
*/
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
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.
*/
332 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
335 /* _UIB-CODE-BLOCK-END
*/
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
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
}
358 /* _UIB-CODE-BLOCK-END
*/
362 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
363 PROCEDURE state-changed
:
364 /* -----------------------------------------------------------
368 -------------------------------------------------------------*/
369 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
370 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
373 /* Object instance CASEs can go here to replace standard behavior
375 {src
/adm
/template
/bstates.i
}
379 /* _UIB-CODE-BLOCK-END
*/