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 Description
: from BROWSER.W
- Basic SmartBrowser Object Template
20 ------------------------------------------------------------------------*/
21 /* This .W file was created with the Progress UIB.
*/
22 /*----------------------------------------------------------------------*/
24 /* Create an unnamed pool to store all the widgets created
25 by this procedure. This is a good default which assures
26 that this procedure's triggers and internal procedures
27 will execute in this procedure's storage
, and that proper
28 cleanup will occur on deletion of the procedure.
*/
32 /* *************************** Definitions
************************** */
34 /* Parameters Definitions
--- */
36 /* Local Variable Definitions
--- */
38 /* _UIB-CODE-BLOCK-END
*/
42 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
44 /* ******************** Preprocessor Definitions
******************** */
46 &Scoped-define PROCEDURE-TYPE SmartBrowser
48 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
50 /* Name of first Frame and
/or Browse and
/or first Query
*/
51 &Scoped-define FRAME-NAME F-Main
52 &Scoped-define BROWSE-NAME br_table
54 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
55 &Scoped-define INTERNAL-TABLES ActivityStatus
57 /* Define KEY-PHRASE in case it is used by any query.
*/
58 &Scoped-define KEY-PHRASE TRUE
60 /* Definitions for
BROWSE br_table
*/
61 &Scoped-define FIELDS-IN-QUERY-br_table ActivityStatus.ActivityStatus ~
62 ActivityStatus.Description
63 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table ~
64 ActivityStatus.ActivityStatus ActivityStatus.Description
65 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table~
66 ~
{&FP1}ActivityStatus ~{&FP2}ActivityStatus ~{&FP3}~
67 ~
{&FP1}Description ~{&FP2}Description ~{&FP3}
68 &Scoped-define ENABLED-TABLES-IN-QUERY-br_table ActivityStatus
69 &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-br_table ActivityStatus
70 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH ActivityStatus WHERE ~{&KEY-PHRASE} NO-LOCK ~
72 &Scoped-define TABLES-IN-QUERY-br_table ActivityStatus
73 &Scoped-define FIRST-TABLE-IN-QUERY-br_table ActivityStatus
76 /* Definitions for
FRAME F-Main
*/
78 /* Standard List Definitions
*/
79 &Scoped-Define ENABLED-OBJECTS br_table
81 /* Custom List Definitions
*/
82 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
84 /* _UIB-PREPROCESSOR-BLOCK-END
*/
88 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
89 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
97 **************************
98 * Set attributes related to FOREIGN
KEYS
100 RUN set-attribute-list
(
102 Keys-Supplied
= ""'
:U
).
103 /**************************
106 /* _UIB-CODE-BLOCK-END
*/
109 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
110 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
118 ************************
119 * Set attributes related to SORTBY-OPTIONS
*/
120 RUN set-attribute-list
(
121 'SortBy-Options
= ""'
:U
).
122 /************************
125 </FILTER-ATTRIBUTES
> */
127 /* _UIB-CODE-BLOCK-END
*/
131 /* *********************** Control Definitions
********************** */
134 /* Definitions of the field level widgets
*/
135 /* Query definitions
*/
137 DEFINE QUERY br_table
FOR
138 ActivityStatus
SCROLLING.
141 /* Browse definitions
*/
142 DEFINE BROWSE br_table
143 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
144 QUERY br_table
NO-LOCK DISPLAY
145 ActivityStatus.ActivityStatus
COLUMN-LABEL "Status"
146 ActivityStatus.Description
148 ActivityStatus.ActivityStatus
149 ActivityStatus.Description
150 /* _UIB-CODE-BLOCK-END
*/
152 WITH NO-ASSIGN SEPARATORS SIZE 46.29 BY 12.8
156 /* ************************ Frame Definitions
*********************** */
159 br_table
AT ROW 1 COL 1
160 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
161 SIDE-LABELS NO-UNDERLINE THREE-D
162 AT COL 1 ROW 1 SCROLLABLE
163 BGCOLOR 8 FGCOLOR 0 .
166 /* *********************** Procedure Settings
************************ */
168 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
169 /* Settings for
THIS-PROCEDURE
173 Add Fields to
: EXTERNAL-TABLES
174 Other Settings
: PERSISTENT-ONLY
COMPILE
177 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
178 /* then cleanup and return.
*/
179 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
180 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
181 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
185 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
187 /* ************************* Create Window
************************** */
189 &ANALYZE-SUSPEND _CREATE-WINDOW
190 /* DESIGN Window definition
(used by the UIB
)
191 CREATE WINDOW B-table-Win
ASSIGN
194 /* END WINDOW DEFINITION
*/
199 /* *************** Runtime Attributes and UIB Settings
************** */
201 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
202 /* SETTINGS
FOR WINDOW B-table-Win
203 NOT-VISIBLE
,,RUN-PERSISTENT
*/
204 /* SETTINGS
FOR FRAME F-Main
205 NOT-VISIBLE Size-to-Fit
*/
206 /* BROWSE-TAB br_table
1 F-Main
*/
208 FRAME F-Main
:SCROLLABLE = FALSE
209 FRAME F-Main
:HIDDEN = TRUE.
211 /* _RUN-TIME-ATTRIBUTES-END
*/
215 /* Setting information for Queries and Browse Widgets fields
*/
217 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
218 /* Query rebuild information for
BROWSE br_table
219 _TblList
= "TTPL.ActivityStatus"
220 _Options
= "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
221 _FldNameList
[1] > TTPL.ActivityStatus.ActivityStatus
222 "ActivityStatus" "Status" ?
"character" ? ? ? ? ? ? yes ?
223 _FldNameList
[2] > TTPL.ActivityStatus.Description
224 "Description" ? ?
"character" ? ? ? ? ? ? yes ?
226 */ /* BROWSE br_table
*/
229 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
230 /* Query rebuild information for
FRAME F-Main
233 */ /* FRAME F-Main
*/
238 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "SmartBrowserCues" B-table-Win _INLINE
239 /* Actions
: adecomm
/_so-cue.w ? adecomm
/_so-cued.p ? adecomm
/_so-cuew.p
*/
240 /* SmartBrowser
,uib
,49266
241 Destroy on next read
*/
242 /* _UIB-CODE-BLOCK-END
*/
246 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
247 /* ************************* Included-Libraries
*********************** */
249 {src
/adm
/method
/browser.i
}
250 {inc
/method
/m-drlvwr.i
}
252 /* _UIB-CODE-BLOCK-END
*/
258 /* ************************ Control Triggers
************************ */
260 &Scoped-define BROWSE-NAME br_table
261 &Scoped-define SELF-NAME br_table
262 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
263 ON ROW-ENTRY
OF br_table
IN FRAME F-Main
265 /* This code displays initial values for newly added or copied rows.
*/
266 {src
/adm
/template
/brsentry.i
}
269 /* _UIB-CODE-BLOCK-END
*/
273 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
274 ON ROW-LEAVE
OF br_table
IN FRAME F-Main
276 /* Do not disable this code or no updates will take place except
277 by pressing the Save button on an Update SmartPanel.
*/
278 {src
/adm
/template
/brsleave.i
}
281 /* _UIB-CODE-BLOCK-END
*/
285 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
286 ON VALUE-CHANGED
OF br_table
IN FRAME F-Main
288 /* This ADM trigger code must be preserved in order to notify other
289 objects when the browser's current row changes.
*/
290 {src
/adm
/template
/brschnge.i
}
293 /* _UIB-CODE-BLOCK-END
*/
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
302 /* *************************** Main Block
*************************** */
304 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
305 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
308 /* _UIB-CODE-BLOCK-END
*/
312 /* ********************** Internal Procedures
*********************** */
314 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
315 PROCEDURE adm-row-available
:
316 /*------------------------------------------------------------------------------
317 Purpose
: Dispatched to this procedure when the Record-
318 Source has a new row available. This procedure
319 tries to get the new row
(or foriegn keys
) from
320 the Record-Source and process it.
322 ------------------------------------------------------------------------------*/
324 /* Define variables needed by this internal procedure.
*/
325 {src
/adm
/template
/row-head.i
}
327 /* Process the newly available records
(i.e. display fields
,
328 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
329 {src
/adm
/template
/row-end.i
}
333 /* _UIB-CODE-BLOCK-END
*/
337 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
338 PROCEDURE disable_UI
:
339 /*------------------------------------------------------------------------------
340 Purpose
: DISABLE the User Interface
342 Notes
: Here we clean-up the user-interface by deleting
343 dynamic widgets we have created and
/or hide
344 frames. This procedure is usually called when
345 we are ready to
"clean-up" after running.
346 ------------------------------------------------------------------------------*/
347 /* Hide all frames.
*/
349 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
352 /* _UIB-CODE-BLOCK-END
*/
356 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
357 PROCEDURE send-records
:
358 /*------------------------------------------------------------------------------
359 Purpose
: Send record
ROWID's for all tables used by
361 Parameters
: see template
/snd-head.i
362 ------------------------------------------------------------------------------*/
364 /* Define variables needed by this internal procedure.
*/
365 {src
/adm
/template
/snd-head.i
}
367 /* For each requested table
, put it's
ROWID in the output list.
*/
368 {src
/adm
/template
/snd-list.i
"ActivityStatus"}
370 /* Deal with any unexpected table requests before closing.
*/
371 {src
/adm
/template
/snd-end.i
}
375 /* _UIB-CODE-BLOCK-END
*/
379 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
380 PROCEDURE state-changed
:
381 /* -----------------------------------------------------------
385 -------------------------------------------------------------*/
386 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
387 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
390 /* Object instance CASEs can go here to replace standard behavior
392 {src
/adm
/template
/bstates.i
}
396 /* _UIB-CODE-BLOCK-END
*/