Page 1 of 1

Pure basic personal Tree view (Version 3.0 Beta 8)

Posted: Sun Jun 30, 2019 1:51 pm
by microdevweb
Hello everybody,

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()
For example :

Image


Image

Image

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"

Re: Pure basic personal Tree view (Version 3.0) Beta 1

Posted: Tue Jul 02, 2019 2:24 am
by Zebuddi123
Hi microdevweb

Thank you for sharing thats really handy and excellent :D

Zebuddi. :)

Re: Pure basic personal Tree view (Version 3.0) Beta 1

Posted: Tue Jul 02, 2019 8:47 am
by GG
Thank you microdevweb, very nice piece of code !

Re: Pure basic personal Tree view (Version 3.0) Beta 2

Posted: Tue Jul 02, 2019 9:25 am
by microdevweb
Hello all,

New version Beta 2

Added Button class

Re: Pure basic personal Tree view (Version 3.0) Beta 3

Posted: Tue Jul 02, 2019 11:16 am
by microdevweb
new Version Beta 3

Add : scroll area activate when you resize the container

Re: Pure basic personal Tree view (Version 3.0) Beta 4

Posted: Tue Jul 02, 2019 11:43 am
by microdevweb
new Beta 4

added : tree\removeItem(item)

Re: Pure basic personal Tree view (Version 3.0) Beta 4

Posted: Wed Jul 03, 2019 1:05 pm
by microdevweb
Hello guys,

It's upgrade to beta 5.

Added : some methods for personalize your treeview.
  • setColors(back,front,line)
  • setSelectedColors(back,front)
  • setTolltipColors(back,front)
  • setExpandedIcons(expanded,collapsed)
  • setCheckedIcons(checked,unChecked)
Fixed : some bugs

Re: Pure basic personal Tree view (Version 3.0 Beta 6)

Posted: Mon Jul 08, 2019 8:51 am
by microdevweb
Beta 6 is out

Re: Pure basic personal Tree view (Version 3.0 Beta 7)

Posted: Tue Jul 09, 2019 11:15 am
by microdevweb
Beta 7 is out

added enableDragEvent(target)

Re: Pure basic personal Tree view (Version 3.0 Beta 7)

Posted: Fri Jul 12, 2019 11:27 am
by microdevweb
Hello Guys,

For make the test more easier i've designed a launcher

Re: Pure basic personal Tree view (Version 3.0 Beta 7)

Posted: Fri Jul 12, 2019 11:53 am
by Mijikai
This looks really promising :)

What i found:

Free is not implemented:

Code: Select all

Procedure TREE_free(*this._TREE)
  With *this
    
  EndWith
EndProcedure
All ToolTips flicker for me.

I ony could run it via the main.pb because the example project requests classes that are not provided.

Re: Pure basic personal Tree view (Version 3.0 Beta 7)

Posted: Fri Jul 12, 2019 12:45 pm
by microdevweb
@Mijikai,

Thanks i look for that

Re: Pure basic personal Tree view (Version 3.0 Beta 7)

Posted: Fri Jul 12, 2019 12:57 pm
by microdevweb
Beta 8 is out

fixed : tree\free()