[MaxGUI] TreeView

BlitzMax Forums/BlitzMax Beginners Area/[MaxGUI] TreeView

degac(Posted 2005) [#1]
I'm testing the CreateTreeView command, and I tryed to add the icons to the elements: if I don't indicate what icon I want to show (or nothing to show, I think is -1) I obtain ALL the elements of the TreeView with an icon displayed. It's a bug or I missed something?
From the documentation examples:
Strict 

Local window:TGadget=CreateWindow("My Window",50,50,240,240)
Local treeview:TGadget=CreateTreeView(0,0,200,200,window)
Local strip:ticonStrip=LoadIconStrip("toolbar.bmp") 'ADDED

SetGadgetLayout treeview,2,2,2,2

Local root:TGadget=TreeViewRoot(treeview)

SetGadgetIconStrip(root,strip) '<--- ADDED

Local help:TGadget=AddTreeViewNode("Help",root)
AddTreeViewNode "topic 1",help
AddTreeViewNode "topic 2",help
AddTreeViewNode "topic 3",help

Local projects:TGadget=AddTreeViewNode("Projects",root)
AddTreeViewNode "project 1",projects
AddTreeViewNode("project 2",projects)
AddTreeViewNode("project 3 is a big waste of time",projects)

While WaitEvent()
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend



degac(Posted 2005) [#2]
after 3 days none can reply...
I can't find a solution or it is a bug already known?


EOF(Posted 2005) [#3]
Looks like Max uses the first icon in the strip as a default.

Have a look at this though ...

I did this by using the first icon in the strip as a 'blank'.
Since it did not look right I filled icon 0 with dots to extend the treeview branch connection ..


Test Source:
Strict 

Local window:TGadget=CreateWindow("My Window",50,50,240,240)
Local treeview:TGadget=CreateTreeView(0,0,200,200,window)

SetGadgetLayout treeview,2,2,2,2

Local root:TGadget=TreeViewRoot(treeview)

Local strip:TIconStrip=LoadIconStrip("icontest.bmp") 'ADDED
SetGadgetIconStrip root,strip '<--- ADDED


Local help:TGadget=AddTreeViewNode("Help",root)
AddTreeViewNode "topic 1",help
AddTreeViewNode "topic 2",help,2
AddTreeViewNode "topic 3",help

Local projects:TGadget=AddTreeViewNode("Projects",root)
AddTreeViewNode "project 1",projects,1
AddTreeViewNode "project 2",projects,1
AddTreeViewNode "project 3 is a big waste of time",projects,2

' ModifyGadgetItem

While WaitEvent()
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
		End
	End Select
Wend


Test Icon:



degac(Posted 2005) [#4]
so it is a 'normal' behaviour. Ok thanks I will use 'fake' icons to override the problem like you suggest


Matthew Smith(Posted 2005) [#5]
As far as Windows goes, the first icon is always the default - as per VB6 and .Net.


ozak(Posted 2006) [#6]
I can't get the damn thing to use incbin'ed icons. Anyone?


Diablo(Posted 2006) [#7]
This works fine for me ozak:



ozak(Posted 2006) [#8]
I get null on loadiconstrip. With bmp and png. Dunno what's wrong :)


Diablo(Posted 2006) [#9]
mmm. this is indeed a wired bug - what os are u running from? apart that it could also be were u put the icontest.bmp graphics, it must be in the exaxtally the same place as the bmx file.


ozak(Posted 2006) [#10]
It is in the same place, and I'm using WinXP Home here.

Edit: Forgot to include BRL.Ramstream and BRL.PNGLoader.
Works now :)