LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic Shortcut Menu Activation

I have a multicolumn listbox with certain columns which I only allow certain values for. I enforce this by popping up the shortcut menu with the defined values for that column each time the user clicks a cell in one of those columns. Works great.
Now however, I'm looking at introducting a feature where after a user enters info in a cell, they can press tab to go to the next column over (just like an Excel spreadsheet). I'm wondering if there is a way that, when the tab button is hit, to fire an event that will bring up the shortcut menu for that cell.
 
Michael
0 Kudos
Message 1 of 7
(4,875 Views)
I think the only way to do this is to simulate a right-mouse click, and the cursor has to over the cell. If you're on Windows you can use the code in the VI in this message to simulate a right-mouse click. You should be able to get the coordinates to move the mouse to from the listbox.
Message 2 of 7
(4,865 Views)

I'd heard of this, and I've made the example in the thread you posted work. thanks a ton.

Michael

0 Kudos
Message 3 of 7
(4,852 Views)
I've done similar stuff, but in a different way.

When the user clicks a cell, catch that with an event. You get coordinates
from the event, and yuo can proccess them with a method (coord to cell or
something). For each type of input, make another control. Mode this control
over the cell coordinates (tweak the position so it looks good). With the
overlay control's value change event you can see if the user is done, and
update the cell. Leave the control there, until another cell is clicked, or
if the mouse leaves the parent control.

It's a difficult to get it exactly right, but it is doable to get 99% right.
Tabbing is easier to implement this way.

Regards,

Wiebe.


Message 4 of 7
(4,842 Views)
Wiebe that seems like a great solution, and would give me more control over what happens when tab, return, etc. are pressed. I've just tried making a listbox look like a runtime menu. I was wondering if you were able to get the slight shadow and small gray border like a shortcut menu?
 
Michael
0 Kudos
Message 5 of 7
(4,830 Views)
Why use a listbox? If the user clicks the cell, put a enum at the cells
position. The click will be directed to the enum, and it will show. The
popup of the enum looks exactly like a menu (no levels though). You can
customise the enum so it has no Increment/Decrement, border etc. The user
will never know it's there.

Regards,

Wiebe.


0 Kudos
Message 6 of 7
(4,825 Views)

An enum or ring with the items list open won't fire Key events, a listbox will. I'll play around with the listbox, see if I can't make something that looks good.

Michael

0 Kudos
Message 7 of 7
(4,816 Views)