For a personal project i've needed of my treeview. But i look this usage and i think it is not easier of all. So i've decided to design a new, in full objet and really more easier than old.
That is a beta version, i've not really finished it. I have to add button options and also manage the sroll area.
To Github
Download
Wiki User manual
History of version :
- Beta 6 -> fixed -> some bugs
- Beta 7 -> added ->enableDragEvent(target)
- Beta 8 -> fixed ->tree\free()



How testing
- Run your PureBasic Editor
- Copy and save this below code in your directory
- Agree to download the package
- Open the file EXAMPLE/main.pb
- Run the file
- You can also decomment the last line and run again
Code: Select all
; ******************************************************************************
; AUTHOR : MicrodevWeb
; MODULE : TreeView
; PROCESS : load package
; ******************************************************************************
EnableExplicit
Procedure loadPackage()
Protected zipName.s = "PACKAGE.zip"
If MessageRequester("Download Package","Do you agree to download the tree view package form github?",#PB_MessageRequester_YesNo) = #PB_MessageRequester_No
End
EndIf
If Not InitNetwork()
MessageRequester("Network error","Cannot connect to internet",#PB_MessageRequester_Error)
End
EndIf
If Not ReceiveHTTPFile("https://github.com/microdevweb/PB_TREE_VIEW_3.0/archive/master.zip",zipName)
MessageRequester("Download error","Cannot download the package",#PB_MessageRequester_Error)
End
EndIf
#PACKER = 0
CreateDirectory("TREE")
CreateDirectory("TREE/CLASS")
CreateDirectory("TREE/IMG")
CreateDirectory("EXAMPLE")
CreateDirectory("EXAMPLE/IMG")
UseZipPacker()
OpenPack(#PACKER,zipName)
If ExaminePack(#PACKER)
While NextPackEntry(#PACKER)
Protected dirName.s = StringField(PackEntryName(#PACKER),2,"/")
If PackEntryType(#PACKER) = #PB_Packer_File
Protected fileName.s = RemoveString(PackEntryName(#PACKER),"PB_TREE_VIEW_3.0-master/")
If Not UncompressPackFile(#PACKER,fileName)
MessageRequester("Download error","Cannot unzip file "+fileName,#PB_MessageRequester_Error)
End
EndIf
EndIf
Wend
EndIf
ClosePack(#PACKER)
DeleteFile(zipName)
EndProcedure
loadPackage()
;XIncludeFile "EXAMPLE/main.pb"