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 /*------------------------------------------------------------------------
14 ------------------------------------------------------------------------*/
18 /* *************************** Definitions
************************** */
20 /* _UIB-CODE-BLOCK-END
*/
24 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
26 /* ******************** Preprocessor Definitions
******************** */
28 &Scoped-define PROCEDURE-TYPE SmartBrowser
30 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
32 /* Name of first Frame and
/or Browse and
/or first Query
*/
33 &Scoped-define FRAME-NAME F-Main
34 &Scoped-define BROWSE-NAME br_table
36 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
37 &Scoped-define INTERNAL-TABLES PropForecastType
39 /* Define KEY-PHRASE in case it is used by any query.
*/
40 &Scoped-define KEY-PHRASE TRUE
42 /* Definitions for
BROWSE br_table
*/
43 &Scoped-define FIELDS-IN-QUERY-br_table PropForecastType.PropForecastType ~
44 PropForecastType.Description
45 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table ~
46 PropForecastType.PropForecastType PropForecastType.Description
47 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table~
48 ~
{&FP1}PropForecastType ~{&FP2}PropForecastType ~{&FP3}~
49 ~
{&FP1}Description ~{&FP2}Description ~{&FP3}
50 &Scoped-define ENABLED-TABLES-IN-QUERY-br_table PropForecastType
51 &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-br_table PropForecastType
52 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH PropForecastType WHERE ~{&KEY-PHRASE} NO-LOCK ~
54 &Scoped-define TABLES-IN-QUERY-br_table PropForecastType
55 &Scoped-define FIRST-TABLE-IN-QUERY-br_table PropForecastType
58 /* Definitions for
FRAME F-Main
*/
60 /* Standard List Definitions
*/
61 &Scoped-Define ENABLED-OBJECTS br_table
63 /* Custom List Definitions
*/
64 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
66 /* _UIB-PREPROCESSOR-BLOCK-END
*/
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
71 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
76 <FOREIGN-KEYS
></FOREIGN-KEYS
>
78 **************************
79 * Set attributes related to FOREIGN
KEYS
81 RUN set-attribute-list
(
85 /* Tell the ADM to use the OPEN-QUERY-CASES.
*/
86 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
87 /**************************
89 /* _UIB-CODE-BLOCK-END
*/
92 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
93 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
101 ************************
102 * Set attributes related to SORTBY-OPTIONS
*/
103 RUN set-attribute-list
(
104 'SortBy-Options
= ""'
:U
).
105 /************************
108 </FILTER-ATTRIBUTES
> */
110 /* _UIB-CODE-BLOCK-END
*/
114 /* *********************** Control Definitions
********************** */
117 /* Definitions of the field level widgets
*/
118 /* Query definitions
*/
120 DEFINE QUERY br_table
FOR
121 PropForecastType
SCROLLING.
124 /* Browse definitions
*/
125 DEFINE BROWSE br_table
126 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
127 QUERY br_table
NO-LOCK DISPLAY
128 PropForecastType.PropForecastType
COLUMN-LABEL "Type"
129 PropForecastType.Description
131 PropForecastType.PropForecastType
132 PropForecastType.Description
133 /* _UIB-CODE-BLOCK-END
*/
135 WITH NO-ASSIGN NO-ROW-MARKERS SEPARATORS SIZE 52.57 BY 9.4
139 /* ************************ Frame Definitions
*********************** */
142 br_table
AT ROW 1 COL 1
143 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
144 SIDE-LABELS NO-UNDERLINE THREE-D
145 AT COL 1 ROW 1 SCROLLABLE
146 BGCOLOR 8 FGCOLOR 0 .
149 /* *********************** Procedure Settings
************************ */
151 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
152 /* Settings for
THIS-PROCEDURE
156 Add Fields to
: EXTERNAL-TABLES
157 Other Settings
: PERSISTENT-ONLY
COMPILE
160 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
161 /* then cleanup and return.
*/
162 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
163 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
164 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
168 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
170 /* ************************* Create Window
************************** */
172 &ANALYZE-SUSPEND _CREATE-WINDOW
173 /* DESIGN Window definition
(used by the UIB
)
174 CREATE WINDOW B-table-Win
ASSIGN
177 /* END WINDOW DEFINITION
*/
182 /* *************** Runtime Attributes and UIB Settings
************** */
184 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
185 /* SETTINGS
FOR WINDOW B-table-Win
186 NOT-VISIBLE
,,RUN-PERSISTENT
*/
187 /* SETTINGS
FOR FRAME F-Main
188 NOT-VISIBLE Size-to-Fit
*/
189 /* BROWSE-TAB br_table
1 F-Main
*/
191 FRAME F-Main
:SCROLLABLE = FALSE
192 FRAME F-Main
:HIDDEN = TRUE.
194 /* _RUN-TIME-ATTRIBUTES-END
*/
198 /* Setting information for Queries and Browse Widgets fields
*/
200 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
201 /* Query rebuild information for
BROWSE br_table
202 _TblList
= "TTPL.PropForecastType"
203 _Options
= "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
204 _FldNameList
[1] > TTPL.PropForecastType.PropForecastType
205 "PropForecastType" "Type" ?
"character" ? ? ? ? ? ? yes ?
206 _FldNameList
[2] > TTPL.PropForecastType.Description
207 "Description" ? ?
"character" ? ? ? ? ? ? yes ?
209 */ /* BROWSE br_table
*/
212 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
213 /* Query rebuild information for
FRAME F-Main
216 */ /* FRAME F-Main
*/
222 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
223 /* ************************* Included-Libraries
*********************** */
225 {src
/adm
/method
/browser.i
}
226 {inc
/method
/m-drlvwr.i
}
228 /* _UIB-CODE-BLOCK-END
*/
234 /* ************************ Control Triggers
************************ */
236 &Scoped-define BROWSE-NAME br_table
237 &Scoped-define SELF-NAME br_table
238 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
239 ON ROW-ENTRY
OF br_table
IN FRAME F-Main
241 /* This code displays initial values for newly added or copied rows.
*/
242 {src
/adm
/template
/brsentry.i
}
245 /* _UIB-CODE-BLOCK-END
*/
249 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
250 ON ROW-LEAVE
OF br_table
IN FRAME F-Main
252 /* Do not disable this code or no updates will take place except
253 by pressing the Save button on an Update SmartPanel.
*/
254 {src
/adm
/template
/brsleave.i
}
257 /* _UIB-CODE-BLOCK-END
*/
263 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
266 /* *************************** Main Block
*************************** */
268 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
269 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
272 /* _UIB-CODE-BLOCK-END
*/
276 /* ********************** Internal Procedures
*********************** */
278 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
279 PROCEDURE adm-open-query-cases
:
280 /*------------------------------------------------------------------------------
281 Purpose
: Opens different cases of the query based on attributes
282 such as the 'Key-Name'
, or 'SortBy-Case'
284 ------------------------------------------------------------------------------*/
286 /* No Foreign keys are accepted by this SmartObject.
*/
288 {&OPEN-QUERY-{&BROWSE-NAME}}
292 /* _UIB-CODE-BLOCK-END
*/
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
297 PROCEDURE adm-row-available
:
298 /*------------------------------------------------------------------------------
299 Purpose
: Dispatched to this procedure when the Record-
300 Source has a new row available. This procedure
301 tries to get the new row
(or foriegn keys
) from
302 the Record-Source and process it.
304 ------------------------------------------------------------------------------*/
306 /* Define variables needed by this internal procedure.
*/
307 {src
/adm
/template
/row-head.i
}
309 /* Process the newly available records
(i.e. display fields
,
310 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
311 {src
/adm
/template
/row-end.i
}
315 /* _UIB-CODE-BLOCK-END
*/
319 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
320 PROCEDURE disable_UI
:
321 /*------------------------------------------------------------------------------
322 Purpose
: DISABLE the User Interface
324 Notes
: Here we clean-up the user-interface by deleting
325 dynamic widgets we have created and
/or hide
326 frames. This procedure is usually called when
327 we are ready to
"clean-up" after running.
328 ------------------------------------------------------------------------------*/
329 /* Hide all frames.
*/
331 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
334 /* _UIB-CODE-BLOCK-END
*/
338 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
340 /*------------------------------------------------------------------------------
341 Purpose
: Sends a requested
KEY value back to the calling
343 Parameters
: <see adm
/template
/sndkytop.i
>
344 ------------------------------------------------------------------------------*/
346 /* There are no foreign keys supplied by this SmartObject.
*/
350 /* _UIB-CODE-BLOCK-END
*/
354 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
355 PROCEDURE send-records
:
356 /*------------------------------------------------------------------------------
357 Purpose
: Send record
ROWID's for all tables used by
359 Parameters
: see template
/snd-head.i
360 ------------------------------------------------------------------------------*/
362 /* Define variables needed by this internal procedure.
*/
363 {src
/adm
/template
/snd-head.i
}
365 /* For each requested table
, put it's
ROWID in the output list.
*/
366 {src
/adm
/template
/snd-list.i
"PropForecastType"}
368 /* Deal with any unexpected table requests before closing.
*/
369 {src
/adm
/template
/snd-end.i
}
373 /* _UIB-CODE-BLOCK-END
*/
377 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
378 PROCEDURE state-changed
:
379 /* -----------------------------------------------------------
383 -------------------------------------------------------------*/
384 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
385 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
388 /* Object instance CASEs can go here to replace standard behavior
390 {src
/adm
/template
/bstates.i
}
394 /* _UIB-CODE-BLOCK-END
*/