Dear All,
How to Seek/Search an Item in xBrowse Tree?
Kind regards,
Frances
oBrw:bSeek := { |c| SeekTree( oBrw, c ) }
//.....
//.....
function SeekTree( oBrw, cSeek )
local oTree := oBrw:oTree
local oFound, oItem := oTree:oFirst
local lFound := .f.
cSeek := Upper( cSeek )
do while oItem != nil
if oItem:cPrompt = cSeek
oFound := oItem
exit
endif
oItem := oItem:GetNext()
enddo
if oFound != nil
oBrw:oTreeItem := oFound
lFound := .t.
endif
return lFound
oBrw:bSeek := { |c| uSeekTree( oBrw, Upper(c) ) }
...
STATIC FUNCTION uSeekTree( oBrw, cSeek )
LOCAL oTree := oBrw:oTree
LOCAL oFound, oItem := oTree:oFirst
LOCAL lFound := .F.
oBrw:cSeek := cSeek
DO WHILE oItem <> NIL
IF oBrw:cSeek $ Upper(SubStr(oItem:cPrompt,1,Len(oBrw:cSeek)))
oFound := oItem
EXIT
ENDIF
oItem := oItem:GetNext()
ENDDO
IF oFound <> nil
oBrw:oTreeItem := oFound
oBrw:Refresh()
lFound := .t.
ENDIF
RETURN lFound
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 84 guests