Jump to content

Firing the Context Menu Activate event programmatically?


Jim Kring

Recommended Posts

Any takers? I guess that everyone is just as stumped as I am. :)

My guess is that you cannot do it via LabVIEW. The best suggestion I can give is to use dialog windows to mimic context menus. I've to face this same problem in a few weeks as I'd like to activate the context menu when user clicks the left button, not the right one.

Tomi

Link to comment
...I've to face this same problem in a few weeks as I'd like to activate the context menu when user clicks the left button, not the right one.

Tomi

Actually, activating on the left click instead of the right is fairly easy. If you use the "mouse down?" filtering event you can dynamically tell LV which button has been clicked (see image below).

post-121-1170883745.png?width=400

So far, the trick for dynamically firing the menu activation event would be to be able to dynamically fire the "mouse down?" event. If we could do that, the other part is easy.

PJM

  • Like 1
Link to comment
So far, the trick for dynamically firing the menu activation event would be to be able to dynamically fire the "mouse down?" event. If we could do that, the other part is easy.

I have occasionally wanted to do exactly that, programmatically fire a built-in (non-user) event. This would be very interesting and useful, but I would imagine it would require a lot of care and know-how on the developers side to use it correctly and not cause bad side effects.

Link to comment

QUOTE(dsaunders @ Feb 7 2007, 06:45 PM)

I have occasionally wanted to do exactly that, programmatically fire a built-in (non-user) event. This would be very interesting and useful, but I would imagine it would require a lot of care and know-how on the developers side to use it correctly and not cause bad side effects.

You can cause notify event cases to execute programmatically by creating User Events whose data type masks the event data itself. For instance, for a Mouse Move event, you could create a User Event with a cluster containing a Ctrl refnum, Coordinates cluster, etc. If the data matches up exactly, you can register the event case for the User Event alongside the notify event. Note, though, that generating the User Event only causes the Event case to execute, not the other registered event (like moving the mouse). You also can't mask filter events like Mouse Down? with User Events.

Link to comment

QUOTE(ragglefrock @ Feb 11 2007, 03:43 AM)

You can cause notify event cases to execute programmatically by creating User Events whose data type masks the event data itself. For instance, for a Mouse Move event, you could create a User Event with a cluster containing a Ctrl refnum, Coordinates cluster, etc. If the data matches up exactly, you can register the event case for the User Event alongside the notify event. Note, though, that generating the User Event only causes the Event case to execute, not the other registered event (like moving the mouse). You also can't mask filter events like Mouse Down? with User Events.

Thanks, this is an interesting trick. However it doesn't solve the problem of genereting system events, only allows to handle system events and user events in the same event case.

Link to comment

Join the conversation

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

Guest
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.