d-einlesen-wert.w 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
  2. &ANALYZE-RESUME
  3. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  4. &Scoped-define FRAME-NAME D-Dialog
  5. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS D-Dialog
  6. /*------------------------------------------------------------------------
  7. File:
  8. Description: from cntnrdlg.w - ADM SmartDialog Template
  9. Input Parameters:
  10. <none>
  11. Output Parameters:
  12. <none>
  13. Author:
  14. Created:
  15. ------------------------------------------------------------------------*/
  16. /* This .W file was created with the Progress UIB. */
  17. /*----------------------------------------------------------------------*/
  18. /* Create an unnamed pool to store all the widgets created
  19. by this procedure. This is a good default which assures
  20. that this procedure's triggers and internal procedures
  21. will execute in this procedure's storage, and that proper
  22. cleanup will occur on deletion of the procedure. */
  23. CREATE WIDGET-POOL.
  24. /* *************************** Definitions ************************** */
  25. /* Parameters Definitions --- */
  26. /* Local Variable Definitions --- */
  27. DEF VAR VTitel AS CHAR.
  28. DEF VAR VArt AS INT.
  29. DEF VAR VFormat AS CHAR.
  30. DEF VAR VLabel AS CHAR.
  31. /* ---------- Globale Variablen ---------------------------------- */
  32. { v8/globvar.i" " " " "SHARED" }
  33. { v8/debivar.i " " " " "SHARED" }
  34. { v8/artivar.i " " " " "SHARED" }
  35. { v8/contvar.i " " " " "SHARED" }
  36. /* _UIB-CODE-BLOCK-END */
  37. &ANALYZE-RESUME
  38. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  39. /* ******************** Preprocessor Definitions ******************** */
  40. &Scoped-define PROCEDURE-TYPE SmartDialog
  41. &Scoped-define DB-AWARE no
  42. &Scoped-define ADM-CONTAINER DIALOG-BOX
  43. /* Name of first Frame and/or Browse and/or first Query */
  44. &Scoped-define FRAME-NAME D-Dialog
  45. /* Standard List Definitions */
  46. &Scoped-Define ENABLED-OBJECTS Btn_OK Btn_Cancel
  47. /* Custom List Definitions */
  48. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  49. &Scoped-define List-1 F_Zeichen F_Datum F_Nummer F_Decimal
  50. /* _UIB-PREPROCESSOR-BLOCK-END */
  51. &ANALYZE-RESUME
  52. /* *********************** Control Definitions ********************** */
  53. /* Define a dialog box */
  54. /* Definitions of the field level widgets */
  55. DEFINE BUTTON Btn_Cancel AUTO-END-KEY
  56. LABEL "&Abbrechen"
  57. SIZE 15 BY 1
  58. BGCOLOR 8 .
  59. DEFINE BUTTON Btn_OK AUTO-GO
  60. LABEL "&OK"
  61. SIZE 15 BY 1
  62. BGCOLOR 8 .
  63. DEFINE VARIABLE F_Datum AS DATE FORMAT "99.99.9999":U
  64. LABEL "Fill 3"
  65. VIEW-AS FILL-IN NATIVE
  66. SIZE 14 BY .81
  67. BGCOLOR 15 NO-UNDO.
  68. DEFINE VARIABLE F_Decimal AS DECIMAL FORMAT "zzz,zz9.9999-":U INITIAL 0
  69. LABEL "Fill 4"
  70. VIEW-AS FILL-IN NATIVE
  71. SIZE 14 BY .81
  72. BGCOLOR 15 NO-UNDO.
  73. DEFINE VARIABLE F_Nummer AS INTEGER FORMAT "9999999":U INITIAL 0
  74. LABEL "Fill 1"
  75. VIEW-AS FILL-IN NATIVE
  76. SIZE 8.6 BY .81
  77. BGCOLOR 15 NO-UNDO.
  78. DEFINE VARIABLE F_Zeichen AS CHARACTER FORMAT "X(256)":U
  79. LABEL "Fill 2"
  80. VIEW-AS FILL-IN NATIVE
  81. SIZE 14 BY .81
  82. BGCOLOR 15 NO-UNDO.
  83. /* ************************ Frame Definitions *********************** */
  84. DEFINE FRAME D-Dialog
  85. F_Zeichen AT ROW 1.24 COL 34.2 COLON-ALIGNED
  86. F_Datum AT ROW 1.62 COL 44.8 COLON-ALIGNED
  87. F_Nummer AT ROW 1.91 COL 28.6 RIGHT-ALIGNED
  88. F_Decimal AT ROW 2.52 COL 31.2 COLON-ALIGNED
  89. Btn_OK AT ROW 3.19 COL 10.4
  90. Btn_Cancel AT ROW 3.19 COL 35
  91. SPACE(15.13) SKIP(0.49)
  92. WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
  93. SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
  94. TITLE "Einlesen Wert"
  95. DEFAULT-BUTTON Btn_OK CANCEL-BUTTON Btn_Cancel.
  96. /* *********************** Procedure Settings ************************ */
  97. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  98. /* Settings for THIS-PROCEDURE
  99. Type: SmartDialog
  100. Allow: Basic,Browse,DB-Fields,Query,Smart
  101. Other Settings: COMPILE
  102. */
  103. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  104. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB D-Dialog
  105. /* ************************* Included-Libraries *********************** */
  106. {src/adm/method/containr.i}
  107. /* _UIB-CODE-BLOCK-END */
  108. &ANALYZE-RESUME
  109. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  110. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  111. /* SETTINGS FOR DIALOG-BOX D-Dialog
  112. */
  113. ASSIGN
  114. FRAME D-Dialog:SCROLLABLE = FALSE
  115. FRAME D-Dialog:HIDDEN = TRUE.
  116. /* SETTINGS FOR FILL-IN F_Datum IN FRAME D-Dialog
  117. NO-DISPLAY NO-ENABLE 1 */
  118. ASSIGN
  119. F_Datum:HIDDEN IN FRAME D-Dialog = TRUE.
  120. /* SETTINGS FOR FILL-IN F_Decimal IN FRAME D-Dialog
  121. NO-DISPLAY NO-ENABLE 1 */
  122. ASSIGN
  123. F_Decimal:HIDDEN IN FRAME D-Dialog = TRUE.
  124. /* SETTINGS FOR FILL-IN F_Nummer IN FRAME D-Dialog
  125. NO-DISPLAY NO-ENABLE ALIGN-R 1 */
  126. ASSIGN
  127. F_Nummer:HIDDEN IN FRAME D-Dialog = TRUE
  128. F_Nummer:MOVABLE IN FRAME D-Dialog = TRUE.
  129. /* SETTINGS FOR FILL-IN F_Zeichen IN FRAME D-Dialog
  130. NO-DISPLAY NO-ENABLE 1 */
  131. ASSIGN
  132. F_Zeichen:HIDDEN IN FRAME D-Dialog = TRUE.
  133. /* _RUN-TIME-ATTRIBUTES-END */
  134. &ANALYZE-RESUME
  135. /* Setting information for Queries and Browse Widgets fields */
  136. &ANALYZE-SUSPEND _QUERY-BLOCK DIALOG-BOX D-Dialog
  137. /* Query rebuild information for DIALOG-BOX D-Dialog
  138. _Options = "SHARE-LOCK"
  139. _Query is NOT OPENED
  140. */ /* DIALOG-BOX D-Dialog */
  141. &ANALYZE-RESUME
  142. /* ************************ Control Triggers ************************ */
  143. &Scoped-define SELF-NAME D-Dialog
  144. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog
  145. ON WINDOW-CLOSE OF FRAME D-Dialog /* Einlesen Wert */
  146. DO:
  147. /* Add Trigger to equate WINDOW-CLOSE to END-ERROR. */
  148. APPLY "END-ERROR":U TO SELF.
  149. END.
  150. /* _UIB-CODE-BLOCK-END */
  151. &ANALYZE-RESUME
  152. &Scoped-define SELF-NAME Btn_OK
  153. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK D-Dialog
  154. ON CHOOSE OF Btn_OK IN FRAME D-Dialog /* OK */
  155. DO:
  156. DO WITH FRAME {&FRAME-NAME}:
  157. ERROR-STATUS:ERROR = FALSE.
  158. CASE VArt:
  159. WHEN 1 THEN DO:
  160. F_Nummer = INTEGER(F_Nummer:SCREEN-VALUE) NO-ERROR.
  161. IF ERROR-STATUS:ERROR THEN Linktext = ?.
  162. ELSE Linktext = STRING(F_Nummer,VFormat).
  163. END.
  164. WHEN 2 THEN DO:
  165. F_Decimal = DECIMAL(F_Decimal:SCREEN-VALUE) NO-ERROR.
  166. IF ERROR-STATUS:ERROR THEN Linktext = ?.
  167. ELSE Linktext = STRING(F_Decimal,VFormat).
  168. END.
  169. WHEN 3 THEN DO:
  170. F_Datum = DATE(F_Datum:SCREEN-VALUE) NO-ERROR.
  171. IF ERROR-STATUS:ERROR OR
  172. F_Datum = ? THEN Linktext = ?.
  173. ELSE Linktext = STRING(F_Datum,VFormat).
  174. END.
  175. WHEN 4 THEN DO:
  176. F_Zeichen = F_Zeichen:SCREEN-VALUE NO-ERROR.
  177. IF ERROR-STATUS:ERROR THEN Linktext = ?.
  178. ELSE Linktext = STRING(F_Zeichen,VFormat).
  179. END.
  180. END.
  181. END.
  182. END.
  183. /* _UIB-CODE-BLOCK-END */
  184. &ANALYZE-RESUME
  185. &UNDEFINE SELF-NAME
  186. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK D-Dialog
  187. /* *************************** Main Block *************************** */
  188. /* Linktext: Vorgabe;Titel der Box;Label des Feldes;Format des Feldes;Art */
  189. /* Art = 1: INTEGER */
  190. /* 2: DECIMAL */
  191. /* 3: DATUM */
  192. /* 4: CHARACTER */
  193. DEF VAR VInhalt AS CHAR NO-UNDO.
  194. DEF VAR VAnzahl AS INT NO-UNDO.
  195. DEF VAR VPixels AS INT NO-UNDO.
  196. DEF VAR XH AS HANDLE NO-UNDO.
  197. DEF VAR VKA AS INT NO-UNDO.
  198. DEF VAR VKZ AS INT NO-UNDO.
  199. DEF VAR VLaenge AS INT NO-UNDO.
  200. VAnzahl = NUM-ENTRIES(Linktext, ";").
  201. VTitel = ''.
  202. VLabel = ''.
  203. VFormat = ''.
  204. VArt = 0.
  205. VInhalt = ENTRY(2, Linktext, ';').
  206. VTitel = VInhalt.
  207. VInhalt = ENTRY(3, Linktext, ';').
  208. VLabel = VInhalt.
  209. VInhalt = ENTRY(4, Linktext, ';').
  210. VFormat = VInhalt.
  211. VInhalt = ENTRY(5, Linktext, ';').
  212. VArt = INTEGER(VInhalt).
  213. VLaenge = LENGTH(VFormat).
  214. VKA = INDEX (VFormat, '(').
  215. VKZ = INDEX (VFormat, ')').
  216. IF VKA > 0 THEN DO:
  217. VKA = VKA + 1.
  218. VInhalt = SUBSTRING(VFormat,VKA,VKZ - VKA).
  219. VLaenge = VLaenge + INTEGER(VInhalt) - 2 - VKZ + VKA.
  220. END.
  221. VPixels = LENGTH(VFormat) * 9.5.
  222. FRAME {&FRAME-NAME}:TITLE = VTitel.
  223. DO WITH FRAME {&FRAME-NAME}:
  224. CASE VArt:
  225. WHEN 1 THEN DO:
  226. F_Nummer:X = 190.
  227. F_Nummer:Y = 25.
  228. F_Nummer:WIDTH-PIXELS = VPixels.
  229. F_Nummer:FORMAT = VFormat.
  230. F_Nummer:LABEL = VLabel.
  231. F_Nummer:HIDDEN = FALSE.
  232. F_Nummer:SENSITIVE = TRUE.
  233. XH = F_Nummer:SIDE-LABEL-HANDLE IN FRAME {&FRAME-NAME}.
  234. XH:X = 190 - (LENGTH(VLabel) * 9.5).
  235. XH:Y = 20.
  236. VInhalt = ENTRY(1, Linktext, ';').
  237. F_Nummer = INTEGER(VInhalt).
  238. DISPLAY F_Nummer.
  239. END.
  240. WHEN 2 THEN DO:
  241. F_Decimal:X = 190.
  242. F_Decimal:Y = 25.
  243. F_Decimal:WIDTH-PIXELS = VPixels.
  244. F_Decimal:FORMAT = VFormat.
  245. F_Decimal:LABEL = VLabel.
  246. F_Decimal:HIDDEN = FALSE.
  247. F_Decimal:SENSITIVE = TRUE.
  248. XH = F_Decimal:SIDE-LABEL-HANDLE IN FRAME {&FRAME-NAME}.
  249. XH:X = 190 - (LENGTH(VLabel) * 9.5).
  250. XH:Y = 20.
  251. VInhalt = ENTRY(1, Linktext, ';').
  252. F_Decimal = DECIMAL(VInhalt).
  253. DISPLAY F_Decimal.
  254. END.
  255. WHEN 3 THEN DO:
  256. F_Datum:X = 190.
  257. F_Datum:Y = 25.
  258. F_Datum:WIDTH-PIXELS = VPixels.
  259. F_Datum:FORMAT = VFormat.
  260. F_Datum:LABEL = VLabel.
  261. F_Datum:HIDDEN = FALSE.
  262. F_Datum:SENSITIVE = TRUE.
  263. XH = F_Datum:SIDE-LABEL-HANDLE IN FRAME {&FRAME-NAME}.
  264. XH:X = 190 - (LENGTH(VLabel) * 7).
  265. XH:Y = 20.
  266. VInhalt = ENTRY(1, Linktext, ';').
  267. IF VInhalt = '?' THEN F_Datum = ?.
  268. ELSE F_Datum = DATE(INTEGER(SUBSTRING(VInhalt,04,02)),
  269. INTEGER(SUBSTRING(VInhalt,01,02)),
  270. INTEGER(SUBSTRING(VInhalt,07,04))).
  271. DISPLAY F_Datum.
  272. END.
  273. WHEN 4 THEN DO:
  274. F_Zeichen:X = 190.
  275. F_Zeichen:Y = 25.
  276. F_Zeichen:WIDTH-PIXELS = VPixels.
  277. F_Zeichen:FORMAT = VFormat.
  278. F_Zeichen:LABEL = VLabel.
  279. F_Zeichen:HIDDEN = FALSE.
  280. F_Zeichen:SENSITIVE = TRUE.
  281. XH = F_Zeichen:SIDE-LABEL-HANDLE IN FRAME {&FRAME-NAME}.
  282. XH:X = 190 - (LENGTH(VLabel) * 9.5).
  283. XH:Y = 20.
  284. VInhalt = ENTRY(1, Linktext, ';').
  285. F_Zeichen = VInhalt.
  286. DISPLAY F_Zeichen.
  287. END.
  288. END CASE.
  289. Linktext = ''.
  290. END.
  291. {src/adm/template/dialogmn.i}
  292. /* _UIB-CODE-BLOCK-END */
  293. &ANALYZE-RESUME
  294. /* ********************** Internal Procedures *********************** */
  295. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects D-Dialog _ADM-CREATE-OBJECTS
  296. PROCEDURE adm-create-objects :
  297. /*------------------------------------------------------------------------------
  298. Purpose: Create handles for all SmartObjects used in this procedure.
  299. After SmartObjects are initialized, then SmartLinks are added.
  300. Parameters: <none>
  301. ------------------------------------------------------------------------------*/
  302. END PROCEDURE.
  303. /* _UIB-CODE-BLOCK-END */
  304. &ANALYZE-RESUME
  305. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available D-Dialog _ADM-ROW-AVAILABLE
  306. PROCEDURE adm-row-available :
  307. /*------------------------------------------------------------------------------
  308. Purpose: Dispatched to this procedure when the Record-
  309. Source has a new row available. This procedure
  310. tries to get the new row (or foriegn keys) from
  311. the Record-Source and process it.
  312. Parameters: <none>
  313. ------------------------------------------------------------------------------*/
  314. /* Define variables needed by this internal procedure. */
  315. {src/adm/template/row-head.i}
  316. /* Process the newly available records (i.e. display fields,
  317. open queries, and/or pass records on to any RECORD-TARGETS). */
  318. {src/adm/template/row-end.i}
  319. END PROCEDURE.
  320. /* _UIB-CODE-BLOCK-END */
  321. &ANALYZE-RESUME
  322. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE
  323. PROCEDURE disable_UI :
  324. /*------------------------------------------------------------------------------
  325. Purpose: DISABLE the User Interface
  326. Parameters: <none>
  327. Notes: Here we clean-up the user-interface by deleting
  328. dynamic widgets we have created and/or hide
  329. frames. This procedure is usually called when
  330. we are ready to "clean-up" after running.
  331. ------------------------------------------------------------------------------*/
  332. /* Hide all frames. */
  333. HIDE FRAME D-Dialog.
  334. END PROCEDURE.
  335. /* _UIB-CODE-BLOCK-END */
  336. &ANALYZE-RESUME
  337. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE
  338. PROCEDURE enable_UI :
  339. /*------------------------------------------------------------------------------
  340. Purpose: ENABLE the User Interface
  341. Parameters: <none>
  342. Notes: Here we display/view/enable the widgets in the
  343. user-interface. In addition, OPEN all queries
  344. associated with each FRAME and BROWSE.
  345. These statements here are based on the "Other
  346. Settings" section of the widget Property Sheets.
  347. ------------------------------------------------------------------------------*/
  348. ENABLE Btn_OK Btn_Cancel
  349. WITH FRAME D-Dialog.
  350. VIEW FRAME D-Dialog.
  351. {&OPEN-BROWSERS-IN-QUERY-D-Dialog}
  352. END PROCEDURE.
  353. /* _UIB-CODE-BLOCK-END */
  354. &ANALYZE-RESUME
  355. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-initialize D-Dialog
  356. PROCEDURE local-initialize :
  357. /*------------------------------------------------------------------------------
  358. Purpose: Override standard ADM method
  359. Notes:
  360. ------------------------------------------------------------------------------*/
  361. RUN dispatch IN THIS-PROCEDURE ( INPUT 'initialize':U ) .
  362. END PROCEDURE.
  363. /* _UIB-CODE-BLOCK-END */
  364. &ANALYZE-RESUME
  365. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records D-Dialog _ADM-SEND-RECORDS
  366. PROCEDURE send-records :
  367. /*------------------------------------------------------------------------------
  368. Purpose: Send record ROWID's for all tables used by
  369. this file.
  370. Parameters: see template/snd-head.i
  371. ------------------------------------------------------------------------------*/
  372. /* SEND-RECORDS does nothing because there are no External
  373. Tables specified for this SmartDialog, and there are no
  374. tables specified in any contained Browse, Query, or Frame. */
  375. END PROCEDURE.
  376. /* _UIB-CODE-BLOCK-END */
  377. &ANALYZE-RESUME
  378. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog
  379. PROCEDURE state-changed :
  380. /* -----------------------------------------------------------
  381. Purpose:
  382. Parameters: <none>
  383. Notes:
  384. -------------------------------------------------------------*/
  385. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  386. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  387. END PROCEDURE.
  388. /* _UIB-CODE-BLOCK-END */
  389. &ANALYZE-RESUME