LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bit of advice on best GUI practice please

Solved!
Go to solution

I'm trying to create a small subvi that achieves a relatively simple goal, but I'm stuck.

I need a small modal window to appear displaying a two-column table, and OK and Cancel buttons. Here are my requirements for the subvi:

  • It must populate a two-column table, the first column with string entries, the second column with integer numbers.
  • The user must be able to edit the second column value, but not the first column of strings.
  • There must be a vertical scroll bar as this list could get quite long.

 

I have created the subvi, as shown in the snapshot attached, which meets the above requirements. I use filter events to discard any mouse clicks in the first column, thereby preventing editing of the string values. However, it doesn't work exeactly as I'd like, and therefore I know my customer won't be pleased either: When the user clicks an entry in the second column, the string text in the first column gets highlighted. AND, this does not prepare the numeric value for editing either. As this is a LabVIEW table, to edit the value the user has to wait about a second, then reselect it - which I find a tiresome requirement. And why does the first column entry get highlighted when selecting in the second column?

 

Is there a way to either set up the table to accept single clicks as a request for editing entries, or

Is there a better way to present my two column list and let the user easily edit the numeric values?

 

I will try to create a stand-alone version of the subvi and attach it to a follow-on message if that helps people to see what I mean...

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 4
(2,901 Views)
Solution
Accepted by topic author Thoric

Thoric,

 

Consider two arrays.  The first is an array of string indicators, set to be disabled.  The second is an array of integer controls.  Hide the index controls on both displays.  It may take a bit of tweaking to get the vertical size on the elements of each the same so that they remain aligned.  Create a vertical slide control to serve as the scroll bar.  Use its output with property nodes to control which parts of the arrays are visible.

 

Lynn 

Message 2 of 4
(2,867 Views)

I like your answer, Lynn, so I've marked it as the solution.

 

In the end however, I've gone for disabling my table and popping up a second (particularly small) subvi whenever a mouse click is detected in the second column. This second subvi simply allows the user to enter a new value, which is returned to the calling subvi and used to replace the existing numeric. It works, but it's a little less cuddly than what I had in mind.

 

Thanks for you advice! 🙂

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 4
(2,858 Views)

Thoric,

 

Many ways to solve a problem. The pop-up subVI is often a good choice.  In your case it emphasizes to the user that only the numeric element is available to be changed.

 

Lynn 

0 Kudos
Message 4 of 4
(2,845 Views)