w_rpt_field_def2.srw 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. $PBExportHeader$w_rpt_field_def2.srw
  2. forward
  3. global type w_rpt_field_def2 from w_publ_base
  4. end type
  5. type dw_table from u_dw_rbtnfilter within w_rpt_field_def2
  6. end type
  7. type dw_field from u_dw_rbtnfilter within w_rpt_field_def2
  8. end type
  9. type ln_bar2 from line within w_rpt_field_def2
  10. end type
  11. type ln_bar from line within w_rpt_field_def2
  12. end type
  13. type r_bar from rectangle within w_rpt_field_def2
  14. end type
  15. end forward
  16. global type w_rpt_field_def2 from w_publ_base
  17. integer width = 3611
  18. integer height = 2372
  19. string title = "系统数据字典"
  20. boolean maxbox = true
  21. windowstate windowstate = maximized!
  22. event retrieve_field ( )
  23. event dwnkey pbm_dwnkey
  24. dw_table dw_table
  25. dw_field dw_field
  26. ln_bar2 ln_bar2
  27. ln_bar ln_bar
  28. r_bar r_bar
  29. end type
  30. global w_rpt_field_def2 w_rpt_field_def2
  31. type variables
  32. //long ll_billid
  33. uo_reportdef uo_report
  34. uo_billdef uo_bill
  35. boolean ls_update_flag=true
  36. Boolean dw_edit_mode_table = FALSE
  37. str_rpt s_rpt_parm
  38. s_rpt_bill s_bill[]
  39. long dw_table_h,dw_field_h,dw_field_w
  40. long modifyrow_no
  41. string ins_sqlerrtext
  42. end variables
  43. event retrieve_field();Long row
  44. row = dw_table.GetRow()
  45. IF row > 0 THEN
  46. dw_field.SetRedraw (FALSE)
  47. // dw_field.Retrieve(dw_table.Object.table_english[row])
  48. String ls_file
  49. ls_file = "pbc_tnam = '" + dw_table.Object.table_english[row] + "'"
  50. dw_field.SetFilter(ls_file)
  51. dw_field.filter()
  52. dw_field.SetRedraw (TRUE)
  53. ELSE
  54. dw_field.Reset()
  55. END IF
  56. end event
  57. on w_rpt_field_def2.create
  58. int iCurrent
  59. call super::create
  60. this.dw_table=create dw_table
  61. this.dw_field=create dw_field
  62. this.ln_bar2=create ln_bar2
  63. this.ln_bar=create ln_bar
  64. this.r_bar=create r_bar
  65. iCurrent=UpperBound(this.Control)
  66. this.Control[iCurrent+1]=this.dw_table
  67. this.Control[iCurrent+2]=this.dw_field
  68. this.Control[iCurrent+3]=this.ln_bar2
  69. this.Control[iCurrent+4]=this.ln_bar
  70. this.Control[iCurrent+5]=this.r_bar
  71. end on
  72. on w_rpt_field_def2.destroy
  73. call super::destroy
  74. destroy(this.dw_table)
  75. destroy(this.dw_field)
  76. destroy(this.ln_bar2)
  77. destroy(this.ln_bar)
  78. destroy(this.r_bar)
  79. end on
  80. event open;call super::open;//dw_table.SetTransObject(sqlca)
  81. //dw_field.SetTransObject(sqlca)
  82. //dw_table.Retrieve()
  83. this.TriggerEvent('retrieve_field')
  84. end event
  85. event close;call super::close;DESTROY uo_report
  86. end event
  87. event resize;call super::resize;long w_width,w_height
  88. w_width = 3630
  89. w_height = 2290 + 100
  90. ln_bar.endx = this.width
  91. ln_bar2.endx = this.width
  92. r_bar.width = this.width
  93. if newwidth < w_width then this.width = w_width
  94. if newheight < w_height then this.height = w_height
  95. dw_table.height = this.height - (w_height - dw_table_h)
  96. dw_field.width=this.width - (w_width - dw_field_w)
  97. dw_field.height=this.height - (w_height - dw_field_h)
  98. end event
  99. event closequery;call super::closequery;
  100. Int ls_row = 0
  101. IF dw_edit_mode THEN
  102. dw_field.AcceptText()
  103. ls_row = dw_field.GetNextModified(0, Primary!)+&
  104. dw_field.GetNextModified(0, Filter!)+dw_field.DeletedCount()
  105. IF ls_row > 0 THEN
  106. IF MessageBox('询问','数据已经改变,是否先保存?',Question!,YesNo!,1 ) = 1 THEN
  107. RETURN 1
  108. END IF
  109. END IF
  110. END IF
  111. IF dw_edit_mode_table THEN
  112. dw_table.AcceptText()
  113. ls_row = dw_table.GetNextModified(0, Primary!)+&
  114. dw_table.GetNextModified(0, Filter!)+dw_table.DeletedCount()
  115. IF ls_row > 0 THEN
  116. IF MessageBox('询问','数据已经改变,是否先保存?',Question!,YesNo!,1 ) = 1 THEN
  117. RETURN 1
  118. END IF
  119. END IF
  120. END IF
  121. end event
  122. type cb_func from w_publ_base`cb_func within w_rpt_field_def2
  123. integer width = 151
  124. integer height = 164
  125. string normalpicname = "setting.bmp"
  126. integer picsize = 16
  127. toolbaralignment pic_align = alignattop!
  128. boolean border = false
  129. end type
  130. type cb_exit from w_publ_base`cb_exit within w_rpt_field_def2
  131. integer x = 151
  132. integer width = 151
  133. integer height = 164
  134. integer picsize = 16
  135. toolbaralignment pic_align = alignattop!
  136. boolean border = false
  137. end type
  138. type dw_table from u_dw_rbtnfilter within w_rpt_field_def2
  139. integer y = 188
  140. integer width = 1499
  141. integer height = 2080
  142. integer taborder = 20
  143. boolean bringtotop = true
  144. string dataobject = "ds_rpt_table_def"
  145. boolean vscrollbar = true
  146. boolean rbutton_filter_use = true
  147. boolean titleclick_sort_use = true
  148. boolean autosave_setlayout_use = false
  149. end type
  150. event clicked;call super::clicked;IF not( dw_edit_mode or row <=0 ) THEN this.setrow(row)
  151. end event
  152. event rowfocuschanged;call super::rowfocuschanged;IF dw_edit_mode THEN RETURN
  153. IF currentrow <= 0 THEN
  154. dw_field.Reset()
  155. RETURN
  156. END IF
  157. THIS.SetRow(currentrow)
  158. THIS.SelectRow(0,FALSE)
  159. THIS.SelectRow(currentrow,TRUE)
  160. PARENT.TriggerEvent('retrieve_field')
  161. end event
  162. event constructor;call super::constructor;dw_table_h = this.height
  163. end event
  164. event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode_table then return 1
  165. end event
  166. event dwnkey;if keydown(KeyF4!) then //read layout
  167. uf_read_profile_filter()
  168. uf_read_profile_sort()
  169. //uf_read_profile_layout()
  170. elseif keydown(KeyF5!) then //save layout 不含列显示
  171. uf_save_profile_filter()
  172. uf_save_profile_sort()
  173. //uf_save_profile_layout()
  174. elseif keydown(KeyF9!) then //reset layout 不含列显示
  175. uf_reset_layout()
  176. end if
  177. PARENT.TriggerEvent(Key!)
  178. end event
  179. type dw_field from u_dw_rbtnfilter within w_rpt_field_def2
  180. integer x = 1504
  181. integer y = 184
  182. integer width = 2085
  183. integer height = 2080
  184. integer taborder = 20
  185. boolean bringtotop = true
  186. string dataobject = "ds_rpt_field_def"
  187. boolean hscrollbar = true
  188. boolean vscrollbar = true
  189. boolean rbutton_filter_use = true
  190. boolean titleclick_sort_use = true
  191. end type
  192. event rowfocuschanged;call super::rowfocuschanged;
  193. this.selectrow(0,false)
  194. this.selectrow(currentrow,true)
  195. end event
  196. event doubleclicked;call super::doubleclicked;if dw_edit_mode then return
  197. parent.triggerevent('ue_f7')
  198. end event
  199. event constructor;call super::constructor;dw_field_h = this.height
  200. dw_field_w = this.width
  201. end event
  202. event ue_setlayout;//if setcolumn_visible_USE=false then return
  203. //IF this.DATAOBJECT='' THEN RETURN
  204. //
  205. //datastore ls_ds
  206. //ls_ds=create datastore
  207. //ls_ds.dataobject='dw_rbtnfilter_setlayout'
  208. //string ls_mdfstr,ls_mdftext_str,ls_titlex_str,ls_titley_str,ls_x_str,ls_y_str //存放modify string
  209. //string des_1,des_2,szColumn,ls_cwidth,ls_alignment
  210. //long nColumnIndex,nColumnCount,lRow,ls_i
  211. //s_dw_rbtnfilter_setlayout_rt ls_s_rt
  212. //
  213. //nColumnCount = Integer( this.Object.DataWindow.Column.Count)
  214. //
  215. //For nColumnIndex = 1 To nColumnCount
  216. // des_1= this.Describe( "#" + String(nColumnIndex) + ".Name")
  217. // des_2= this.describe(des_1+ "_t.Text")
  218. //
  219. // szColumn = f_strip( des_2)
  220. // If szColumn <> "!" Then
  221. // lRow = ls_ds.InsertRow( 0)
  222. // ls_ds.SetItem( lRow, "ctitle", szColumn)
  223. // ls_ds.SetItem( lRow, "cname", des_1)
  224. // ls_ds.SetItem( lRow, "cshow_flag", long(this.describe(des_1+ ".Visible")))
  225. // ls_ds.SetItem( lRow, "cnewtitle", this.describe(des_1+ "_t.text"))
  226. // ls_ds.SetItem( lRow, "cwidth", long(this.describe(des_1+ ".width")))
  227. // ls_ds.SetItem( lRow, "alignment", long(this.describe(des_1+ ".alignment")))
  228. // ls_ds.SetItem( lRow, "nColumnIndex", nColumnIndex)
  229. // ls_ds.SetItem( lRow, "titlex", long(this.describe(des_1+ "_t.x")))
  230. // ls_ds.SetItem( lRow, "titley", long(this.describe(des_1+ "_t.y")))
  231. // ls_ds.SetItem( lRow, "x", long(this.describe(des_1+ ".x")))
  232. // ls_ds.SetItem( lRow, "y", long(this.describe(des_1+ ".y")))
  233. // End If
  234. //Next
  235. //
  236. ////---打开设置窗口
  237. //openwithparm(w_dw_rbtnfilter_setlayout,ls_ds)
  238. //
  239. //ls_s_rt=message.powerobjectparm
  240. ////---处理设置
  241. //if ls_s_rt.flag=1 then //要保存修改
  242. // ls_ds.setfullstate( ls_s_rt.b_changes )
  243. // for ls_i=1 to ls_ds.rowcount()
  244. // ls_mdfstr=ls_mdfstr+ls_ds.object.cname[ls_i]+'.visible='+string(ls_ds.object.cshow_flag[ls_i])+'~t'
  245. // ls_mdfstr=ls_mdfstr+ls_ds.object.cname[ls_i]+'_t.visible='+string(ls_ds.object.cshow_flag[ls_i])+'~t'
  246. //
  247. // ls_mdftext_str=ls_mdftext_str+ls_ds.object.cname[ls_i]+"_t.text='"+ls_ds.object.cnewtitle[ls_i]+"'~t"
  248. // ls_titlex_str=ls_titlex_str+ls_ds.object.cname[ls_i]+"_t.x="+string(ls_ds.object.titlex[ls_i])+'~t'
  249. // ls_titley_str=ls_titley_str+ls_ds.object.cname[ls_i]+"_t.y="+string(ls_ds.object.titley[ls_i])+'~t'
  250. // ls_x_str=ls_x_str+ls_ds.object.cname[ls_i]+".x="+string(ls_ds.object.x[ls_i])+'~t'
  251. // ls_y_str=ls_y_str+ls_ds.object.cname[ls_i]+".y="+string(ls_ds.object.y[ls_i])+'~t'
  252. // ls_cwidth=ls_cwidth+ls_ds.object.cname[ls_i]+".width="+string(ls_ds.object.cwidth[ls_i])+'~t'
  253. // ls_alignment=ls_alignment+ls_ds.object.cname[ls_i]+".alignment="+string(ls_ds.object.alignment[ls_i])+'~t'
  254. // next
  255. //
  256. // ins_mdfstr_column_visible=ls_mdfstr
  257. // ins_mdfstr_column_text=ls_mdftext_str
  258. // ins_mdfstr_column_x=ls_titlex_str+ls_x_str
  259. // ins_mdfstr_column_y=ls_titley_str+ls_y_str
  260. // ins_mdfstr_column_width=ls_cwidth
  261. // ins_mdfstr_column_alignment=ls_alignment
  262. //
  263. // this.modify( ins_mdfstr_column_visible)
  264. // this.modify(ins_mdfstr_column_text)
  265. // this.modify(ins_mdfstr_column_width)
  266. // this.modify(ins_mdfstr_column_x)
  267. // this.modify(ins_mdfstr_column_y)
  268. // this.modify(ins_mdfstr_column_alignment)
  269. //elseif ls_s_rt.flag=2 then //reset
  270. // uf_reset_layout()
  271. // uf_save_profile_layout()
  272. //end if
  273. //
  274. //destroy ls_ds
  275. //
  276. //
  277. //
  278. end event
  279. event dwnkey;call super::dwnkey;PARENT.TriggerEvent(Key!)
  280. end event
  281. type ln_bar2 from line within w_rpt_field_def2
  282. long linecolor = 16777215
  283. integer linethickness = 4
  284. integer beginy = 176
  285. integer endx = 3406
  286. integer endy = 176
  287. end type
  288. type ln_bar from line within w_rpt_field_def2
  289. long linecolor = 268435456
  290. integer linethickness = 4
  291. integer beginy = 172
  292. integer endx = 3406
  293. integer endy = 172
  294. end type
  295. type r_bar from rectangle within w_rpt_field_def2
  296. long linecolor = 16777215
  297. long fillcolor = 1073741824
  298. integer x = 3250
  299. integer y = -8
  300. integer width = 73
  301. integer height = 172
  302. end type
  303. event constructor;this.fillcolor = 14215660
  304. this.linecolor = 14215660
  305. this.x = -1
  306. this.y = -1
  307. this.height = ln_bar2.beginy - 5
  308. end event