Really, this should be it, for the passing income.
[capital-apms-progress.git] / win / d-seldb.w
blob4a798d5271fd413b7e37695c0001c4b427af3d35
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 &Scoped-define WINDOW-NAME CURRENT-WINDOW
4 &Scoped-define FRAME-NAME Dialog-Frame
5 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Dialog-Frame
6 /*------------------------------------------------------------------------
7 File: win/d-seldb.w
8 Description: Select the database to use
9 Input Parameters: CHAR select-from
10 Output Parameters: CHAR chosen
11 Author: Andrew McMillan
12 Created: 22/1/1998
13 ------------------------------------------------------------------------*/
15 DEF INPUT PARAMETER select-from AS CHAR NO-UNDO.
16 DEF INPUT-OUTPUT PARAMETER chosen AS CHAR NO-UNDO.
18 /* _UIB-CODE-BLOCK-END */
19 &ANALYZE-RESUME
22 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
24 /* ******************** Preprocessor Definitions ******************** */
26 &Scoped-define PROCEDURE-TYPE DIALOG-BOX
28 /* Name of first Frame and/or Browse and/or first Query */
29 &Scoped-define FRAME-NAME Dialog-Frame
31 /* Standard List Definitions */
32 &Scoped-Define ENABLED-OBJECTS cmb_Database Btn_OK Btn_Cancel Btn_Help
33 &Scoped-Define DISPLAYED-OBJECTS cmb_Database
35 /* Custom List Definitions */
36 /* List-1,List-2,List-3,List-4,List-5,List-6 */
38 /* _UIB-PREPROCESSOR-BLOCK-END */
39 &ANALYZE-RESUME
43 /* *********************** Control Definitions ********************** */
45 /* Define a dialog box */
47 /* Definitions of the field level widgets */
48 DEFINE BUTTON Btn_Cancel AUTO-END-KEY
49 LABEL "Cancel"
50 SIZE 15 BY 1.15
51 BGCOLOR 8 .
53 DEFINE BUTTON Btn_Help
54 LABEL "&Help"
55 SIZE 15 BY 1.15
56 BGCOLOR 8 .
58 DEFINE BUTTON Btn_OK AUTO-GO
59 LABEL "OK"
60 SIZE 15 BY 1.15
61 BGCOLOR 8 .
63 DEFINE VARIABLE cmb_Database AS CHARACTER FORMAT "X(256)":U
64 LABEL "Database"
65 VIEW-AS COMBO-BOX INNER-LINES 10
66 LIST-ITEMS "Item 1"
67 SIZE 54.29 BY 1.05 NO-UNDO.
70 /* ************************ Frame Definitions *********************** */
72 DEFINE FRAME Dialog-Frame
73 cmb_Database AT ROW 1.6 COL 1.57
74 Btn_OK AT ROW 5 COL 1.57
75 Btn_Cancel AT ROW 5 COL 17.57
76 Btn_Help AT ROW 5 COL 48.43
77 SPACE(1.70) SKIP(1.99)
78 WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
79 SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
80 FONT 10
81 TITLE "Select Database"
82 DEFAULT-BUTTON Btn_OK CANCEL-BUTTON Btn_Cancel.
85 /* *********************** Procedure Settings ************************ */
87 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
88 /* Settings for THIS-PROCEDURE
89 Type: DIALOG-BOX
90 Allow: Basic,Browse,DB-Fields,Query
91 Other Settings: COMPILE
93 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
96 /* *************** Runtime Attributes and UIB Settings ************** */
98 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
99 /* SETTINGS FOR DIALOG-BOX Dialog-Frame
101 ASSIGN
102 FRAME Dialog-Frame:SCROLLABLE = FALSE
103 FRAME Dialog-Frame:HIDDEN = TRUE.
105 /* SETTINGS FOR COMBO-BOX cmb_Database IN FRAME Dialog-Frame
106 ALIGN-L */
107 /* _RUN-TIME-ATTRIBUTES-END */
108 &ANALYZE-RESUME
115 /* ************************ Control Triggers ************************ */
117 &Scoped-define SELF-NAME Dialog-Frame
118 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Dialog-Frame Dialog-Frame
119 ON WINDOW-CLOSE OF FRAME Dialog-Frame /* Select Database */
121 APPLY "END-ERROR":U TO SELF.
122 END.
124 /* _UIB-CODE-BLOCK-END */
125 &ANALYZE-RESUME
128 &Scoped-define SELF-NAME Btn_Cancel
129 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Cancel Dialog-Frame
130 ON CHOOSE OF Btn_Cancel IN FRAME Dialog-Frame /* Cancel */
132 chosen = "CANCEL".
133 END.
135 /* _UIB-CODE-BLOCK-END */
136 &ANALYZE-RESUME
139 &Scoped-define SELF-NAME Btn_Help
140 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Help Dialog-Frame
141 ON CHOOSE OF Btn_Help IN FRAME Dialog-Frame /* Help */
142 OR HELP OF FRAME {&FRAME-NAME}
143 DO: /* Call Help Function (or a simple message). */
144 MESSAGE "Select the database you wish to access" SKIP
145 "and click on the OK button."
146 VIEW-AS ALERT-BOX INFORMATION.
147 END.
149 /* _UIB-CODE-BLOCK-END */
150 &ANALYZE-RESUME
153 &Scoped-define SELF-NAME Btn_OK
154 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK Dialog-Frame
155 ON CHOOSE OF Btn_OK IN FRAME Dialog-Frame /* OK */
157 DO WITH FRAME {&FRAME-NAME}:
158 chosen = cmb_Database:SCREEN-VALUE.
159 END.
160 END.
162 /* _UIB-CODE-BLOCK-END */
163 &ANALYZE-RESUME
166 &UNDEFINE SELF-NAME
168 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Dialog-Frame
171 /* *************************** Main Block *************************** */
173 /* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent. */
174 IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT eq ?
175 THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW.
177 DO WITH FRAME {&FRAME-NAME}:
178 cmb_Database:DELIMITER = "~n".
179 cmb_Database:LIST-ITEMS = select-from.
180 cmb_Database:SCREEN-VALUE = chosen.
181 END.
183 /* Now enable the interface and wait for the exit condition. */
184 /* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */
185 MAIN-BLOCK:
186 DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
187 ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
188 RUN enable_UI.
189 WAIT-FOR GO OF FRAME {&FRAME-NAME}.
190 END.
191 RUN disable_UI.
193 /* _UIB-CODE-BLOCK-END */
194 &ANALYZE-RESUME
197 /* ********************** Internal Procedures *********************** */
199 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Dialog-Frame _DEFAULT-DISABLE
200 PROCEDURE disable_UI :
201 /*------------------------------------------------------------------------------
202 Purpose: DISABLE the User Interface
203 Parameters: <none>
204 Notes: Here we clean-up the user-interface by deleting
205 dynamic widgets we have created and/or hide
206 frames. This procedure is usually called when
207 we are ready to "clean-up" after running.
208 ------------------------------------------------------------------------------*/
209 /* Hide all frames. */
210 HIDE FRAME Dialog-Frame.
211 END PROCEDURE.
213 /* _UIB-CODE-BLOCK-END */
214 &ANALYZE-RESUME
217 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Dialog-Frame _DEFAULT-ENABLE
218 PROCEDURE enable_UI :
219 /*------------------------------------------------------------------------------
220 Purpose: ENABLE the User Interface
221 Parameters: <none>
222 Notes: Here we display/view/enable the widgets in the
223 user-interface. In addition, OPEN all queries
224 associated with each FRAME and BROWSE.
225 These statements here are based on the "Other
226 Settings" section of the widget Property Sheets.
227 ------------------------------------------------------------------------------*/
228 DISPLAY cmb_Database
229 WITH FRAME Dialog-Frame.
230 ENABLE cmb_Database Btn_OK Btn_Cancel Btn_Help
231 WITH FRAME Dialog-Frame.
232 VIEW FRAME Dialog-Frame.
233 {&OPEN-BROWSERS-IN-QUERY-Dialog-Frame}
234 END PROCEDURE.
236 /* _UIB-CODE-BLOCK-END */
237 &ANALYZE-RESUME