$PBExportHeader$uo_tv_bill_event.sru forward global type uo_tv_bill_event from treeview end type end forward global type uo_tv_bill_event from treeview integer width = 818 integer height = 1440 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 borderstyle borderstyle = stylelowered! string picturename[] = {"Application!","ArrangeTables5!","Custom079!"} long picturemaskcolor = 536870912 long statepicturemaskcolor = 536870912 end type global uo_tv_bill_event uo_tv_bill_event type variables datastore id_bills datastore id_events long ins_billtype = 0 long ins_eventtype = 0 end variables forward prototypes protected subroutine pf_build_billtype (long arg_handle) protected subroutine pf_build_eventtype (long arg_handle, long arg_billtype) end prototypes protected subroutine pf_build_billtype (long arg_handle);long ll_hand long ll_row TreeViewItem l_tvi for ll_row = 1 to id_bills.rowCount() l_tvi.label = id_bills.object.bill_name[ll_row] l_tvi.PictureIndex = 2 l_tvi.SelectedPictureIndex = 2 l_tvi.data = id_bills.object.billtype[ll_row] ll_hand = this.insertitemlast(arg_handle, l_tvi) pf_build_eventtype(ll_hand, id_bills.object.billtype[ll_row]) next end subroutine protected subroutine pf_build_eventtype (long arg_handle, long arg_billtype);long ll_hand long ll_row TreeViewItem l_tvi id_events.SetFilter('(billtype = ' + string(arg_billtype) + ')') id_events.Filter() for ll_row = 1 To id_events.RowCount() l_tvi.label = id_events.object.eventname[ll_row] l_tvi.PictureIndex = 3 l_tvi.SelectedPictureIndex = 3 l_tvi.data = id_events.object.eventtype[ll_row] ll_hand = this.insertitemlast(arg_handle, l_tvi) next id_events.SetFilter('') id_events.Filter() end subroutine on uo_tv_bill_event.create end on on uo_tv_bill_event.destroy end on event constructor;id_bills = Create datastore id_bills.DataObject = 'data_event_bill_def' id_events = Create datastore id_events.DataObject = 'data_event_event_def' long ll_hand DO UNTIL This.FindItem(RootTreeItem!, 0) = -1 This.DeleteItem(0) LOOP ll_hand = this.insertitemlast(0, '单据分类', 1) pf_build_billtype(ll_hand) this.Expanditem(ll_hand) end event event destructor;destroy id_bills destroy id_events end event event selectionchanged;TreeViewItem l_tvi long ll_hand long ll_parent ins_billtype = 0 ins_eventtype = 0 ll_hand = this.Finditem(CurrentTreeItem!, 0) if this.GetItem(ll_hand, l_tvi) = 1 then if l_tvi.level = 1 then ins_billtype = 0 ins_eventtype = 0 elseif l_tvi.level = 2 then ins_billtype = l_tvi.data ins_eventtype = 0 elseif l_tvi.level = 3 then ins_eventtype = l_tvi.data ll_parent = this.FindItem(ParentTreeItem!, ll_hand) if this.GetItem(ll_parent, l_tvi) = 1 then ins_billtype = l_tvi.data else ins_eventtype = 0 end if end if THIS.ExpandItem(ll_hand) end if end event