/**********************************************************/
//function : 遍历所有的项,查找目标项
//uf_find_item
//para :
// 1. handle : 项目句柄 long
// 2. a_data : 目标项数据 string
// 3. ai_type: 查找类型 int
//return : (none)
//
//date
//comment :
// ai_type = 1 是准确查找
// ai_type = 2 是模糊查找
/*********************************************************/
long l_ret,l_find
treeviewitem ltvi_find
//没有找到
ib_find = false
if isnull(a_data) then
// messagebox(ga_app.dwmessagetitle,”请输入查询条件 !”,stopsign!)
return -1
end if
//do while yield()
//loop
do while handle <> -1 and not ib_find
this.getitem(handle,ltvi_find)
if ai_type = 1 then //是准确查找
if string(ltvi_find.data) = a_data then
selectitem(handle)
ib_find = true
return handle
end if
else //是模糊查找
if pos(ltvi_find.label,string(a_data)) > 0 then
selectitem(handle)
if messagebox(,是否查找下一项 ” +&
string(a_data) + ” ,question!,yesno!,2) = 2 then
ib_find = true
return handle
end if
end if
end if
//—判断该项是否有子项,有则,递归调用,处理返回值取得目标项句柄—//
l_ret = this.finditem(childtreeitem!,handle)
if l_ret >0 then
l_find = this.uf_find_item(l_ret,a_data,ai_type)
end if
handle = this.finditem(nexttreeitem!,handle)
loop
if ib_find then
return l_find
else
return -1
end if
//=====================================
////ue_deleteitems
//删除所有树形节点的函数
//long al_handle
//wuhai
//20040725
//======================================
long ll_chi_handle,ll_parent_handle
long ll_c
ll_chi_handle = this.finditem (childtreeitem! , al_handle )
if ll_chi_handle > 0 then
this.event ue_deleteitems(ll_chi_handle ) //递归函数
end if
ll_parent_handle = this.finditem (parenttreeitem! , al_handle)
if al_handle =-1 and ll_parent_handle = -1 and ll_chi_handle= -1 then return
this.deleteitem(al_handle)
il_c ++
this.event ue_deleteitems(ll_parent_handle ) //递归函数