1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
3 &Scoped-define WINDOW-NAME Win_DefMenu
4 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Win_DefMenu
5 /*------------------------------------------------------------------------
8 ------------------------------------------------------------------------*/
10 /* *************************** Definitions
************************** */
12 /* _UIB-CODE-BLOCK-END
*/
16 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
18 /* ******************** Preprocessor Definitions
******************** */
20 &Scoped-define PROCEDURE-TYPE SmartWindow
22 &Scoped-define ADM-CONTAINER WINDOW
24 /* Name of first Frame and
/or Browse and
/or first Query
*/
25 &Scoped-define FRAME-NAME F-Main-prop
27 /* Custom List Definitions
*/
28 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
30 /* _UIB-PREPROCESSOR-BLOCK-END
*/
35 /* *********************** Control Definitions
********************** */
37 /* Define the widget handle for the window
*/
38 DEFINE VAR Win_DefMenu
AS WIDGET-HANDLE NO-UNDO.
40 /* ************************ Frame Definitions
*********************** */
42 DEFINE FRAME F-Main-prop
43 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
44 SIDE-LABELS NO-UNDERLINE THREE-D
49 /* *********************** Procedure Settings
************************ */
51 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
52 /* Settings for
THIS-PROCEDURE
54 Allow
: Basic
,Browse
,DB-Fields
,Query
,Smart
,Window
55 Other Settings
: COMPILE
57 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
59 /* ************************* Create Window
************************** */
61 &ANALYZE-SUSPEND _CREATE-WINDOW
62 IF SESSION:DISPLAY-TYPE = "GUI":U
THEN
63 CREATE WINDOW Win_DefMenu
ASSIGN
71 VIRTUAL-WIDTH = 142.29
77 PRIVATE-DATA = "w-proper"
81 ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
82 /* END WINDOW DEFINITION
*/
86 /* *************** Runtime Attributes and UIB Settings
************** */
88 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
89 /* SETTINGS
FOR WINDOW Win_DefMenu
90 VISIBLE,,RUN-PERSISTENT
*/
91 /* SETTINGS
FOR FRAME F-Main-prop
93 IF SESSION:DISPLAY-TYPE = "GUI":U
AND VALID-HANDLE(Win_DefMenu
)
94 THEN Win_DefMenu
:HIDDEN = yes.
96 /* _RUN-TIME-ATTRIBUTES-END
*/
102 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Win_DefMenu
103 /* ************************* Included-Libraries
*********************** */
105 {src
/adm
/method
/containr.i
}
106 {inc
/method
/m-mnuwin.i
}
108 /* _UIB-CODE-BLOCK-END
*/
114 /* ************************ Control Triggers
************************ */
116 &Scoped-define SELF-NAME Win_DefMenu
117 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Win_DefMenu Win_DefMenu
118 ON END-ERROR
OF Win_DefMenu
/* Menu Window
*/
119 OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
120 /* This case occurs when the user presses the
"Esc" key.
121 In a persistently run window
, just ignore this. If we did not
, the
122 application would exit.
*/
123 IF THIS-PROCEDURE:PERSISTENT THEN RETURN NO-APPLY.
126 /* _UIB-CODE-BLOCK-END
*/
130 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Win_DefMenu Win_DefMenu
131 ON WINDOW-CLOSE
OF Win_DefMenu
/* Menu Window
*/
133 /* This ADM code must be left here in order for the SmartWindow
134 and its descendents to terminate properly on exit.
*/
135 APPLY "CLOSE":U
TO THIS-PROCEDURE.
139 /* _UIB-CODE-BLOCK-END
*/
145 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Win_DefMenu
148 /* *************************** Main Block
*************************** */
150 /* Include custom Main Block code for SmartWindows.
*/
151 {src
/adm
/template
/windowmn.i
}
153 /* _UIB-CODE-BLOCK-END
*/
157 /* ********************** Internal Procedures
*********************** */
159 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects Win_DefMenu _ADM-CREATE-OBJECTS
160 PROCEDURE adm-create-objects
:
161 /*------------------------------------------------------------------------------
162 Purpose
: Create handles for all SmartObjects used in this procedure.
163 After SmartObjects are initialized
, then SmartLinks are added.
165 ------------------------------------------------------------------------------*/
169 /* _UIB-CODE-BLOCK-END
*/
173 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available Win_DefMenu _ADM-ROW-AVAILABLE
174 PROCEDURE adm-row-available
:
175 /*------------------------------------------------------------------------------
176 Purpose
: Dispatched to this procedure when the Record-
177 Source has a new row available. This procedure
178 tries to get the new row
(or foriegn keys
) from
179 the Record-Source and process it.
181 ------------------------------------------------------------------------------*/
183 /* Define variables needed by this internal procedure.
*/
184 {src
/adm
/template
/row-head.i
}
186 /* Process the newly available records
(i.e. display fields
,
187 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
188 {src
/adm
/template
/row-end.i
}
192 /* _UIB-CODE-BLOCK-END
*/
196 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Win_DefMenu _DEFAULT-DISABLE
197 PROCEDURE disable_UI
:
198 /*------------------------------------------------------------------------------
199 Purpose
: DISABLE the User Interface
201 Notes
: Here we clean-up the user-interface by deleting
202 dynamic widgets we have created and
/or hide
203 frames. This procedure is usually called when
204 we are ready to
"clean-up" after running.
205 ------------------------------------------------------------------------------*/
206 /* Delete the
WINDOW we created
*/
207 IF SESSION:DISPLAY-TYPE = "GUI":U
AND VALID-HANDLE(Win_DefMenu
)
208 THEN DELETE WIDGET Win_DefMenu.
209 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
212 /* _UIB-CODE-BLOCK-END
*/
216 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Win_DefMenu _DEFAULT-ENABLE
217 PROCEDURE enable_UI
:
218 /*------------------------------------------------------------------------------
219 Purpose
: ENABLE the User Interface
221 Notes
: Here we display
/view
/enable the widgets in the
222 user-interface. In addition
, OPEN all queries
223 associated with each
FRAME and
BROWSE.
224 These statements here are based on the
"Other
225 Settings" section of the widget Property Sheets.
226 ------------------------------------------------------------------------------*/
227 VIEW FRAME F-Main-prop
IN WINDOW Win_DefMenu.
228 {&OPEN-BROWSERS-IN-QUERY-F-Main-prop}
232 /* _UIB-CODE-BLOCK-END
*/
236 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-exit Win_DefMenu
237 PROCEDURE local-exit
:
238 /* -----------------------------------------------------------
239 Purpose
: Starts an
"exit" by APPLYing
CLOSE event
, which starts
"destroy".
241 Notes
: If activated
, should
APPLY CLOSE, *not
* dispatch adm-exit.
242 -------------------------------------------------------------*/
243 APPLY "CLOSE":U
TO THIS-PROCEDURE.
249 /* _UIB-CODE-BLOCK-END
*/
253 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records Win_DefMenu _ADM-SEND-RECORDS
254 PROCEDURE send-records
:
255 /*------------------------------------------------------------------------------
256 Purpose
: Send record
ROWID's for all tables used by
258 Parameters
: see template
/snd-head.i
259 ------------------------------------------------------------------------------*/
261 /* SEND-RECORDS does nothing because there are no External
262 Tables specified for this SmartWindow
, and there are no
263 tables specified in any contained Browse
, Query
, or Frame.
*/
267 /* _UIB-CODE-BLOCK-END
*/
271 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed Win_DefMenu
272 PROCEDURE state-changed
:
273 /* -----------------------------------------------------------
277 -------------------------------------------------------------*/
278 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
279 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
282 /* _UIB-CODE-BLOCK-END
*/
286 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE user-layout Win_DefMenu
287 PROCEDURE user-layout
:
288 /*------------------------------------------------------------------------------
289 Purpose
: sub menus stack vertically.
290 ------------------------------------------------------------------------------*/
292 DEF VAR btn-list
AS CHAR NO-UNDO.
294 RUN get-btn-list
IN sys-mgr
( THIS-PROCEDURE, OUTPUT btn-list
).
295 RUN stack
( btn-list
, "btn-group", "L", No
).
299 /* _UIB-CODE-BLOCK-END
*/