w_rpt_1dw.srw 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. $PBExportHeader$w_rpt_1dw.srw
  2. $PBExportComments$含一个DW的基类 -- 窗口
  3. forward
  4. global type w_rpt_1dw from w_rpt_base
  5. end type
  6. type dw1 from datawindow within w_rpt_1dw
  7. end type
  8. type uo_1 from uo_tlbar within w_rpt_1dw
  9. end type
  10. end forward
  11. global type w_rpt_1dw from w_rpt_base
  12. int Width=2670
  13. int Height=2128
  14. string MenuName="m_rpt_tool"
  15. long BackColor=80269524
  16. boolean ToolBarVisible=false
  17. dw1 dw1
  18. uo_1 uo_1
  19. end type
  20. global w_rpt_1dw w_rpt_1dw
  21. on w_rpt_1dw.create
  22. int iCurrent
  23. call super::create
  24. if this.MenuName = "m_rpt_tool" then this.MenuID = create m_rpt_tool
  25. this.dw1=create dw1
  26. this.uo_1=create uo_1
  27. iCurrent=UpperBound(this.Control)
  28. this.Control[iCurrent+1]=this.dw1
  29. this.Control[iCurrent+2]=this.uo_1
  30. end on
  31. on w_rpt_1dw.destroy
  32. call super::destroy
  33. if IsValid(MenuID) then destroy(MenuID)
  34. destroy(this.dw1)
  35. destroy(this.uo_1)
  36. end on
  37. event resize;dw1.x=(newwidth -dw1.width)/2
  38. dw1.resize(dw1.width,newheight -dw1.y -20)
  39. end event
  40. event close;close(w_report_open)
  41. end event
  42. event open;call super::open;if not isvalid(istr_rpt) then
  43. close(this)
  44. return
  45. end if
  46. it_report=istr_rpt.transation
  47. dw1.settransobject(it_report)
  48. dw1.retrieve()
  49. end event
  50. event closequery;dw1.accepttext()
  51. IF dw1.ModifiedCount()+dw1.DeletedCount()>0 then
  52. CHOOSE CASE MESSAGEBOX('提示信息','数据已修改,是否存档?',QUESTION!,YESNOCANCEL!,1)
  53. CASE 1
  54. event ue_save()
  55. CASE 3
  56. RETURN 1
  57. END CHOOSE
  58. END IF
  59. end event
  60. event ue_cond;str_rpt lstr
  61. lstr=istr_rpt
  62. lstr.userdw=dw1
  63. openwithparm(w_rpt_condition,lstr)
  64. is_temp=message.stringparm
  65. if is_temp='' then return
  66. f_myretrieve(dw1,is_temp)
  67. end event
  68. event ue_delete;ii_row=dw1.getrow()
  69. if ii_row>0 then
  70. if messagebox("提示信息","删除当前记录",QUESTION!,YESNO!,2)=1 THEN
  71. dw1.deleterow(ii_row)
  72. end if
  73. end if
  74. end event
  75. event ue_save;f_mysave(dw1,it_report,1)
  76. end event
  77. event ue_new;dw1.setredraw(false)
  78. if ue_row=0 then
  79. dw1.scrolltorow(dw1.insertrow(0))
  80. else
  81. dw1.scrolltorow(dw1.insertrow(dw1.getrow()))
  82. end if
  83. dw1.setredraw(true)
  84. end event
  85. type dw1 from datawindow within w_rpt_1dw
  86. int X=14
  87. int Y=204
  88. int Width=2011
  89. int Height=1448
  90. int TabOrder=10
  91. boolean BringToTop=true
  92. BorderStyle BorderStyle=StyleLowered!
  93. boolean VScrollBar=true
  94. boolean LiveScroll=true
  95. end type
  96. type uo_1 from uo_tlbar within w_rpt_1dw
  97. int X=0
  98. int Y=0
  99. int TabOrder=10
  100. boolean BringToTop=true
  101. boolean Border=false
  102. BorderStyle BorderStyle=StyleBox!
  103. end type
  104. on uo_1.destroy
  105. call uo_tlbar::destroy
  106. end on