LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

user click appending to table


Attached is a vi with a small table of data.

I'd like to be able to click on a particular row & let fill in the cell ( 3rd col, user-selected row) with Numeric.  The vi dumps the Numeric value into a x,y coordinate specfiec in the code, but it would be nice to have the program understand where the user clicked the mouse.

I thought the Point to Row Column method might help, but I'm not sure how to transfer the mouse coordinates into this method.
Something similar exists in the List : method called GetDoubleClickedRow. I was wondering if it could be done with a table ?

Thanks,

ak
0 Kudos
Message 1 of 11
(3,748 Views)
 
Code example from above thread: TableClickFill.vi

Message Edited by altenbach on 02-01-2007 05:47 PM

Message 2 of 11
(3,747 Views)

Thanks very much! Yes - I've modified my vi (attached). Basically it works but there's 2 issues that would be nice to solve.

1) In your original TableClickFill.vi, when the user hovers over the table, the 'finger' shows up, while in mine, it's the 'insertion icon' - why ? A finger is a better pointer 🙂
2) For the numeric to populate the cell, I need to double-click on the cell of interest, & then move away & double click on another cell, before I see the first cell being populated. In your vi, the cell gets populated instantly.
     I can't figure out why ?

ak

0 Kudos
Message 3 of 11
(3,722 Views)
  1. It is because the table is enabled in your case, allowing you to type. To get the "finger" when hovering over it, right-click on the table and select "advanced...enable state...disabled".
  2. The above will solve both issues!

🙂

0 Kudos
Message 4 of 11
(3,718 Views)

Yes that does it - but now my table is larger (see attached vi) & I would like to be able to scroll down to the row of interest ! Can I do this ?
Also, I noticed that the further down in the table I go, the less accurate the row is populated. For example below about row (1,4), clicking on a row will populate the cell onto the next row.
Any ideas on why that is happening ?

ak


0 Kudos
Message 5 of 11
(3,713 Views)


@cig438 wrote:
Any ideas on why that is happening ?

Yes, my conversion from coordinates to cell number is very simplistic and probably needs to be tweaked a bit. Are all your cells of equal size?

Once your table is scrolled, you also need to increment the "sensed" position by the offsets obtained from the "IndexVals" property, which gives you the index of the cell currently in the upper left corner of the indicator.

0 Kudos
Message 6 of 11
(3,709 Views)


@cig438 wrote:
Also, I noticed that the further down in the table I go, the less accurate the row is populated.

OK, here's a quick fix for that one. Simply add 1 to the cell size to account for the width of the dividing lines. 🙂

Unfortunately, the table is "disabled" so you cannot scroll anyway. In order to be able to scroll, you need to enable the indicator again. To still get "the finger" as cursor, you can set the desired cursor with a "table: mouse enter" event and reset it with a "table: mouse leave" event.

Message Edited by altenbach on 02-02-2007 12:02 PM

0 Kudos
Message 7 of 11
(3,699 Views)

Yes they are.

0 Kudos
Message 8 of 11
(3,698 Views)

Wow - the width of the lines are causing the problem !

I changed the cursor thru events but now the data disappears ?



0 Kudos
Message 9 of 11
(3,693 Views)
I guess I'm not sure how to integrate mouse enter & mouse down events ..

I nested the table : mouse down, clear, & stop events inside the mouse enter event - now clicking is unresponsive.

ak

0 Kudos
Message 10 of 11
(3,687 Views)