w_dw_edit.srw 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. $PBExportHeader$w_dw_edit.srw
  2. forward
  3. global type w_dw_edit from w_publ_base
  4. end type
  5. type lb_1 from listbox within w_dw_edit
  6. end type
  7. type lb_2 from listbox within w_dw_edit
  8. end type
  9. type dw_list from u_dw_rbtnfilter within w_dw_edit
  10. end type
  11. type dw_lib from u_dw_rbtnfilter within w_dw_edit
  12. end type
  13. type ddlb_type from dropdownlistbox within w_dw_edit
  14. end type
  15. type st_1 from statictext within w_dw_edit
  16. end type
  17. type cb_add from uo_imflatbutton within w_dw_edit
  18. end type
  19. type cb_retrieve from uo_imflatbutton within w_dw_edit
  20. end type
  21. type ln_bar2 from line within w_dw_edit
  22. end type
  23. type ln_bar from line within w_dw_edit
  24. end type
  25. type r_bar from rectangle within w_dw_edit
  26. end type
  27. end forward
  28. global type w_dw_edit from w_publ_base
  29. integer width = 3625
  30. integer height = 2376
  31. string title = "数据窗口编辑器"
  32. boolean maxbox = true
  33. boolean resizable = true
  34. windowstate windowstate = maximized!
  35. event ue_f7 ( )
  36. lb_1 lb_1
  37. lb_2 lb_2
  38. dw_list dw_list
  39. dw_lib dw_lib
  40. ddlb_type ddlb_type
  41. st_1 st_1
  42. cb_add cb_add
  43. cb_retrieve cb_retrieve
  44. ln_bar2 ln_bar2
  45. ln_bar ln_bar
  46. r_bar r_bar
  47. end type
  48. global w_dw_edit w_dw_edit
  49. type variables
  50. String ls_path,lib_path
  51. long dw_lib_h,dw_list_h,dw_list_w
  52. long cur_type = 0
  53. long j
  54. end variables
  55. forward prototypes
  56. public subroutine wf_retrdw (string arg_path, datawindow arg_dw)
  57. public subroutine wf_addexplore (long arg_type)
  58. end prototypes
  59. event ue_f7();Long lib_row
  60. Long list_row
  61. str_rpt s_parm
  62. lib_row = dw_lib.GetRow()
  63. list_row = dw_list.GetRow()
  64. IF lib_row <= 0 OR list_row <= 0 THEN RETURN
  65. dw_list.accepttext()
  66. s_parm.auto = "auto"
  67. s_parm.transation = sqlca//数据库连接
  68. s_parm.oname = dw_list.object.ctag[list_row]
  69. s_parm.otype = lib_path
  70. s_parm.rcname = dw_list.object.ctag[list_row]
  71. s_parm.retr_pram_falg = -1
  72. s_parm.retr_flag = true
  73. s_parm.import_flag = true
  74. s_parm.pblpath = dw_lib.object.lib_path[lib_row]
  75. OpenWithParm(w_rpt_main,s_parm)
  76. end event
  77. public subroutine wf_retrdw (string arg_path, datawindow arg_dw);String ls_data,s[]
  78. Long k
  79. s[4] = LibraryDirectory(arg_path,DirDataWindow!) //name ~t date/time modified ~t comments ~n
  80. arg_dw.Reset()
  81. dw_list.SetRedraw(FALSE)
  82. DO WHILE TRUE
  83. k = Pos(s[4],'~t')
  84. IF k = 0 THEN EXIT
  85. s[1] = Left(s[4],k -1)
  86. s[4] = Mid(s[4],k+1)
  87. k = Pos(s[4],'~t')
  88. s[3] = Left(s[4],k -1)
  89. s[4] = Mid(s[4],k+1)
  90. k = Pos(s[4],'~n')
  91. s[2] = Left(s[4],k -1)
  92. s[4] = Mid(s[4],k+1)
  93. k = arg_dw.InsertRow(0)
  94. arg_dw.SetItem(k,1,s[1])
  95. arg_dw.SetItem(k,2,s[2])
  96. arg_dw.SetItem(k,3,s[3])
  97. LOOP
  98. dw_list.SetRedraw(TRUE)
  99. end subroutine
  100. public subroutine wf_addexplore (long arg_type);
  101. String ls_label
  102. String ls_type
  103. Int li_count,i = 1
  104. j = 1
  105. IF arg_type = 0 THEN
  106. ls_type = "*.pbl"
  107. ELSE
  108. ls_type = "*.pbd"
  109. END IF
  110. LS_PATH = sys_cur_path + ls_type
  111. lb_1.Reset()
  112. lb_1.DirList(LS_PATH, 0)
  113. li_count = lb_1.TotalItems()
  114. dw_lib.Reset()
  115. IF li_count > 0 THEN
  116. FOR i = li_count TO 1 STEP -1
  117. ls_label = lb_1.Text(i)
  118. dw_lib.Object.lib_name[j] = ls_label
  119. dw_lib.Object.lib_path[j] = sys_cur_path + ls_label
  120. dw_lib.Object.flag[j] = 0
  121. j++
  122. NEXT
  123. END IF
  124. IF dw_lib.Rowcount() > 0 THEN
  125. lib_path = dw_lib.Object.lib_path[1]
  126. wf_retrdw(lib_path,dw_list)
  127. ELSE
  128. dw_list.Reset()
  129. END IF
  130. end subroutine
  131. on w_dw_edit.create
  132. int iCurrent
  133. call super::create
  134. this.lb_1=create lb_1
  135. this.lb_2=create lb_2
  136. this.dw_list=create dw_list
  137. this.dw_lib=create dw_lib
  138. this.ddlb_type=create ddlb_type
  139. this.st_1=create st_1
  140. this.cb_add=create cb_add
  141. this.cb_retrieve=create cb_retrieve
  142. this.ln_bar2=create ln_bar2
  143. this.ln_bar=create ln_bar
  144. this.r_bar=create r_bar
  145. iCurrent=UpperBound(this.Control)
  146. this.Control[iCurrent+1]=this.lb_1
  147. this.Control[iCurrent+2]=this.lb_2
  148. this.Control[iCurrent+3]=this.dw_list
  149. this.Control[iCurrent+4]=this.dw_lib
  150. this.Control[iCurrent+5]=this.ddlb_type
  151. this.Control[iCurrent+6]=this.st_1
  152. this.Control[iCurrent+7]=this.cb_add
  153. this.Control[iCurrent+8]=this.cb_retrieve
  154. this.Control[iCurrent+9]=this.ln_bar2
  155. this.Control[iCurrent+10]=this.ln_bar
  156. this.Control[iCurrent+11]=this.r_bar
  157. end on
  158. on w_dw_edit.destroy
  159. call super::destroy
  160. destroy(this.lb_1)
  161. destroy(this.lb_2)
  162. destroy(this.dw_list)
  163. destroy(this.dw_lib)
  164. destroy(this.ddlb_type)
  165. destroy(this.st_1)
  166. destroy(this.cb_add)
  167. destroy(this.cb_retrieve)
  168. destroy(this.ln_bar2)
  169. destroy(this.ln_bar)
  170. destroy(this.r_bar)
  171. end on
  172. event open;call super::open;wf_addexplore(cur_type)
  173. end event
  174. event resize;call super::resize;ln_bar.EndX = THIS.Width
  175. ln_bar2.EndX = THIS.Width
  176. r_bar.Width = THIS.Width
  177. long w_width,w_height
  178. w_width = 3600
  179. w_height = 2350
  180. if newwidth < w_width then this.width = w_width
  181. if newheight < w_height then this.height = w_height
  182. dw_lib.height = this.height - (w_height - dw_lib_h)
  183. dw_list.width=this.width - (w_width - dw_list_w)
  184. dw_list.height=this.height - (w_height - dw_list_h)
  185. end event
  186. type cb_func from w_publ_base`cb_func within w_dw_edit
  187. boolean visible = false
  188. end type
  189. type cb_exit from w_publ_base`cb_exit within w_dw_edit
  190. boolean visible = false
  191. integer x = 3657
  192. integer y = 2304
  193. end type
  194. type lb_1 from listbox within w_dw_edit
  195. boolean visible = false
  196. integer x = 3291
  197. integer y = 128
  198. integer width = 878
  199. integer height = 544
  200. integer taborder = 20
  201. boolean bringtotop = true
  202. integer textsize = -9
  203. integer weight = 400
  204. fontcharset fontcharset = gb2312charset!
  205. fontpitch fontpitch = variable!
  206. string facename = "宋体"
  207. long textcolor = 33554432
  208. borderstyle borderstyle = stylelowered!
  209. end type
  210. type lb_2 from listbox within w_dw_edit
  211. boolean visible = false
  212. integer x = 3291
  213. integer y = 832
  214. integer width = 878
  215. integer height = 544
  216. integer taborder = 30
  217. boolean bringtotop = true
  218. integer textsize = -9
  219. integer weight = 400
  220. fontcharset fontcharset = gb2312charset!
  221. fontpitch fontpitch = variable!
  222. string facename = "宋体"
  223. long textcolor = 33554432
  224. borderstyle borderstyle = stylelowered!
  225. end type
  226. type dw_list from u_dw_rbtnfilter within w_dw_edit
  227. integer x = 1317
  228. integer y = 184
  229. integer width = 2194
  230. integer height = 2008
  231. integer taborder = 20
  232. boolean bringtotop = true
  233. string dataobject = "dw_dw_list"
  234. boolean vscrollbar = true
  235. end type
  236. event rowfocuschanged;call super::rowfocuschanged;THIS.SetRow(currentrow)
  237. THIS.SelectRow(0,FALSE)
  238. THIS.SelectRow(currentrow,TRUE)
  239. end event
  240. event constructor;call super::constructor;dw_list_h = this.height
  241. dw_list_w = this.width
  242. end event
  243. event doubleclicked;call super::doubleclicked;parent.triggerevent('ue_f7')
  244. end event
  245. type dw_lib from u_dw_rbtnfilter within w_dw_edit
  246. integer y = 184
  247. integer width = 1303
  248. integer height = 2004
  249. integer taborder = 20
  250. boolean bringtotop = true
  251. string dataobject = "dw_lib_list"
  252. boolean vscrollbar = true
  253. boolean rbutton_filter_use = true
  254. boolean titleclick_sort_use = true
  255. boolean setcolumn_visible_use = false
  256. boolean autosave_setlayout_use = false
  257. boolean autosave_columnvisible_use = false
  258. end type
  259. event constructor;call super::constructor;dw_lib_h = this.height
  260. end event
  261. event clicked;call super::clicked;IF row = 0 THEN RETURN
  262. THIS.SetRow(row)
  263. THIS.SelectRow(0,FALSE)
  264. THIS.SelectRow(row,TRUE)
  265. end event
  266. event rowfocuschanged;IF currentrow > 0 THEN
  267. THIS.SelectRow(0,FALSE)
  268. THIS.SelectRow(currentrow,TRUE)
  269. END IF
  270. dw_lib.AcceptText()
  271. IF currentrow > 0 THEN
  272. lib_path = dw_lib.Object.lib_path[currentrow]
  273. wf_retrdw(lib_path,dw_list)
  274. ELSE
  275. dw_list.Reset()
  276. END IF
  277. end event
  278. type ddlb_type from dropdownlistbox within w_dw_edit
  279. integer x = 160
  280. integer y = 36
  281. integer width = 741
  282. integer height = 452
  283. integer taborder = 30
  284. boolean bringtotop = true
  285. integer textsize = -9
  286. integer weight = 400
  287. fontcharset fontcharset = gb2312charset!
  288. fontpitch fontpitch = variable!
  289. string facename = "宋体"
  290. long textcolor = 33554432
  291. string text = "PBL"
  292. boolean sorted = false
  293. string item[] = {"PBL","PBD"}
  294. borderstyle borderstyle = stylelowered!
  295. end type
  296. event selectionchanged;CHOOSE CASE Index
  297. CASE 1
  298. cur_type = 0
  299. CASE 2
  300. cur_type = 1
  301. END CHOOSE
  302. wf_addexplore(cur_type)
  303. end event
  304. type st_1 from statictext within w_dw_edit
  305. integer y = 48
  306. integer width = 151
  307. integer height = 68
  308. boolean bringtotop = true
  309. integer textsize = -9
  310. integer weight = 400
  311. fontcharset fontcharset = gb2312charset!
  312. fontpitch fontpitch = variable!
  313. string facename = "宋体"
  314. long textcolor = 33554432
  315. long backcolor = 67108864
  316. string text = "类型:"
  317. alignment alignment = right!
  318. boolean focusrectangle = false
  319. end type
  320. event constructor;THIS.BackColor = 14215660
  321. end event
  322. type cb_add from uo_imflatbutton within w_dw_edit
  323. integer x = 910
  324. integer width = 197
  325. integer height = 164
  326. integer taborder = 50
  327. boolean bringtotop = true
  328. string text = "附加库"
  329. string normalpicname = "imexport.BMP"
  330. integer picsize = 16
  331. toolbaralignment pic_align = alignattop!
  332. boolean border = false
  333. end type
  334. event clicked;call super::clicked;Integer i
  335. String Pathname
  336. String Filename
  337. i = GetFileOpenName("Select File",Pathname,Filename,"pbl","Pb Files,*.pb?")
  338. dw_lib.AcceptText()
  339. IF i = 1 AND Trim(Pathname) <> "" AND Trim(Filename) <> "" THEN
  340. dw_lib.object.lib_name[j] = Filename
  341. dw_lib.object.lib_path[j] = Pathname
  342. dw_lib.object.flag[j] = 1
  343. j++
  344. END IF
  345. RETURN
  346. end event
  347. type cb_retrieve from uo_imflatbutton within w_dw_edit
  348. integer x = 1106
  349. integer width = 151
  350. integer height = 164
  351. integer taborder = 40
  352. boolean bringtotop = true
  353. string text = "刷新"
  354. string normalpicname = "refresh.bmp"
  355. integer picsize = 16
  356. toolbaralignment pic_align = alignattop!
  357. boolean border = false
  358. end type
  359. event clicked;call super::clicked;wf_addexplore(cur_type)
  360. end event
  361. type ln_bar2 from line within w_dw_edit
  362. long linecolor = 16777215
  363. integer linethickness = 4
  364. integer beginx = 9
  365. integer beginy = 172
  366. integer endx = 3273
  367. integer endy = 172
  368. end type
  369. type ln_bar from line within w_dw_edit
  370. long linecolor = 268435456
  371. integer linethickness = 4
  372. integer beginy = 168
  373. integer endx = 3200
  374. integer endy = 168
  375. end type
  376. type r_bar from rectangle within w_dw_edit
  377. long linecolor = 16777215
  378. integer linethickness = 4
  379. long fillcolor = 1073741824
  380. integer x = 3351
  381. integer width = 87
  382. integer height = 68
  383. end type
  384. event constructor;this.fillcolor = 14215660
  385. this.linecolor = 14215660
  386. this.x = -1
  387. this.y = -1
  388. this.height = ln_bar.beginy - 5
  389. end event