/**********************************************************/
//function : 遍歷所有的項(xiàng),查找目標(biāo)項(xiàng)
//uf_find_item
//para :
// 1. handle : 項(xiàng)目句柄 long
// 2. a_data : 目標(biāo)項(xiàng)數(shù)據(jù) string
// 3. ai_type: 查找類型 int
//return : (none)
//
//date
//comment :
// ai_type = 1 是準(zhǔn)確查找
// 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 //是準(zhǔn)確查找
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('','是否查找下一項(xiàng) "' +&
string(a_data) + ' "' ,question!,yesno!,2) = 2 then
ib_find = true
return handle
end if
end if
end if
//---判斷該項(xiàng)是否有子項(xiàng),有則,遞歸調(diào)用,處理返回值取得目標(biāo)項(xiàng)句柄---//
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
//刪除所有樹形節(jié)點(diǎn)的函數(shù)
//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 ) //遞歸函數(shù)
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 ) //遞歸函數(shù)