i2dx Posted January 8, 2006 Report Share Posted January 8, 2006 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 Quote Link to comment
Jim Kring Posted January 8, 2006 Report Share Posted January 8, 2006 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: 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: Here is your example, with my edits: Download File:post-17-1136743870.vi Quote Link to comment
i2dx Posted January 8, 2006 Author Report Share Posted January 8, 2006 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 ... Quote Link to comment
Michael Aivaliotis Posted January 10, 2006 Report Share Posted January 10, 2006 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. Quote Link to comment
i2dx Posted January 10, 2006 Author Report Share Posted January 10, 2006 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 ... Quote Link to comment
David Boyd Posted January 10, 2006 Report Share Posted January 10, 2006 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 Quote Link to comment
Jim Kring Posted January 10, 2006 Report Share Posted January 10, 2006 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.