VirtualStringTree displays incorrect image

63 views
Skip to first unread message

Daniel England

unread,
Feb 28, 2015, 8:48:02 AM2/28/15
to virtual-...@googlegroups.com
Heyas!

I have been using VirtualTree controls for a long time now but I didn't know this group existed before.

I'm having a bit of a problem with a VirtualStringTree in grid mode...  I can't get it to use the correct image.

I posted an issue notice on the GitHub repository but I thought I might ask about the problem in here.  I'll attach the source code.

The problem is that I have 5 images in the ImageList and trying to display image of index 4 in the tree shows the first (index 0) instead.

Has anyone come across this issue before and know how to fix it?  I tried tracking down the problem but I couldn't see it.  It seems the call to DoDraw is occurring properly...

I'm using Windows7 x64 with Delphi XE4 and VirtualTrees 5.5.3.

TIA!



Daniel.
IncorrectIcons.7z

Daniel England

unread,
Feb 28, 2015, 8:49:07 AM2/28/15
to virtual-...@googlegroups.com
Sorry about the double posting.  It seems that Chrome had some kind of problem when I posted it.


Daniel.

Daniel England

unread,
Feb 28, 2015, 11:22:08 AM2/28/15
to virtual-...@googlegroups.com
Guys,

Hmm..  Sorry about that question, I've gotten the answer already.

It seems I have to "respect" the Kind parameter.  For some reason unknown to me, the "state" or "overlay" kinds are being requested for that particular node.  

I really don't understand why they would be, that is for that particular node but it seems that this is the problem.  The problem occurred in a program where the last node was always being selected and the node with the issue wasn't the last.  It also happens in my example where it is the last but there is no selection?  Its a strange, unintuitive issue.

I'll have to keep it in mind.  I must have forgotten to account for it since I last was using images in a VirtualStringTree (which was a while ago).


Daniel.

Joachim Marder

unread,
Mar 11, 2015, 5:09:15 PM3/11/15
to virtual-...@googlegroups.com, mewpo...@hotmail.com
Hi.


> For some reason unknown to me, the "state" or "overlay" kinds are being requested for that particular node.  
> I really don't understand why they would be

It is because overlay images are supported in general, and this event is used to ask whether or not you want them. Simply pass -1 if you don't want them.

Joachim


--
You received this message because you are subscribed to the Google Groups "Virtual Treeview" group.
To unsubscribe from this group and stop receiving emails from it, send an email to virtual-treevi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages