LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

in wich cmd is my mouse ?

Solved!
Go to solution

Hello,

 

i would like to know if there is a way to know wich cell is concerned by cursor when i click on one element

 

ie: is there a possibility to work on array of cluster as if we were working on listbox   to have in return (0,0) or (5,3) or (2nd row, command XXX)

 

here a starting vi

 

Best regards

Tinnitus

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 1 of 10
(4,362 Views)

For an array you should try this piece of code.

For a cluster element you can get it's bounds, and you can get the mouse position. With a pane method (to global coordinates) you can convert between both and test position.

 

Ton

 

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 10
(4,352 Views)

How about an event structure, using a mouse click as an event.

Then use a property node to find the value of the selected cell.

(Attached simple example)

Cory K
0 Kudos
Message 3 of 10
(4,339 Views)

The code by Cory will give you the value of the clicked cell, without telling you the index position(s). From the original question, it seems we want the array indices.

 

By the way, you can create a reference to the array element, eliminating the need for variant gymnastics, (see image. top: my version, bottom: Cory version.)

Cory also uses the wrong representation, which should be DBL.

 

 

If you need the indices of the clicked element, you could also do something along the lines I used in the tic-tac-toe player posted long ago here. Have a look!

Message Edited by altenbach on 01-08-2009 03:05 PM
Message 4 of 10
(4,313 Views)

altenbach wrote:

Cory also uses the wrong representation, which should be DBL.


I have a nasty habit of wiring I32 just by default because it is the first thing I see in the numerical palette.
But you are correct, if should be of type DBL (along with the numerous other corrections:smileywink:)
And apparently I have a history of LabVIEW gymnastics .

 

Message Edited by Cory K on 01-09-2009 11:29 AM
Cory K
Message 5 of 10
(4,285 Views)

Hello,

 

Sorry for delay i was sick,

Thanks for help but i don't understand everything.

Having the values could be interesting but in firtst time i need to know wich row ( of my 1D array) is concerned

later i may need to have wich "element of cluster" of this row is concerned, that 's what i called indices: (row, element of cluster)

 

but in first time only recovering row index could help me

i tried to write a vi with "i" ,a masked element in cluster that i fill each time change is detected, but it's done every time , even is size

has not changed. i don't think it is a good method, i don't see how to improve it.

 

@altenbach, your TTT seems nice but i don't kow where to look to find what you said could you lightnened me...

  

 Best regards

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 6 of 10
(4,235 Views)

a little error in my duplets, it's (0,0)(1,1)(4,2) and not (0,0)(1,2)(4,2)

 

Best regards

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 7 of 10
(4,227 Views)

hello,

 

Anyone for a small lighting ?

 

best regards

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 8 of 10
(4,189 Views)

tinnitus wrote:

hello,

 

Anyone for a small lighting ?

 


Exactly what does that sentence mean?

 

I only have a vague idea of what you are trying to do here.  But I think you have a race condition going on.  Why in each iteration of the loop to you write the value of the 1-D array control back onto itself?

 

When you click on something like the boolean or the increment/decrement values of the numerics, the mouse down event fires even before the the actual value has changed.  So the old data of the array gets fired off, and then gets rewritten back over itself even if you've changed the value in the array.  Try running the VI in highlight execution to slow it down and see what is happening.

0 Kudos
Message 9 of 10
(4,179 Views)
Solution
Accepted by tinnitus

Hello Ravens,

 

thank you for reading,

i have a 1d array of clust (numeric, enum, light btn) 

i only want to know wich row is concerned when an operator click on a line of this array

size of array can be changed by user, for example when he click on cell that is not still active

 

 

Best regards 

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 10 of 10
(4,155 Views)