d-artliefsuch.w 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. */
  5. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  6. &Scoped-define FRAME-NAME D-Dialog
  7. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS D-Dialog
  8. /*------------------------------------------------------------------------
  9. File:
  10. Description: from cntnrdlg.w - ADM SmartDialog Template
  11. Input Parameters:
  12. <none>
  13. Output Parameters:
  14. <none>
  15. Author:
  16. Created:
  17. ------------------------------------------------------------------------*/
  18. /* This .W file was created with the Progress UIB. */
  19. /*----------------------------------------------------------------------*/
  20. /* Create an unnamed pool to store all the widgets created
  21. by this procedure. This is a good default which assures
  22. that this procedure's triggers and internal procedures
  23. will execute in this procedure's storage, and that proper
  24. cleanup will occur on deletion of the procedure. */
  25. CREATE WIDGET-POOL.
  26. /* *************************** Definitions ************************** */
  27. /* Parameters Definitions --- */
  28. /* Local Variable Definitions --- */
  29. DEF VAR VTitel AS CHAR NO-UNDO.
  30. /* ---------- Globale Variablen ---------------------------------- */
  31. { v8/globvar.i" " " " "SHARED" }
  32. { v8/debivar.i " " " " "SHARED" }
  33. { v8/artivar.i " " " " "SHARED" }
  34. { v8/contvar.i " " " " "SHARED" }
  35. /* _UIB-CODE-BLOCK-END */
  36. &ANALYZE-RESUME
  37. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  38. /* ******************** Preprocessor Definitions ******************** */
  39. &Scoped-define PROCEDURE-TYPE SmartDialog
  40. &Scoped-define DB-AWARE no
  41. &Scoped-define ADM-CONTAINER DIALOG-BOX
  42. /* Name of designated FRAME-NAME and/or first browse and/or first query */
  43. &Scoped-define FRAME-NAME D-Dialog
  44. /* Standard List Definitions */
  45. &Scoped-Define ENABLED-OBJECTS Btn_OK Btn_Cancel
  46. /* Custom List Definitions */
  47. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  48. /* _UIB-PREPROCESSOR-BLOCK-END */
  49. &ANALYZE-RESUME
  50. /* *********************** Control Definitions ********************** */
  51. /* Define a dialog box */
  52. /* Definitions of handles for SmartObjects */
  53. DEFINE VARIABLE h_b-artliefsuch AS HANDLE NO-UNDO.
  54. /* Definitions of the field level widgets */
  55. DEFINE BUTTON Btn_Cancel AUTO-END-KEY DEFAULT
  56. LABEL "Cancel"
  57. SIZE 2.8 BY 1
  58. BGCOLOR 8 .
  59. DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
  60. LABEL "OK"
  61. SIZE 2.8 BY 1
  62. BGCOLOR 8 .
  63. /* ************************ Frame Definitions *********************** */
  64. DEFINE FRAME D-Dialog
  65. Btn_OK AT ROW 2.14 COL 96.6
  66. Btn_Cancel AT ROW 4 COL 95.8
  67. SPACE(32.39) SKIP(9.70)
  68. WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
  69. SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
  70. TITLE "Suchen von Artikeln vom Lieferant"
  71. DEFAULT-BUTTON Btn_OK CANCEL-BUTTON Btn_Cancel.
  72. /* *********************** Procedure Settings ************************ */
  73. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  74. /* Settings for THIS-PROCEDURE
  75. Type: SmartDialog
  76. Allow: Basic,Browse,DB-Fields,Query,Smart
  77. Design Page: 2
  78. Other Settings: COMPILE
  79. */
  80. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  81. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB D-Dialog
  82. /* ************************* Included-Libraries *********************** */
  83. {src/adm/method/containr.i}
  84. /* _UIB-CODE-BLOCK-END */
  85. &ANALYZE-RESUME
  86. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  87. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  88. /* SETTINGS FOR DIALOG-BOX D-Dialog
  89. FRAME-NAME Custom */
  90. ASSIGN
  91. FRAME D-Dialog:SCROLLABLE = FALSE
  92. FRAME D-Dialog:HIDDEN = TRUE.
  93. ASSIGN
  94. Btn_Cancel:HIDDEN IN FRAME D-Dialog = TRUE.
  95. ASSIGN
  96. Btn_OK:HIDDEN IN FRAME D-Dialog = TRUE.
  97. /* _RUN-TIME-ATTRIBUTES-END */
  98. &ANALYZE-RESUME
  99. /* Setting information for Queries and Browse Widgets fields */
  100. &ANALYZE-SUSPEND _QUERY-BLOCK DIALOG-BOX D-Dialog
  101. /* Query rebuild information for DIALOG-BOX D-Dialog
  102. _Options = "SHARE-LOCK"
  103. _Query is NOT OPENED
  104. */ /* DIALOG-BOX D-Dialog */
  105. &ANALYZE-RESUME
  106. /* ************************ Control Triggers ************************ */
  107. &Scoped-define SELF-NAME D-Dialog
  108. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL D-Dialog D-Dialog
  109. ON WINDOW-CLOSE OF FRAME D-Dialog /* Suchen von Artikeln vom Lieferant */
  110. DO:
  111. /* Add Trigger to equate WINDOW-CLOSE to END-ERROR. */
  112. APPLY "END-ERROR":U TO SELF.
  113. END.
  114. /* _UIB-CODE-BLOCK-END */
  115. &ANALYZE-RESUME
  116. &UNDEFINE SELF-NAME
  117. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK D-Dialog
  118. /* *************************** Main Block *************************** */
  119. VTitel = FRAME {&FRAME-NAME}:TITLE.
  120. FIND Adresse USE-INDEX Adresse-k1
  121. WHERE Adresse.Firma = AdFirma
  122. AND Adresse.Knr = LVLnr NO-LOCK NO-ERROR.
  123. IF AVAILABLE Adresse THEN DO:
  124. VTitel = VTitel + " " + Adresse.Anzeig_Br.
  125. END.
  126. FRAME {&FRAME-NAME}:TITLE = VTitel.
  127. {src/adm/template/dialogmn.i}
  128. /* _UIB-CODE-BLOCK-END */
  129. &ANALYZE-RESUME
  130. /* ********************** Internal Procedures *********************** */
  131. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects D-Dialog _ADM-CREATE-OBJECTS
  132. PROCEDURE adm-create-objects :
  133. /*------------------------------------------------------------------------------
  134. Purpose: Create handles for all SmartObjects used in this procedure.
  135. After SmartObjects are initialized, then SmartLinks are added.
  136. Parameters: <none>
  137. ------------------------------------------------------------------------------*/
  138. DEFINE VARIABLE adm-current-page AS INTEGER NO-UNDO.
  139. RUN get-attribute IN THIS-PROCEDURE ('Current-Page':U).
  140. ASSIGN adm-current-page = INTEGER(RETURN-VALUE).
  141. CASE adm-current-page:
  142. WHEN 0 THEN DO:
  143. RUN init-object IN THIS-PROCEDURE (
  144. INPUT 'v8/b-artliefsuch.w':U ,
  145. INPUT FRAME D-Dialog:HANDLE ,
  146. INPUT 'Initial-Lock = NO-LOCK,
  147. Hide-on-Init = no,
  148. Disable-on-Init = no,
  149. Layout = ,
  150. Create-On-Add = ?':U ,
  151. OUTPUT h_b-artliefsuch ).
  152. RUN set-position IN h_b-artliefsuch ( 1.00 , 1.00 ) NO-ERROR.
  153. RUN set-size IN h_b-artliefsuch ( 13.33 , 129.00 ) NO-ERROR.
  154. /* Links to SmartBrowser h_b-artliefsuch. */
  155. RUN add-link IN adm-broker-hdl ( THIS-PROCEDURE , 'MAIN':U , h_b-artliefsuch ).
  156. /* Adjust the tab order of the smart objects. */
  157. RUN adjust-tab-order IN adm-broker-hdl ( h_b-artliefsuch ,
  158. Btn_OK:HANDLE , 'BEFORE':U ).
  159. END. /* Page 0 */
  160. END CASE.
  161. END PROCEDURE.
  162. /* _UIB-CODE-BLOCK-END */
  163. &ANALYZE-RESUME
  164. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available D-Dialog _ADM-ROW-AVAILABLE
  165. PROCEDURE adm-row-available :
  166. /*------------------------------------------------------------------------------
  167. Purpose: Dispatched to this procedure when the Record-
  168. Source has a new row available. This procedure
  169. tries to get the new row (or foriegn keys) from
  170. the Record-Source and process it.
  171. Parameters: <none>
  172. ------------------------------------------------------------------------------*/
  173. /* Define variables needed by this internal procedure. */
  174. {src/adm/template/row-head.i}
  175. /* Process the newly available records (i.e. display fields,
  176. open queries, and/or pass records on to any RECORD-TARGETS). */
  177. {src/adm/template/row-end.i}
  178. END PROCEDURE.
  179. /* _UIB-CODE-BLOCK-END */
  180. &ANALYZE-RESUME
  181. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI D-Dialog _DEFAULT-DISABLE
  182. PROCEDURE disable_UI :
  183. /*------------------------------------------------------------------------------
  184. Purpose: DISABLE the User Interface
  185. Parameters: <none>
  186. Notes: Here we clean-up the user-interface by deleting
  187. dynamic widgets we have created and/or hide
  188. frames. This procedure is usually called when
  189. we are ready to "clean-up" after running.
  190. ------------------------------------------------------------------------------*/
  191. /* Hide all frames. */
  192. HIDE FRAME D-Dialog.
  193. END PROCEDURE.
  194. /* _UIB-CODE-BLOCK-END */
  195. &ANALYZE-RESUME
  196. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI D-Dialog _DEFAULT-ENABLE
  197. PROCEDURE enable_UI :
  198. /*------------------------------------------------------------------------------
  199. Purpose: ENABLE the User Interface
  200. Parameters: <none>
  201. Notes: Here we display/view/enable the widgets in the
  202. user-interface. In addition, OPEN all queries
  203. associated with each FRAME and BROWSE.
  204. These statements here are based on the "Other
  205. Settings" section of the widget Property Sheets.
  206. ------------------------------------------------------------------------------*/
  207. ENABLE Btn_OK Btn_Cancel
  208. WITH FRAME D-Dialog.
  209. VIEW FRAME D-Dialog.
  210. {&OPEN-BROWSERS-IN-QUERY-D-Dialog}
  211. END PROCEDURE.
  212. /* _UIB-CODE-BLOCK-END */
  213. &ANALYZE-RESUME
  214. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-enable D-Dialog
  215. PROCEDURE local-enable :
  216. /*------------------------------------------------------------------------------
  217. Purpose: Override standard ADM method
  218. Notes:
  219. ------------------------------------------------------------------------------*/
  220. RUN dispatch IN THIS-PROCEDURE ( INPUT 'enable':U ) .
  221. DO WITH FRAME {&FRAME-NAME}:
  222. Btn_OK:VISIBLE = FALSE.
  223. Btn_Cancel:VISIBLE = FALSE.
  224. END.
  225. END PROCEDURE.
  226. /* _UIB-CODE-BLOCK-END */
  227. &ANALYZE-RESUME
  228. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records D-Dialog _ADM-SEND-RECORDS
  229. PROCEDURE send-records :
  230. /*------------------------------------------------------------------------------
  231. Purpose: Send record ROWID's for all tables used by
  232. this file.
  233. Parameters: see template/snd-head.i
  234. ------------------------------------------------------------------------------*/
  235. /* SEND-RECORDS does nothing because there are no External
  236. Tables specified for this SmartDialog, and there are no
  237. tables specified in any contained Browse, Query, or Frame. */
  238. END PROCEDURE.
  239. /* _UIB-CODE-BLOCK-END */
  240. &ANALYZE-RESUME
  241. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed D-Dialog
  242. PROCEDURE state-changed :
  243. /* -----------------------------------------------------------
  244. Purpose:
  245. Parameters: <none>
  246. Notes:
  247. -------------------------------------------------------------*/
  248. DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
  249. DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
  250. CASE p-state:
  251. WHEN 'GO' THEN DO:
  252. Gefunden = TRUE.
  253. APPLY 'CHOOSE' TO Btn_OK IN FRAME {&FRAME-NAME}.
  254. RETURN NO-APPLY.
  255. END.
  256. WHEN 'CANCEL' THEN DO:
  257. Gefunden = FALSE.
  258. APPLY 'CHOOSE' TO Btn_Cancel IN FRAME {&FRAME-NAME}.
  259. RETURN NO-APPLY.
  260. END.
  261. END CASE.
  262. END PROCEDURE.
  263. /* _UIB-CODE-BLOCK-END */
  264. &ANALYZE-RESUME