Jump to content
softtouch

VirtualStringTree - detect click on image

Recommended Posts

I have a column where each node has an image, set via the onGetImageIndex event. The image and the celltext are displayed properly.

How can I detect that the user click the image and not the text in the cell?

Using tree.GetHintInfoAt(...) will always return [hionItem] in the hitpositions property, independent I click the image or the text.

What I read so far, it should return [hiOnNormalIcon] too when I click the image, but it doesn't.

 

Here is a simple text code for the onMouseDown event:

var
  hi:THitInfo;
begin
  treeSteps.GetHitTestInfoAt(x,y,true,hi);
  if (hi.HitNode<>nil) and (hi.HitColumn=6) then
  begin
    if hiOnNormalIcon in hi.HitPositions then
    begin
      caption:='1'; // Never called
    end;
  end;
end;

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×