1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r2 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 DEF VAR ShareHolder
AS CHAR FORMAT "X(30)" LABEL "Share Holder's Name".
40 /* _UIB-CODE-BLOCK-END
*/
44 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
46 /* ******************** Preprocessor Definitions
******************** */
48 &Scoped-define PROCEDURE-TYPE SmartBrowser
50 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
52 /* Name of first Frame and
/or Browse and
/or first Query
*/
53 &Scoped-define FRAME-NAME F-Main
54 &Scoped-define BROWSE-NAME br_table
56 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
57 &Scoped-define INTERNAL-TABLES Contact Person
59 /* Definitions for
BROWSE br_table
*/
60 &Scoped-define FIELDS-IN-QUERY-br_table ~
61 Person.FirstName
+ ' '
+ Person.LastName @ ShareHolder
62 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
63 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
64 &Scoped-define ENABLED-TABLES-IN-QUERY-br_table
65 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH Contact ~
66 WHERE Contact.ContactType
= "SH" NO-LOCK, ~
67 FIRST Person
OF Contact
OUTER-JOIN NO-LOCK.
68 &Scoped-define FIRST-TABLE-IN-QUERY-br_table Contact
69 &Scoped-define TABLES-IN-QUERY-br_table Contact Person
71 /* Definitions for
FRAME F-Main
*/
73 /* Standard List Definitions
*/
74 &Scoped-Define ENABLED-OBJECTS br_table
76 /* Custom List Definitions
*/
77 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
79 /* _UIB-PREPROCESSOR-BLOCK-END
*/
84 /* *********************** Control Definitions
********************** */
87 /* Definitions of the field level widgets
*/
88 /* Query definitions
*/
90 DEFINE QUERY br_table
FOR
95 /* Browse definitions
*/
96 DEFINE BROWSE br_table
97 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
98 QUERY br_table
NO-LOCK DISPLAY
99 Person.FirstName
+ ' '
+ Person.LastName @ ShareHolder
100 /* _UIB-CODE-BLOCK-END
*/
102 WITH NO-ASSIGN SEPARATORS SIZE 39 BY 15.71
106 /* ************************ Frame Definitions
*********************** */
109 br_table
AT ROW 1 COL 1
110 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
111 SIDE-LABELS NO-UNDERLINE THREE-D
112 AT COL 1 ROW 1 SCROLLABLE
113 BGCOLOR 8 FGCOLOR 0 .
117 /* *********************** Procedure Settings
************************ */
119 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
120 /* Settings for
THIS-PROCEDURE
124 Add Fields to
: EXTERNAL-TABLES
125 Other Settings
: PERSISTENT-ONLY
COMPILE
128 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
129 /* then cleanup and return.
*/
130 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
131 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
132 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
136 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
138 /* ************************* Create Window
************************** */
140 &ANALYZE-SUSPEND _CREATE-WINDOW
141 /* DESIGN Window definition
(used by the UIB
)
142 CREATE WINDOW B-table-Win
ASSIGN
149 /* *************** Runtime Attributes and UIB Settings
************** */
151 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
152 /* SETTINGS
FOR WINDOW B-table-Win
153 NOT-VISIBLE
,,RUN-PERSISTENT
*/
154 /* SETTINGS
FOR FRAME F-Main
155 NOT-VISIBLE Size-to-Fit
*/
157 FRAME F-Main
:SCROLLABLE = FALSE
158 FRAME F-Main
:HIDDEN = TRUE.
160 /* _RUN-TIME-ATTRIBUTES-END
*/
164 /* Setting information for Queries and Browse Widgets fields
*/
166 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
167 /* Query rebuild information for
BROWSE br_table
168 _TblList
= "TTPL.Contact,TTPL.Person OF TTPL.Contact"
170 _TblOptList
= ", FIRST OUTER"
171 _Where
[1] = "Contact.ContactType = ""SH"""
172 _FldNameList
[1] > "_<CALC>"
173 "Person.FirstName + ' ' + Person.LastName @ ShareHolder" ? ? ? ? ? ? ? ? ? no ?
175 */ /* BROWSE br_table
*/
178 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
179 /* Query rebuild information for
FRAME F-Main
182 */ /* FRAME F-Main
*/
187 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "SmartBrowserWizard" B-table-Win _INLINE
188 /* Actions
: adm
/support
/_wizard.w ? ? ? adm
/support
/_wizdel.p
*/
189 /* SmartBrowser Wizard
190 Destroy on next read
*/
191 /* _UIB-CODE-BLOCK-END
*/
195 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
196 /* ************************* Included-Libraries
*********************** */
198 {src
/adm
/method
/browser.i
}
199 {inc
/method
/m-selvwr.i
}
201 /* _UIB-CODE-BLOCK-END
*/
207 /* ************************ Control Triggers
************************ */
209 &Scoped-define BROWSE-NAME br_table
210 &Scoped-define SELF-NAME br_table
211 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
212 ON ROW-ENTRY
OF br_table
IN FRAME F-Main
214 /* This code displays initial values for newly added or copied rows.
*/
215 {src
/adm
/template
/brsentry.i
}
218 /* _UIB-CODE-BLOCK-END
*/
222 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
223 ON ROW-LEAVE
OF br_table
IN FRAME F-Main
225 /* Do not disable this code or no updates will take place except
226 by pressing the Save button on an Update SmartPanel.
*/
227 {src
/adm
/template
/brsleave.i
}
230 /* _UIB-CODE-BLOCK-END
*/
234 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
235 ON VALUE-CHANGED
OF br_table
IN FRAME F-Main
237 /* This ADM trigger code must be preserved in order to notify other
238 objects when the browser's current row changes.
*/
239 {src
/adm
/template
/brschnge.i
}
243 /* _UIB-CODE-BLOCK-END
*/
249 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
252 /* *************************** Main Block
*************************** */
254 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
255 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
258 /* _UIB-CODE-BLOCK-END
*/
262 /* ********************** Internal Procedures
*********************** */
264 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
265 PROCEDURE adm-row-available
:
266 /*------------------------------------------------------------------------------
267 Purpose
: Dispatched to this procedure when the record-
268 source has a new row available. This procedure
269 tries to get the new row and display it.
271 ------------------------------------------------------------------------------*/
273 /* ADM-ROW-AVAILABLE does nothing because there are no External
274 Tables specified for this SmartBrowser.
275 (See 'Procedure Settings' dialog to set External Tables.
) */
279 /* _UIB-CODE-BLOCK-END
*/
283 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
284 PROCEDURE disable_UI
:
285 /*------------------------------------------------------------------------------
286 Purpose
: DISABLE the User Interface
288 Notes
: Here we clean-up the user-interface by deleting
289 dynamic widgets we have created and
/or hide
290 frames. This procedure is usually called when
291 we are ready to
"clean-up" after running.
292 ------------------------------------------------------------------------------*/
293 /* Hide all frames.
*/
295 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
298 /* _UIB-CODE-BLOCK-END
*/
302 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
303 PROCEDURE send-records
:
304 /*------------------------------------------------------------------------------
305 Purpose
: Send record
ROWID's for all tables used by
307 Parameters
: see template
/snd-head.i
308 ------------------------------------------------------------------------------*/
310 /* Define variables needed by this internal procedure.
*/
311 {src
/adm
/template
/snd-head.i
}
313 /* For each requested table
, put it's
ROWID in the output list.
*/
314 {src
/adm
/template
/snd-list.i
"Contact"}
315 {src
/adm
/template
/snd-list.i
"Person"}
317 /* Deal with any unexpected table requests before closing.
*/
318 {src
/adm
/template
/snd-end.i
}
322 /* _UIB-CODE-BLOCK-END
*/
326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
327 PROCEDURE state-changed
:
328 /* -----------------------------------------------------------
332 -------------------------------------------------------------*/
333 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
334 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
337 /* Object instance CASEs can go here to replace standard behavior
339 {src
/adm
/template
/bstates.i
}
343 /* _UIB-CODE-BLOCK-END
*/