LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 

Additional information for mouse events in an array control or indicator

Status: New

I'm sure I'm not the only one who has had to back out the index of an element inside an array when a user clicks.  There are good solutions for doing this programatically (Including Mark Ridgley's solution here), but this seems like a no-brainer for native functionality.  I propose adding event data for mouse events within arrays:

Panel.PNG

EventStructure.PNG

7 Comments
olivierLg
Member

Hi fairlyFunctional,

 

I've tried to reproduce what you did, but I ran into a "little" problem: there is no item called Indices - I have all the other items: source, Type, time, CtlRef, Coords etc... but no "Indices". Any idea of what I am doing wrong ?

 

Thanks for the help.

olivierLg
Member

Ok my mistake, I thought I was replying to a proposed solution, not a proposed idea - I misread the first post. So my comment above does not make any sense.

Sorry for that.

User002
Not applicable

oliverLg, be sure to give the idea kudos to give it attention and get the proposed solution implemented.

AristosQueue (NI)
NI Employee (retired)

A good idea. One question: Why is it "indicies" and not "index"? How do you have a click on multiple items simultaneously? 

AristosQueue (NI)
NI Employee (retired)

No... make that two questions...

 

Are you wanting the visual index or the scrolled-to index? In other words, if the array were scrolled so that instead of the zeroth element being at the top, you had some later value N at the top, and you right clicked in the same place, would you still want the answer to be "3" or would you want the answer to be 3+N? Does your answer remain the same if I ask about you clicking on elements that are past the end of the array?

User002
Not applicable

Answer 1: Indices because of multi-D arrays.  In a 2-D array I'd like the clicked row and column.  In a 3-D array I'd like the clicked row, column and zero because...

Answer 2: ...I have access to offset between the displayed data and the underlying array (through the Index Values property) I can add the two to get the position in the data.  By adding the two arrays, I can plug the sums into Index Array Element and get the data under the mouse when I clicked.  If clicking in an element past the end of the array the indexing operation would return the default value, which seems a reasonable behavior.

AristosQueue (NI)
NI Employee (retired)

> Indices because of multi-D arrays.

 

Ah. In this case, we would make it "Index" when it was a 1D array and only go to Indicies when it is a multidim array. LabVIEW can be smart about that, just like on the Index Array node.

 

> Answer 2: ...

 

Visual index it is, then. Good... that's what I was hoping the answer would be. It makes the property value computable without reference to the value, which keeps the code interactions to a minimum.

 

I do like the idea. We'll see what happens in the next few LV releases.