PDA

View Full Version : How to use sort() in GuiTreeViewCtrl?


Inverness
10-30-2007, 04:13 AM
I checked the Wiki for this and it only says the variable is either a string or an integer and I have no idea how to use it. Honestly, the lack of documentation is irritating.

Does anyone know how to use the sort() and its options in the GuiTreeViewCtrl?

zokemon
10-30-2007, 04:46 AM
Yeah I've never figured it out my self. Would be somewhat useful to know even though there has been very few instances I could have it before.

Inverness
11-01-2007, 07:05 AM
*bump*

I forgot I made this topic, so does anyone know?

Admins
11-02-2007, 01:43 AM
It's working similar to the GuiListViewCtrl sorting.

Options:
treeview.sortmode = "value" or "name" or "extension"
treeview.sortorder = "ascending" or "descending"
treeview.groupsortorder = "ascending" or "descending"
node.sortvalue - number
node.sortgroup - number

Sorting:
compare by node.sortgroup
if that is the same:
if mode is "value": compare by node.sortvalue
if mode is "extension": compare by extractfileext(node.name)
if they are still the same, compare simply by their name

Inverness
11-03-2007, 12:42 AM
Thanks I'm glad I finally got that sorted out, no pun intended.