Jump to content

Menu Reference of Tree control


i2dx

Recommended Posts

Posted

Hi Folks,

has someone yet figured out, where i can find a reference to the shortcut menu of a control (tree) somewhere else then in the event structure?

I want to implement the following functionality:

i have a tree with several "types" of elements, with different rightclick options

e.g.

item type: apple --> eat, throw, ignore

item type car --> get in, get out, drive

item type tree --> hug, cut down, count leaves ...

etc

if a user clicks on a tree (detected by value change) i want to change the shortcut (rightclick) menu in "background" so that it is allready there, when the rightclick occurs.

am i on the wrong track, or has someone an idea?

thx and cheers,

cb

example:

Download File:post-885-1136738123.vi

Posted

There is a trick. In the menu activation event frame, you can obtain the tag of the item that the user right-clicked on. Use the Tree's Point To Row Column menthod:

post-17-1136744007.png?width=400

Converts a pixel coordinate to a tag-column pair in the coordinates of the control. This method also returns whether the point is inside the bounds of the content rectangle and whether the point is within the custom symbol of the cell.

When integrated into your code, it looks like this:

post-17-1136743857.png?width=400

Here is your example, with my edits:

Download File:post-17-1136743870.vi

Posted

hey, that's cool

thx!

but then, my fear, it could be to slow to set the items of the right-menu with the activation event did not come true ...

Posted
but then, my fear, it could be to slow to set the items of the right-menu with the activation event did not come true ...
Can you explain a little bit more of what your fears are? It seems that Jim's edited version works fast and does everything you need.
Posted

i first fear was, that you could see the elements change or get the wrong ones in my version, because the "value change" event has to be detected first.

now it seems, the menu activation event is pretty fast, but i have not yet tested with slower machines or deeply nested menu-structures ...

furthermore, i am glad with jims solution ...

Posted

Jim,

This is off-topic, but something that got me curious. Can you share with us how you get your BD annotations? I can't find any built-in LV decorations that can be modified to reproduce the thick-lined ovals and rounded boxes, arrows, etc that I see. Some of your stuff looks enough like the Pro differencing toolkit that I'm wondering if you've got some tricks up your sleeve. Or maybe you're just retouching your screenshots with MS-Paint...

Left wondering,

Dave

Posted
Jim,

This is off-topic, but something that got me curious. Can you share with us how you get your BD annotations? I can't find any built-in LV decorations that can be modified to reproduce the thick-lined ovals and rounded boxes, arrows, etc that I see. Some of your stuff looks enough like the Pro differencing toolkit that I'm wondering if you've got some tricks up your sleeve. Or maybe you're just retouching your screenshots with MS-Paint...

Left wondering,

Dave

David, I use SnagIt.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.