LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clickable menu

Hi all,

 

I am working on a project where the panel will have a bunch of clickable tiles arranged in columns. There will be multiple columns with clickable tiles.

Clicking a particular tile within the column will change its background color to say bright green and assign the value "True" for Enabled. Clicking the tile again will will change its Boolean value to "False" for Disabled and its background color to dark green.

The dark green marked tiles will be skipped in the program execution.

Additionally, I'd like to be able to mark the tile that is currently being executed with a red LED.

I googled around for a while, but haven't yet found any examples that would be suitable for clueing-in.

 

Please find the attached PNG file for a rudimentary explanation of what I am trying to accomplish.

For clarity, only one column with tiles is shown.

LabVIEW version is 2018.

 

Best regards to all and thanks.

LonginusP

 

0 Kudos
Message 1 of 10
(1,398 Views)

Sounds like you want to create some kind of test executive.  What do you have so far?  Realize that, if you don't have anything so far, that is kind of an indicator of your LV experience, and it is going to be a fairly daunting task to get something like this created from scratch.  You won't need advanced knowledge to pull this off, but you will need a solid comprehension of the basics.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 10
(1,390 Views)

List boxes can be useful to implement all desired functionality, just maybe graphically slightly different:

 

  • You can populate it with a list of items
  • You can show specific item symbols (e.g. checkmark, diamond, etc. etc.) for each entry
  • For each entry, you can change font (e.g. grey or strikeout for disabled) and background color.
  • You can use event structures for click and double-click action on any item and immediately change their cosmetics accordingly.
  • etc.

 

 

 

0 Kudos
Message 3 of 10
(1,382 Views)

@altenbach wrote:

List boxes can be useful to implement all desired functionality, just maybe graphically slightly different:


A simple old forum example

 

multiple selection in listbox without using ctrl key 

 

Make sure to set the selection mode to "0 or more" items.

Message 4 of 10
(1,373 Views)

Per your suggestion, I started experimenting with the listboxes. Since I've never used them before, there is a fair amount of trial-and-error on my part. The front panel GUI still looks pretty basic, but I am making progress.

Thanks for the suggestion.

LP

0 Kudos
Message 5 of 10
(1,223 Views)

Thanks for sharing the link, it's helpful.

Best regards.

LP

0 Kudos
Message 6 of 10
(1,222 Views)

@billko wrote:

Sounds like you want to create some kind of test executive.  What do you have so far?  Realize that, if you don't have anything so far, that is kind of an indicator of your LV experience, and it is going to be a fairly daunting task to get something like this created from scratch.

...


How daunting depends on how nice you want it to be.  Version 1 of our 2nd generation general-purpose test framework was quite simple and only took me a couple of months to make.  I kept cobbling on features, and after version 4, I realized that the next version would have to be a complete redo.  I've been working on the 3rd generation for a few years now (It's almost ready).  It comprises several hundred VIs (and I had to invent Y Controls to prevent insanity (well, OK, to prevent more insanity (well, OK, to mitigate the increase in insanity))).

"If you weren't supposed to push it, it wouldn't be a button."
Message 7 of 10
(1,202 Views)

Hi all,

 

I ran into an issue.

My listbox has both integer and non-integer cells. I need to assign the values to the non-integers that are different from ones visible to the operator. For example an "aaa" string in the panel must have a value of "k=1" assigned in the diagram. A "100" string has the value of "100" in the diagram. Is there a way to do it with listboxes?

Attached are the sample vi and a PNG with some notes for better understanding.

 

Thanks in advance,

LP

Download All
0 Kudos
Message 8 of 10
(1,161 Views)

The value of a listbox is the index of the selected item.  This is not changeable.

You can do something like what you are asking with a ComboBox, but it only has a single column.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 10
(1,152 Views)

I didn't look at the code, but it looks like you simply need to have a separate data structure in the code to hold your actual data.

 

Based on your image, I would suggest something like a 2D array of clusters, where each cluster has the following values: {Type [enum], Value [probably variant], Name [string to be displayed]). You then use that data structure for the actual code. You can take the name from each cluster to update the MCLB and use the type enum to know how to convert the variant. This is also possible from the variant itself, but I would suggest just having the enum.

 

Note that because you have an MCLB and it looks like you only want a single cell in the 2D array, you will also have to track the active cell separately (local variable, shift register, etc.). You can use the Mouse Down event and then call the Point to Row Column method on the MCLB to know which cell was clicked (right click the MCLB>>Create>>Invoke Node to call the method).


___________________
Try to take over the world!
0 Kudos
Message 10 of 10
(1,084 Views)