d-liste.w 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. anadat PROGRESS
  5. */
  6. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  7. &Scoped-define FRAME-NAME D-Dialog
  8. /* Temp-Table and Buffer definitions */
  9. DEFINE SHARED TEMP-TABLE XTermOut NO-UNDO LIKE TermOut.
  10. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS D-Dialog
  11. /*------------------------------------------------------------------------
  12. File:
  13. Description: from cntnrdlg.w - ADM SmartDialog Template
  14. Input Parameters:
  15. <none>
  16. Output Parameters:
  17. <none>
  18. Author:
  19. Created:
  20. ------------------------------------------------------------------------*/
  21. /* This .W file was created with the Progress UIB. */
  22. /*----------------------------------------------------------------------*/
  23. /* Create an unnamed pool to store all the widgets created
  24. by this procedure. This is a good default which assures
  25. that this procedure's triggers and internal procedures
  26. will execute in this procedure's storage, and that proper
  27. cleanup will occur on deletion of the procedure. */
  28. CREATE WIDGET-POOL.
  29. /* *************************** Definitions ************************** */
  30. /* Parameters Definitions --- */
  31. DEF INPUT PARAMETER DialogTitel AS CHAR.
  32. /* Local Variable Definitions --- */
  33. /* _UIB-CODE-BLOCK-END */
  34. &ANALYZE-RESUME
  35. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  36. /* ******************** Preprocessor Definitions ******************** */
  37. &Scoped-define PROCEDURE-TYPE SmartDialog
  38. &Scoped-define DB-AWARE no
  39. &Scoped-define ADM-CONTAINER DIALOG-BOX
  40. /* Name of designated FRAME-NAME and/or first browse and/or first query */
  41. &Scoped-define FRAME-NAME D-Dialog
  42. &Scoped-define BROWSE-NAME Br_Liste
  43. /* Internal Tables (found by Frame, Query & Browse Queries) */
  44. &Scoped-define INTERNAL-TABLES XTermOut
  45. /* Definitions for BROWSE Br_Liste */
  46. &Scoped-define FIELDS-IN-QUERY-Br_Liste XTermOut.Zeile
  47. &Scoped-define ENABLED-FIELDS-IN-QUERY-Br_Liste
  48. &Scoped-define QUERY-STRING-Br_Liste FOR EACH XTermOut NO-LOCK
  49. &Scoped-define OPEN-QUERY-Br_Liste OPEN QUERY Br_Liste FOR EACH XTermOut NO-LOCK.
  50. &Scoped-define TABLES-IN-QUERY-Br_Liste XTermOut
  51. &Scoped-define FIRST-TABLE-IN-QUERY-Br_Liste XTermOut
  52. /* Definitions for DIALOG-BOX D-Dialog */
  53. &Scoped-define OPEN-BROWSERS-IN-QUERY-D-Dialog ~
  54. ~{&OPEN-QUERY-Br_Liste}
  55. /* Standard List Definitions */
  56. &Scoped-Define ENABLED-OBJECTS Br_Liste
  57. /* Custom List Definitions */
  58. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  59. /* _UIB-PREPROCESSOR-BLOCK-END */
  60. &ANALYZE-RESUME
  61. /* *********************** Control Definitions ********************** */
  62. /* Define a dialog box */
  63. /* Definitions of the field level widgets */
  64. /* Query definitions */
  65. &ANALYZE-SUSPEND
  66. DEFINE QUERY Br_Liste FOR
  67. XTermOut SCROLLING.
  68. &ANALYZE-RESUME
  69. /* Browse definitions */
  70. DEFINE BROWSE Br_Liste
  71. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS Br_Liste D-Dialog _STRUCTURED
  72. QUERY Br_Liste DISPLAY
  73. XTermOut.Zeile FORMAT "x(250)":U
  74. /* _UIB-CODE-BLOCK-END */
  75. &ANALYZE-RESUME
  76. WITH NO-LABELS NO-ASSIGN NO-ROW-MARKERS NO-COLUMN-SCROLLING MULTIPLE SIZE 180 BY 21.43
  77. BGCOLOR 15 FONT 14.
  78. /* ************************ Frame Definitions *********************** */
  79. DEFINE FRAME D-Dialog
  80. Br_Liste AT ROW 1.48 COL 3
  81. SPACE(1.99) SKIP(0.41)
  82. WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
  83. SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
  84. TITLE "Listenausgabe".
  85. /* *********************** Procedure Settings ************************ */
  86. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  87. /* Settings for THIS-PROCEDURE
  88. Type: SmartDialog
  89. Allow: Basic,Browse,DB-Fields,Query,Smart
  90. Other Settings: COMPILE
  91. Temp-Tables and Buffers:
  92. TABLE: XTermOut T "SHARED" NO-UNDO AnaDat TermOut
  93. END-TABLES.
  94. */
  95. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  96. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB D-Dialog
  97. /* ************************* Included-Libraries *********************** */
  98. {src/adm/method/containr.i}
  99. /* _UIB-CODE-BLOCK-END */
  100. &ANALYZE-RESUME
  101. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  102. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  103. /* SETTINGS FOR DIALOG-BOX D-Dialog
  104. FRAME-NAME */
  105. /* BROWSE-TAB Br_Liste 1 D-Dialog */
  106. ASSIGN
  107. FRAME D-Dialog:SCROLLABLE = FALSE.
  108. ASSIGN
  109. Br_Liste:SELECTABLE IN FRAME D-Dialog = TRUE.
  110. /* _RUN-TIME-ATTRIBUTES-END */
  111. &ANALYZE-RESUME
  112. /* Setting information for Queries and Browse Widgets fields */
  113. &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE Br_Liste
  114. /* Query rebuild information for BROWSE Br_Liste
  115. _TblList = "Temp-Tables.XTermOut"
  116. _FldNameList[1] = Temp-Tables.XTermOut.Zeile
  117. _Query is OPENED
  118. */ /* BROWSE Br_Liste */
  119. &ANALYZE-RESUME
  120. &ANALYZE-SUSPEND _QUERY-BLOCK DIALOG-BOX D-Dialog
  121. /* Query rebuild information for DIALOG-BOX D-Dialog
  122. _Options = "SHARE-LOCK"
  123. _Query is NOT OPENED
  124. */ /* DIALOG-BOX D-Dialog */
  125. &ANALYZE-RESUME
  126. /* ************************ Control Triggers ************************ */
  127. &Scoped-define SELF-NAME D-Dialog
  128. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog
  129. ON ENTRY OF FRAME D-Dialog /* Listenausgabe */
  130. DO:
  131. SELF:TITLE = DialogTitel.
  132. END.
  133. /* _UIB-CODE-BLOCK-END */
  134. &ANALYZE-RESUME
  135. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog
  136. ON WINDOW-CLOSE OF FRAME D-Dialog /* Listenausgabe */
  137. DO:
  138. /* Add Trigger to equate WINDOW-CLOSE to END-ERROR. */
  139. APPLY "END-ERROR":U TO SELF.
  140. END.
  141. /* _UIB-CODE-BLOCK-END */
  142. &ANALYZE-RESUME
  143. &Scoped-define BROWSE-NAME Br_Liste
  144. &Scoped-define SELF-NAME Br_Liste
  145. &Scoped-define SELF-NAME XTermOut.Zeile
  146. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL XTermOut.Zeile Br_Liste _BROWSE-COLUMN D-Dialog
  147. ON RIGHT-MOUSE-CLICK OF BROWSE Br_Liste /* Zeile */
  148. DO:
  149. RUN AUSGABE_IN_LISTE.
  150. RETURN NO-APPLY.
  151. END.
  152. /* _UIB-CODE-BLOCK-END */
  153. &ANALYZE-RESUME
  154. &UNDEFINE SELF-NAME
  155. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK D-Dialog
  156. /* *************************** Main Block *************************** */
  157. {src/adm/template/dialogmn.i}
  158. PROCEDURE ShellExecuteA EXTERNAL "shell32.dll" :
  159. DEFINE INPUT PARAMETER lphwnd AS LONG.
  160. DEFINE INPUT PARAMETER lpOperation AS CHARACTER.
  161. DEFINE INPUT PARAMETER lpFile AS CHARACTER.
  162. DEFINE INPUT PARAMETER lpParameters AS CHARACTER.
  163. DEFINE INPUT PARAMETER lpDirectory AS CHARACTER.
  164. DEFINE INPUT PARAMETER nShowCmd AS LONG.
  165. DEFINE RETURN PARAMETER hInstance AS LONG.
  166. END PROCEDURE.
  167. /* _UIB-CODE-BLOCK-END */
  168. &ANALYZE-RESUME
  169. /* ********************** Internal Procedures *********************** */
  170. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects D-Dialog _ADM-CREATE-OBJECTS
  171. PROCEDURE adm-create-objects :
  172. /*------------------------------------------------------------------------------
  173. Purpose: Create handles for all SmartObjects used in this procedure.
  174. After SmartObjects are initialized, then SmartLinks are added.
  175. Parameters: <none>
  176. ------------------------------------------------------------------------------*/
  177. END PROCEDURE.
  178. /* _UIB-CODE-BLOCK-END */
  179. &ANALYZE-RESUME
  180. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available D-Dialog _ADM-ROW-AVAILABLE
  181. PROCEDURE adm-row-available :
  182. /*------------------------------------------------------------------------------
  183. Purpose: Dispatched to this procedure when the Record-
  184. Source has a new row available. This procedure
  185. tries to get the new row (or foriegn keys) from
  186. the Record-Source and process it.
  187. Parameters: <none>
  188. ------------------------------------------------------------------------------*/
  189. /* Define variables needed by this internal procedure. */
  190. {src/adm/template/row-head.i}
  191. /* Process the newly available records (i.e. display fields,
  192. open queries, and/or pass records on to any RECORD-TARGETS). */
  193. {src/adm/template/row-end.i}
  194. END PROCEDURE.
  195. /* _UIB-CODE-BLOCK-END */
  196. &ANALYZE-RESUME
  197. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE AUSGABE_IN_LISTE D-Dialog
  198. PROCEDURE AUSGABE_IN_LISTE :
  199. /*------------------------------------------------------------------------------
  200. Purpose:
  201. Notes:
  202. ------------------------------------------------------------------------------*/
  203. DEFINE VARIABLE cDateiName AS CHARACTER NO-UNDO.
  204. DEFINE VARIABLE o-i AS INTEGER NO-UNDO.
  205. cDateiName = SUBSTITUTE('&1&2':U, SESSION:TEMP-DIR, 'Liste.csv').
  206. OUTPUT TO value(cDateiName) NO-MAP NO-CONVERT.
  207. FOR EACH XTermOut:
  208. PUT CONTROL XTermOut.Zeile CHR(10).
  209. END.
  210. OUTPUT CLOSE.
  211. RUN shellExecuteA (0,
  212. "open",
  213. cDateiName,
  214. "",
  215. "",
  216. 0,
  217. OUTPUT o-i).
  218. END PROCEDURE.
  219. /* _UIB-CODE-BLOCK-END */
  220. &ANALYZE-RESUME
  221. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE
  222. PROCEDURE disable_UI :
  223. /*------------------------------------------------------------------------------
  224. Purpose: DISABLE the User Interface
  225. Parameters: <none>
  226. Notes: Here we clean-up the user-interface by deleting
  227. dynamic widgets we have created and/or hide
  228. frames. This procedure is usually called when
  229. we are ready to "clean-up" after running.
  230. ------------------------------------------------------------------------------*/
  231. /* Hide all frames. */
  232. HIDE FRAME D-Dialog.
  233. END PROCEDURE.
  234. /* _UIB-CODE-BLOCK-END */
  235. &ANALYZE-RESUME
  236. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE
  237. PROCEDURE enable_UI :
  238. /*------------------------------------------------------------------------------
  239. Purpose: ENABLE the User Interface
  240. Parameters: <none>
  241. Notes: Here we display/view/enable the widgets in the
  242. user-interface. In addition, OPEN all queries
  243. associated with each FRAME and BROWSE.
  244. These statements here are based on the "Other
  245. Settings" section of the widget Property Sheets.
  246. ------------------------------------------------------------------------------*/
  247. ENABLE Br_Liste
  248. WITH FRAME D-Dialog.
  249. {&OPEN-BROWSERS-IN-QUERY-D-Dialog}
  250. END PROCEDURE.
  251. /* _UIB-CODE-BLOCK-END */
  252. &ANALYZE-RESUME
  253. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-apply-entry D-Dialog
  254. PROCEDURE local-apply-entry :
  255. /*------------------------------------------------------------------------------
  256. Purpose: Override standard ADM method
  257. Notes:
  258. ------------------------------------------------------------------------------*/
  259. /* Code placed here will execute PRIOR to standard behavior. */
  260. /* Dispatch standard ADM method. */
  261. RUN dispatch IN THIS-PROCEDURE ( INPUT 'apply-entry':U ) .
  262. /* Code placed here will execute AFTER standard behavior. */
  263. END PROCEDURE.
  264. /* _UIB-CODE-BLOCK-END */
  265. &ANALYZE-RESUME
  266. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records D-Dialog _ADM-SEND-RECORDS
  267. PROCEDURE send-records :
  268. /*------------------------------------------------------------------------------
  269. Purpose: Send record ROWID's for all tables used by
  270. this file.
  271. Parameters: see template/snd-head.i
  272. ------------------------------------------------------------------------------*/
  273. /* Define variables needed by this internal procedure. */
  274. {src/adm/template/snd-head.i}
  275. /* For each requested table, put it's ROWID in the output list. */
  276. {src/adm/template/snd-list.i "XTermOut"}
  277. /* Deal with any unexpected table requests before closing. */
  278. {src/adm/template/snd-end.i}
  279. END PROCEDURE.
  280. /* _UIB-CODE-BLOCK-END */
  281. &ANALYZE-RESUME
  282. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog
  283. PROCEDURE state-changed :
  284. /* -----------------------------------------------------------
  285. Purpose:
  286. Parameters: <none>
  287. Notes:
  288. -------------------------------------------------------------*/
  289. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  290. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  291. END PROCEDURE.
  292. /* _UIB-CODE-BLOCK-END */
  293. &ANALYZE-RESUME