Pure basic personal Tree view (Version 3.0 Beta 8)

Share your advanced PureBasic knowledge/code with the community.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

Pure basic personal Tree view (Version 3.0 Beta 8)

Post 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"
Last edited by microdevweb on Fri Jul 12, 2019 12:59 pm, edited 12 times in total.
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 796
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

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

Post by Zebuddi123 »

Hi microdevweb

Thank you for sharing thats really handy and excellent :D

Zebuddi. :)
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
GG
Enthusiast
Enthusiast
Posts: 266
Joined: Tue Jul 26, 2005 12:02 pm
Location: Lieusaint (77), France

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

Post by GG »

Thank you microdevweb, very nice piece of code !
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

Hello all,

New version Beta 2

Added Button class
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

new Version Beta 3

Add : scroll area activate when you resize the container
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

new Beta 4

added : tree\removeItem(item)
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post 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
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

Beta 6 is out
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

Beta 7 is out

added enableDragEvent(target)
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

Hello Guys,

For make the test more easier i've designed a launcher
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

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

Post 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.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

@Mijikai,

Thanks i look for that
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
User avatar
microdevweb
Enthusiast
Enthusiast
Posts: 179
Joined: Fri Jun 13, 2014 9:38 am
Location: Belgique

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

Post by microdevweb »

Beta 8 is out

fixed : tree\free()
Use Pb 5.73 lst and Windows 10

my mother-language isn't english, in advance excuse my mistakes.
Post Reply