uo_tv_bill_event.sru 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. $PBExportHeader$uo_tv_bill_event.sru
  2. forward
  3. global type uo_tv_bill_event from treeview
  4. end type
  5. end forward
  6. global type uo_tv_bill_event from treeview
  7. integer width = 818
  8. integer height = 1440
  9. integer textsize = -9
  10. integer weight = 400
  11. fontcharset fontcharset = gb2312charset!
  12. fontpitch fontpitch = variable!
  13. string facename = "宋体"
  14. long textcolor = 33554432
  15. borderstyle borderstyle = stylelowered!
  16. string picturename[] = {"Application!","ArrangeTables5!","Custom079!"}
  17. long picturemaskcolor = 536870912
  18. long statepicturemaskcolor = 536870912
  19. end type
  20. global uo_tv_bill_event uo_tv_bill_event
  21. type variables
  22. datastore id_bills
  23. datastore id_events
  24. long ins_billtype = 0
  25. long ins_eventtype = 0
  26. end variables
  27. forward prototypes
  28. protected subroutine pf_build_billtype (long arg_handle)
  29. protected subroutine pf_build_eventtype (long arg_handle, long arg_billtype)
  30. end prototypes
  31. protected subroutine pf_build_billtype (long arg_handle);long ll_hand
  32. long ll_row
  33. TreeViewItem l_tvi
  34. for ll_row = 1 to id_bills.rowCount()
  35. l_tvi.label = id_bills.object.bill_name[ll_row]
  36. l_tvi.PictureIndex = 2
  37. l_tvi.SelectedPictureIndex = 2
  38. l_tvi.data = id_bills.object.billtype[ll_row]
  39. ll_hand = this.insertitemlast(arg_handle, l_tvi)
  40. pf_build_eventtype(ll_hand, id_bills.object.billtype[ll_row])
  41. next
  42. end subroutine
  43. protected subroutine pf_build_eventtype (long arg_handle, long arg_billtype);long ll_hand
  44. long ll_row
  45. TreeViewItem l_tvi
  46. id_events.SetFilter('(billtype = ' + string(arg_billtype) + ')')
  47. id_events.Filter()
  48. for ll_row = 1 To id_events.RowCount()
  49. l_tvi.label = id_events.object.eventname[ll_row]
  50. l_tvi.PictureIndex = 3
  51. l_tvi.SelectedPictureIndex = 3
  52. l_tvi.data = id_events.object.eventtype[ll_row]
  53. ll_hand = this.insertitemlast(arg_handle, l_tvi)
  54. next
  55. id_events.SetFilter('')
  56. id_events.Filter()
  57. end subroutine
  58. on uo_tv_bill_event.create
  59. end on
  60. on uo_tv_bill_event.destroy
  61. end on
  62. event constructor;id_bills = Create datastore
  63. id_bills.DataObject = 'data_event_bill_def'
  64. id_events = Create datastore
  65. id_events.DataObject = 'data_event_event_def'
  66. long ll_hand
  67. DO UNTIL This.FindItem(RootTreeItem!, 0) = -1
  68. This.DeleteItem(0)
  69. LOOP
  70. ll_hand = this.insertitemlast(0, '单据分类', 1)
  71. pf_build_billtype(ll_hand)
  72. this.Expanditem(ll_hand)
  73. end event
  74. event destructor;destroy id_bills
  75. destroy id_events
  76. end event
  77. event selectionchanged;TreeViewItem l_tvi
  78. long ll_hand
  79. long ll_parent
  80. ins_billtype = 0
  81. ins_eventtype = 0
  82. ll_hand = this.Finditem(CurrentTreeItem!, 0)
  83. if this.GetItem(ll_hand, l_tvi) = 1 then
  84. if l_tvi.level = 1 then
  85. ins_billtype = 0
  86. ins_eventtype = 0
  87. elseif l_tvi.level = 2 then
  88. ins_billtype = l_tvi.data
  89. ins_eventtype = 0
  90. elseif l_tvi.level = 3 then
  91. ins_eventtype = l_tvi.data
  92. ll_parent = this.FindItem(ParentTreeItem!, ll_hand)
  93. if this.GetItem(ll_parent, l_tvi) = 1 then
  94. ins_billtype = l_tvi.data
  95. else
  96. ins_eventtype = 0
  97. end if
  98. end if
  99. THIS.ExpandItem(ll_hand)
  100. end if
  101. end event