LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling navigation of a table

I have a subvi pane that contains a few controls, one being a table.

I need the table to contain strings, but not be editable by the user. Therefore I made it an indicator that I populate programmatically.

I need to permit users to be able to select the table rows. I currently do this by programmatically setting the selection property start at (0,n) and be (1,7) in size, everytime the user selects cell (m,n) with the mouse. This nicely highlights the row. However, I need to be able to do this when the user navigates the panel with the keyboard too!? This caused problems:

 

Firstly, the table has to be a control, not an indicator, if I want to be able to navigate to it with the keyboard. But this means the user can now change the table contents themselves, when I need it to remain not-editable.

 

Secondly, even when defined as a control, I cannot get into the table using the keyboard. How is this done? I've read that CTRL-down arrow enters into the table when it has focus, but this doesn't work for me. I just cannot get access to the cells!?

 

So, what I need is advice on:

  1. How to create a table of strings that the user cannot edit, but can select cells within (both with the mouse and keyboard).
  2. How to actually navigate to a table, into the table, around within the table, select a cell within the table, and get back out of the table - all entirely by keys presses alone.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 1 of 13
(5,137 Views)

Well, to keep the tablea control and prevent it from being editted, you can have a 'mouse down?' event configured in the event structure and wire a 'true' to the discard input.  Then the natural click to edit will be diabled.  As for the keyboard commands you could have a key down event case that handles the responses you want to various key, also discarding what they naturally do.

 

Also, you could use a mulitcolumn list box instead.

0 Kudos
Message 2 of 13
(5,129 Views)

True - a mouse down event capture with discard could banish users from editing the table cells with the mouse.

 

What I didn't explain was that on this panel I have two of these string tables, both containing similar but different data. If I monitor key presses in the panel, can I be sure which table the user thinks they're moving the selection within? (For example, lets say the first table has the 3rd row selected, and the second table has the 6th row selected. If the user presses the down arrow, which selection do I move down one?)

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 13
(5,111 Views)

Somebody please help. I just cannot navigate into a table with keys the way LabVIEW help states you can.

Extract from the help:

"When tabbing through the front panel objects in run mode, press the <Ctrl> and down arrow keys to tab into the table. Press the <Tab> key to move the cursor to adjacent columns and the <Enter> key on the keyboard to move to adjacent rows. To tab out of the table, press the <Ctrl> and up arrow keys."

This really does not work!

 

Please see my attached vi (LV8.5). In this simple vi, there is a table and two booleans. Run the vi (it does nothing but wait until you select either OK or Cancel), and try navigating into the table with the keyboard. CTRL+DownArrow does not enter the table! What am I doing wrong??

Message Edited by Thoric on 07-21-2009 09:18 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 13
(5,090 Views)
It's because it's not CTRL but SHIFT!!!
0 Kudos
Message 5 of 13
(5,079 Views)

J.DECHET wrote:
It's because it's not CTRL but SHIFT!!!

Why the Exclamation Marks?

 

Help says Ctrl. I've tried Ctrl. I've also tried Shift. I've tried Shift AND Ctrl together. Nothing enters the table when combined with the down arrow key. Or any other key that I can determine.

 

Anyone else know why this isn't working?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 6 of 13
(5,074 Views)

Excuse me for exclamation mark.Smiley Wink

It's my first steps in forum and I haven't still good reflex.

 

So, SHIFT was to explain the help content is wrong because to navigate in a table, you have to use <Shift> + Arrow.

 

To enter in an edit mode of the table with keypad, you can use the event "Table":Key Down? and insert the property node EditPos as written.

For example, if you want <Ctrl> + Down to obtain edit mode:

 

EditModeTable.png

Message Edité par J.DECHET le 07-21-2009 11:07 AM
Message Edité par J.DECHET le 07-21-2009 11:15 AM
Message 7 of 13
(5,066 Views)

So, SHIFT was to explain the help content is wrong because to navigate in a table, you have to use <Shift> + Arrow.


I've tried Shift+Arrow but that doesn't work for me, I simpy cannot navigate into a table at all. Are you simply pressing "Shift+Down" after tabbing to the table? What happens precisely? Does the top left cell highlight to indicate you are now inside the table? Does tabbing then move sideways within the table?

 


 

To enter in an edit mode of the table with keypad, you can use the event "Table":Key Down? and insert the property node EditPos as written;


I acknowledge that I could write code to handle key presses and programmatically adjust the table contents myself, but why should I? LabVIEW is supposed to handle front panel key navigation itself. I still haven't read an explanation as to why this doesn't work?

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 8 of 13
(5,052 Views)

Effectively, I can't enter in edit mode with <Shift> but only navigate when firstly inside.

 

I 've consulted LabVIEW Help as you, find the same information and I didn't find a native soluce to enter in a table ... only the code. Sorry.Smiley Sad

 

Just to complete, it was running with LV 7.0 so I think the LabVIEW help content has not been updated.

Message Edité par J.DECHET le 07-21-2009 11:51 AM
0 Kudos
Message 9 of 13
(5,039 Views)

Please find attached an example, which should work.

 

But you have to add some code to check whether you reach the limit of your table cells.

 

To use it first press tab to select the Table, then you can navigate with the arrow keys.

 

Distinguishing two controls can be done by using FocusObj from the event specific data.

 

Regards 

Message 10 of 13
(5,027 Views)