[Module] TreeEx - Gadget (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] TreeEx - Gadget (all OS)

Post by Thorsten1867 »

TreeEx Gadget - Module (all OS / DPI / 64Bit)

Tree Gadget with additional columns

Image

Code: Select all

; TreeEx::AddColumn()           - similar to 'AddGadgetColumn()'
; TreeEx::AddItem()             - similar to 'AddGadgetItem()'
; TreeEx::ClearItems()          - similar to 'ClearGadgetItems()'
; TreeEx::CountItems()          - similar to 'CountGadgetItems()'
; TreeEx::DisableReDraw()       - disable redraw
; TreeEx::Gadget()              - similar to 'TreeGadget()'
; TreeEx::GetItemColor()        - similar to 'GetGadgetItemColor()'
; TreeEx::GetItemData()         - similar to 'GetGadgetItemData()'
; TreeEx::GetItemState()        - similar to 'GetGadgetItemState()'
; TreeEx::GetItemText()         - similar to 'GetGadgetItemText()'
; TreeEx::GetLabelState()       - similar to 'GetGadgetItemState()', but label instead of column
; TreeEx::GetLabelText()        - similar to 'GetGadgetItemText()',  but label instead of column
; TreeEx::GetState()            - similar to 'GetGadgetState()'
; TreeEx::Hide()                - similar to 'HideGadget()'
; TreeEx::RemoveItem()          - similar to 'RemoveGadgetItem()'
; TreeEx::SaveColorTheme()      - save a custom color theme
; TreeEx::SetAutoResizeColumn() - column that is reduced when the vertical scrollbar is displayed.
; TreeEx::SetAutoResizeFlags()  - [#MoveX|#MoveY|#Width|#Height]
; TreeEx::SetColor()            - similar to 'SetGadgetColor()'
; TreeEx::SetColorTheme()       - set or load a color theme
; TreeEx::SetFont()             - similar to 'SetGadgetFont()'
; TreeEx::SetHeaderAttribute()  - set header attribute (e.g. align)
; TreeEx::SetHeaderFont()       - set header font
; TreeEx::SetItemColor()        - similar to 'SetGadgetItemColor()'
; TreeEx::SetItemData()         - similar to 'SetGadgetItemData()'
; TreeEx::SetItemImage()        - similar to 'SetGadgetItemImage()'
; TreeEx::SetItemState()        - similar to 'SetGadgetItemState()'
; TreeEx::SetItemText()         - similar to 'SetGadgetItemText()'
; TreeEx::SetLabelState()       - similar to 'SetGadgetItemState()', but label instead of column
; TreeEx::SetLabelText()        - similar to 'SetGadgetItemText()',  but label instead of column
; TreeEx::SetState()            - similar to 'SetGadgetState()'
Download: TreeExModule.pbi
Last edited by Thorsten1867 on Fri Dec 20, 2019 2:54 pm, edited 1 time in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2057
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: [Module] TreeEx - Gadget (all OS)

Post by Andre »

Looks and works very nice, thank you for sharing! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
mrv2k
User
User
Posts: 51
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

Re: [Module] TreeEx - Gadget (all OS)

Post by mrv2k »

Is there any way to detect which sub item has been selected?

*Edit - GetItemAttribute was still in the source code but not declared. I got it working but not the #SubItem constant. I'm using the #PB_TREE_SUBITEM constant at the moment.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] TreeEx - Gadget (all OS)

Post by Thorsten1867 »

Code: Select all

TreeEx::GetItemAttribute(#Tree, 1, TreeEx::#SubLevel) ; returns level of the item
TreeEx::GetItemState(#Tree, 1)                        ; returns state of the item (TreeEx::#Selected | TreeEx::#Checked)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
mrv2k
User
User
Posts: 51
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

Re: [Module] TreeEx - Gadget (all OS)

Post by mrv2k »

Thanks!

I have noticed that if you have multiple nodes and expand one of them, the scroll area resizes as if you have expanded all the nodes and not to the size of the nodes you've expanded.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] TreeEx - Gadget (all OS)

Post by Thorsten1867 »

Update:
  • ScrollBarGadget() replaced by drawing routine
  • Attribute #ScrollBar [#ScrollBar_Default/#ScrollBar_Frame/#ScrollBar_DragPoint]
  • SetColor() -> [#ScrollBar_FrontColor/#ScrollBar_BackColor/#ScrollBar_BorderColor/#ScrollBar_ButtonColor/#ScrollBar_ThumbColor]
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
mrv2k
User
User
Posts: 51
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

Re: [Module] TreeEx - Gadget (all OS)

Post by mrv2k »

Hi Thorsten

Couple of issues with the scrollbar...

1. When you scroll up and down the bar moves faster than the mouse
2. The bar stops scrolling when the mouse moves off of the gadget.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] TreeEx - Gadget (all OS)

Post by Thorsten1867 »

Update: Cursor keys
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2057
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: [Module] TreeEx - Gadget (all OS)

Post by Andre »

Thorsten1867 wrote:Update: Cursor keys
Thank you, Thorsten!

@mrv2k: your problems should also be gone with the latest update now :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
jackymb
User
User
Posts: 16
Joined: Wed Aug 11, 2004 7:37 pm
Location: AIX en PROVENCE (France)

Re: [Module] TreeEx - Gadget (all OS)

Post by jackymb »

Hi Thorsten,

Thank you very much for this module.

is it possible to add the edition of an item when the column is text? (by simple clik , double click or otherwise)
Windows 10 x64/86 - PB 5.73LTS (x86 & x64)
_________________________________________
~English is not my native language I'm using a translator~
Post Reply