01-14-2013 02:36 AM
I could have sworn it generated a menu on double-click when I tested it on Friday but today it seems to be working.....
Hmm, maybe my 2011 Installation at home is not OK.
Shane.
01-14-2013 04:21 AM
Strangely, in the tst's example I can't get the Stop Value change event to work.
Here is a slightly simpler vi completely time driven. I owe to tst the mouse simulation part, though, that I didn't have at hand.
01-14-2013 07:55 AM
Yes, both of these achieve what I was looking for. <BEER>
Wouldn't it be nice, however, if we could simply programatically activate the menu shortcut and bypass the whole mouse simulation part? This would then be cross-platform also.
I personally feel a LOT more UI actions should be programatically available for activation, not just the menu shortcuts.
Shane.
01-14-2013 08:06 AM
Well, NI has improved and added a few UI simulation methods to the Application class, but I agree that the list is still too short.
@pincpanter wrote:
Strangely, in the tst's example I can't get the Stop Value change event to work.
My example was simply a quick modification of the earlier example, so I didn't bother making it too clean or efficient. The reason the value change event doesn't work is that the logic to discard the event is faulty, so some valid events (like the left click) are discarded.
01-14-2013 09:20 AM
@tst wrote:
Well, NI has improved and added a few UI simulation methods to the Application class, but I agree that the list is still too short.
Intriguing. I was unaware of this. In which LV version? Which functions?
Shane
01-14-2013 10:25 AM - edited 01-14-2013 10:26 AM
I don't have it in front of me, but I think that the only one which would be relevant here would be triggering a menu item, which I think was added around 2010-11. The rest are more related to IDE automation. The existing ones should be in the Application class, under UI.
01-14-2013 10:48 AM - edited 01-14-2013 10:50 AM
tst ha scritto:My example was simply a quick modification of the earlier example, so I didn't bother making it too clean or efficient. The reason the value change event doesn't work is that the logic to discard the event is faulty, so some valid events (like the left click) are discarded.
OK, I didn't mean to criticize your work. My code needs optimization too.
Hey Shane, may I get a non-alcoholic virtual beer instead?
01-14-2013 11:24 AM
> Wouldn't it be nice, however, if we could simply programatically activate the menu shortcut and bypass the whole mouse simulation part? This would then be cross-platform also.
You can use a subVI the simulate a popup menu as I suggested before.
Beside, simulate a click with SendInput or kb_event is not robust method. As it sends the click the active window, whichever it is. No galuntee your front panel will get it.
01-14-2013 11:51 AM
@pincpanter wrote:
Hey Shane, may I get a non-alcoholic virtual beer instead?
No. The beer I offered was virtually alcohol free anyway.....
Here ya go. <Water>
01-14-2013 11:52 AM
Using a sub-vi to simulate a menu is an avenue I'm not willing to investigate.
It's far too much work for something which is 99% available already.
Shane.