b-artlief-lnr.w 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
  8. /*------------------------------------------------------------------------
  9. File:
  10. Description: from BROWSER.W - Basic SmartBrowser Object Template
  11. Input Parameters:
  12. <none>
  13. Output Parameters:
  14. <none>
  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 VText AS CHAR NO-UNDO.
  28. /* ---------- Globale Variablen ---------------------------------- */
  29. { v8/globvar.i" " " " "SHARED" }
  30. { v8/debivar.i " " " " "SHARED" }
  31. { v8/artivar.i " " " " "SHARED" }
  32. { v8/contvar.i " " " " "SHARED" }
  33. /* _UIB-CODE-BLOCK-END */
  34. &ANALYZE-RESUME
  35. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  36. /* ******************** Preprocessor Definitions ******************** */
  37. &Scoped-define PROCEDURE-TYPE SmartBrowser
  38. &Scoped-define DB-AWARE no
  39. &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
  40. /* Name of first Frame and/or Browse and/or first Query */
  41. &Scoped-define FRAME-NAME F-Main
  42. &Scoped-define BROWSE-NAME br_table
  43. /* Internal Tables (found by Frame, Query & Browse Queries) */
  44. &Scoped-define INTERNAL-TABLES ArtLief
  45. /* Definitions for BROWSE br_table */
  46. &Scoped-define FIELDS-IN-QUERY-br_table ArtLief.Artnr ArtLief.Inhalt ~
  47. ArtLief.Jahr VText @ VText ArtLief.S_Artnr ArtLief.S_Bez1 ArtLief.S_Preis
  48. &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
  49. &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH ArtLief ~
  50. WHERE ArtLief.Firma = GVFirma ~
  51. AND ArtLief.Knr = LVLnr NO-LOCK ~
  52. BY ArtLief.Artnr ~
  53. BY ArtLief.Inhalt ~
  54. BY ArtLief.Jahr.
  55. &Scoped-define TABLES-IN-QUERY-br_table ArtLief
  56. &Scoped-define FIRST-TABLE-IN-QUERY-br_table ArtLief
  57. /* Definitions for FRAME F-Main */
  58. &Scoped-define OPEN-BROWSERS-IN-QUERY-F-Main ~
  59. ~{&OPEN-QUERY-br_table}
  60. /* Standard List Definitions */
  61. &Scoped-Define ENABLED-OBJECTS br_table RECT-24
  62. /* Custom List Definitions */
  63. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  64. /* _UIB-PREPROCESSOR-BLOCK-END */
  65. &ANALYZE-RESUME
  66. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
  67. /* Actions: ? adm/support/keyedit.w ? ? ? */
  68. /* STRUCTURED-DATA
  69. <KEY-OBJECT>
  70. &BROWSE-NAME
  71. </KEY-OBJECT>
  72. <FOREIGN-KEYS>
  73. </FOREIGN-KEYS>
  74. <EXECUTING-CODE>
  75. **************************
  76. * Set attributes related to FOREIGN KEYS
  77. */
  78. RUN set-attribute-list (
  79. 'Keys-Accepted = "",
  80. Keys-Supplied = ""':U).
  81. /**************************
  82. </EXECUTING-CODE> */
  83. /* _UIB-CODE-BLOCK-END */
  84. &ANALYZE-RESUME
  85. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
  86. /* Actions: ? adm/support/advqedit.w ? ? ? */
  87. /* STRUCTURED-DATA
  88. <KEY-OBJECT>
  89. &BROWSE-NAME
  90. </KEY-OBJECT>
  91. <SORTBY-OPTIONS>
  92. </SORTBY-OPTIONS>
  93. <SORTBY-RUN-CODE>
  94. ************************
  95. * Set attributes related to SORTBY-OPTIONS */
  96. RUN set-attribute-list (
  97. 'SortBy-Options = ""':U).
  98. /************************
  99. </SORTBY-RUN-CODE>
  100. <FILTER-ATTRIBUTES>
  101. </FILTER-ATTRIBUTES> */
  102. /* _UIB-CODE-BLOCK-END */
  103. &ANALYZE-RESUME
  104. /* *********************** Control Definitions ********************** */
  105. /* Definitions of the field level widgets */
  106. DEFINE RECTANGLE RECT-24
  107. EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
  108. SIZE 120 BY 19.81.
  109. /* Query definitions */
  110. &ANALYZE-SUSPEND
  111. DEFINE QUERY br_table FOR
  112. ArtLief SCROLLING.
  113. &ANALYZE-RESUME
  114. /* Browse definitions */
  115. DEFINE BROWSE br_table
  116. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
  117. QUERY br_table NO-LOCK DISPLAY
  118. ArtLief.Artnr FORMAT "999999":U WIDTH 8
  119. ArtLief.Inhalt FORMAT "9999":U WIDTH 6
  120. ArtLief.Jahr FORMAT "9999":U WIDTH 5
  121. VText @ VText COLUMN-LABEL "Artikel" FORMAT "x(30)":U
  122. ArtLief.S_Artnr COLUMN-LABEL "s Nummer" FORMAT "x(12)":U
  123. WIDTH 14
  124. ArtLief.S_Bez1 COLUMN-LABEL "s Bezeichnung" FORMAT "x(30)":U
  125. ArtLief.S_Preis COLUMN-LABEL "s Preis" FORMAT "zzz,zz9.9999":U
  126. WIDTH 14
  127. /* _UIB-CODE-BLOCK-END */
  128. &ANALYZE-RESUME
  129. WITH NO-ASSIGN NO-ROW-MARKERS SEPARATORS SIZE 117.2 BY 19.52
  130. BGCOLOR 15 .
  131. /* ************************ Frame Definitions *********************** */
  132. DEFINE FRAME F-Main
  133. br_table AT ROW 1.24 COL 2.2
  134. RECT-24 AT ROW 1.19 COL 1
  135. WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
  136. SIDE-LABELS NO-UNDERLINE THREE-D
  137. AT COL 1 ROW 1 SCROLLABLE
  138. BGCOLOR 8 FGCOLOR 0 .
  139. /* *********************** Procedure Settings ************************ */
  140. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  141. /* Settings for THIS-PROCEDURE
  142. Type: SmartBrowser
  143. Allow: Basic,Browse
  144. Frames: 1
  145. Add Fields to: EXTERNAL-TABLES
  146. Other Settings: PERSISTENT-ONLY COMPILE
  147. */
  148. /* This procedure should always be RUN PERSISTENT. Report the error, */
  149. /* then cleanup and return. */
  150. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  151. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  152. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  153. RETURN.
  154. END.
  155. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  156. /* ************************* Create Window ************************** */
  157. &ANALYZE-SUSPEND _CREATE-WINDOW
  158. /* DESIGN Window definition (used by the UIB)
  159. CREATE WINDOW B-table-Win ASSIGN
  160. HEIGHT = 20
  161. WIDTH = 120.6.
  162. /* END WINDOW DEFINITION */
  163. */
  164. &ANALYZE-RESUME
  165. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
  166. /* ************************* Included-Libraries *********************** */
  167. {src/adm/method/browser.i}
  168. /* _UIB-CODE-BLOCK-END */
  169. &ANALYZE-RESUME
  170. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  171. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  172. /* SETTINGS FOR WINDOW B-table-Win
  173. NOT-VISIBLE,,RUN-PERSISTENT */
  174. /* SETTINGS FOR FRAME F-Main
  175. NOT-VISIBLE Size-to-Fit */
  176. /* BROWSE-TAB br_table 1 F-Main */
  177. ASSIGN
  178. FRAME F-Main:SCROLLABLE = FALSE
  179. FRAME F-Main:HIDDEN = TRUE.
  180. /* _RUN-TIME-ATTRIBUTES-END */
  181. &ANALYZE-RESUME
  182. /* Setting information for Queries and Browse Widgets fields */
  183. &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
  184. /* Query rebuild information for BROWSE br_table
  185. _TblList = "AnaDat.ArtLief"
  186. _Options = "NO-LOCK"
  187. _OrdList = "AnaDat.ArtLief.Artnr|yes,AnaDat.ArtLief.Inhalt|yes,AnaDat.ArtLief.Jahr|yes"
  188. _Where[1] = "ArtLief.Firma = GVFirma
  189. AND ArtLief.Knr = LVLnr"
  190. _FldNameList[1] > AnaDat.ArtLief.Artnr
  191. "ArtLief.Artnr" ? ? "integer" ? ? ? ? ? ? no ? no no "8" yes no no "U" "" ""
  192. _FldNameList[2] > AnaDat.ArtLief.Inhalt
  193. "ArtLief.Inhalt" ? ? "integer" ? ? ? ? ? ? no ? no no "6" yes no no "U" "" ""
  194. _FldNameList[3] > AnaDat.ArtLief.Jahr
  195. "ArtLief.Jahr" ? ? "integer" ? ? ? ? ? ? no ? no no "5" yes no no "U" "" ""
  196. _FldNameList[4] > "_<CALC>"
  197. "VText @ VText" "Artikel" "x(30)" ? ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  198. _FldNameList[5] > AnaDat.ArtLief.S_Artnr
  199. "ArtLief.S_Artnr" "s Nummer" ? "character" ? ? ? ? ? ? no ? no no "14" yes no no "U" "" ""
  200. _FldNameList[6] > AnaDat.ArtLief.S_Bez1
  201. "ArtLief.S_Bez1" "s Bezeichnung" ? "character" ? ? ? ? ? ? no ? no no ? yes no no "U" "" ""
  202. _FldNameList[7] > AnaDat.ArtLief.S_Preis
  203. "ArtLief.S_Preis" "s Preis" ? "decimal" ? ? ? ? ? ? no ? no no "14" yes no no "U" "" ""
  204. _Query is OPENED
  205. */ /* BROWSE br_table */
  206. &ANALYZE-RESUME
  207. &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
  208. /* Query rebuild information for FRAME F-Main
  209. _Options = "NO-LOCK"
  210. _Query is NOT OPENED
  211. */ /* FRAME F-Main */
  212. &ANALYZE-RESUME
  213. /* ************************ Control Triggers ************************ */
  214. &Scoped-define BROWSE-NAME br_table
  215. &Scoped-define SELF-NAME br_table
  216. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  217. ON ROW-DISPLAY OF br_table IN FRAME F-Main
  218. DO:
  219. VText = ''.
  220. IF NOT AVAILABLE ArtLief THEN RETURN.
  221. FIND Artst USE-INDEX Artst-k1
  222. WHERE Artst.Firma = ArtLief.Firma
  223. AND Artst.Artnr = ArtLief.Artnr
  224. AND Artst.Inhalt = ArtLief.Inhalt
  225. AND Artst.Jahr = ArtLief.Jahr NO-LOCK NO-ERROR.
  226. IF NOT AVAILABLE Artst THEN RETURN.
  227. FIND FIRST ArtBez OF Artst NO-LOCK NO-ERROR.
  228. IF AVAILABLE ArtBez THEN VText = ArtBez.Bez1.
  229. END.
  230. /* _UIB-CODE-BLOCK-END */
  231. &ANALYZE-RESUME
  232. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  233. ON ROW-ENTRY OF br_table IN FRAME F-Main
  234. DO:
  235. /* This code displays initial values for newly added or copied rows. */
  236. {src/adm/template/brsentry.i}
  237. END.
  238. /* _UIB-CODE-BLOCK-END */
  239. &ANALYZE-RESUME
  240. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  241. ON ROW-LEAVE OF br_table IN FRAME F-Main
  242. DO:
  243. /* Do not disable this code or no updates will take place except
  244. by pressing the Save button on an Update SmartPanel. */
  245. {src/adm/template/brsleave.i}
  246. END.
  247. /* _UIB-CODE-BLOCK-END */
  248. &ANALYZE-RESUME
  249. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
  250. ON VALUE-CHANGED OF br_table IN FRAME F-Main
  251. DO:
  252. /* This ADM trigger code must be preserved in order to notify other
  253. objects when the browser's current row changes. */
  254. {src/adm/template/brschnge.i}
  255. END.
  256. /* _UIB-CODE-BLOCK-END */
  257. &ANALYZE-RESUME
  258. &UNDEFINE SELF-NAME
  259. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
  260. /* *************************** Main Block *************************** */
  261. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  262. RUN dispatch IN THIS-PROCEDURE ('initialize':U).
  263. &ENDIF
  264. /* _UIB-CODE-BLOCK-END */
  265. &ANALYZE-RESUME
  266. /* ********************** Internal Procedures *********************** */
  267. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
  268. PROCEDURE adm-row-available :
  269. /*------------------------------------------------------------------------------
  270. Purpose: Dispatched to this procedure when the Record-
  271. Source has a new row available. This procedure
  272. tries to get the new row (or foriegn keys) from
  273. the Record-Source and process it.
  274. Parameters: <none>
  275. ------------------------------------------------------------------------------*/
  276. /* Define variables needed by this internal procedure. */
  277. {src/adm/template/row-head.i}
  278. /* Process the newly available records (i.e. display fields,
  279. open queries, and/or pass records on to any RECORD-TARGETS). */
  280. {src/adm/template/row-end.i}
  281. END PROCEDURE.
  282. /* _UIB-CODE-BLOCK-END */
  283. &ANALYZE-RESUME
  284. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
  285. PROCEDURE disable_UI :
  286. /*------------------------------------------------------------------------------
  287. Purpose: DISABLE the User Interface
  288. Parameters: <none>
  289. Notes: Here we clean-up the user-interface by deleting
  290. dynamic widgets we have created and/or hide
  291. frames. This procedure is usually called when
  292. we are ready to "clean-up" after running.
  293. ------------------------------------------------------------------------------*/
  294. /* Hide all frames. */
  295. HIDE FRAME F-Main.
  296. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  297. END PROCEDURE.
  298. /* _UIB-CODE-BLOCK-END */
  299. &ANALYZE-RESUME
  300. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-view B-table-Win
  301. PROCEDURE local-view :
  302. /*------------------------------------------------------------------------------
  303. Purpose: Override standard ADM method
  304. Notes:
  305. ------------------------------------------------------------------------------*/
  306. RUN dispatch IN THIS-PROCEDURE ( INPUT 'view':U ) .
  307. RUN dispatch IN THIS-PROCEDURE ('open-query':U).
  308. END PROCEDURE.
  309. /* _UIB-CODE-BLOCK-END */
  310. &ANALYZE-RESUME
  311. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
  312. PROCEDURE send-records :
  313. /*------------------------------------------------------------------------------
  314. Purpose: Send record ROWID's for all tables used by
  315. this file.
  316. Parameters: see template/snd-head.i
  317. ------------------------------------------------------------------------------*/
  318. /* Define variables needed by this internal procedure. */
  319. {src/adm/template/snd-head.i}
  320. /* For each requested table, put it's ROWID in the output list. */
  321. {src/adm/template/snd-list.i "ArtLief"}
  322. /* Deal with any unexpected table requests before closing. */
  323. {src/adm/template/snd-end.i}
  324. END PROCEDURE.
  325. /* _UIB-CODE-BLOCK-END */
  326. &ANALYZE-RESUME
  327. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
  328. PROCEDURE state-changed :
  329. /* -----------------------------------------------------------
  330. Purpose:
  331. Parameters: <none>
  332. Notes:
  333. -------------------------------------------------------------*/
  334. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  335. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  336. CASE p-state:
  337. /* Object instance CASEs can go here to replace standard behavior
  338. or add new cases. */
  339. {src/adm/template/bstates.i}
  340. END CASE.
  341. END PROCEDURE.
  342. /* _UIB-CODE-BLOCK-END */
  343. &ANALYZE-RESUME