LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display different values on an array of buttons

Hi,

 

I have an array of buttons. On each buttons, I want to display a different numerical value on each button, without affecting the button behavior (I don’t want the value to interfere with the button when I want to click on the specific button).

 

I want to use an array of buttons because the application must be generic; it must be suitable for different systems, with different sizes. The number of buttons is dependant of the size of the system.

 

I know I can use a cluster, define many buttons and make visible only the ones I need. With this technique, I would be able to change the Text on each button. But I want to avoid this because I could need something between 8 and 150 buttons. And the update of the text on a button requires a lot of power processing.

 

If it is possible, can I use an array of numeric values, without this array interfering with the array of buttons?

 

Thank you,

Alexandre Boyer

0 Kudos
Message 1 of 9
(5,102 Views)
I don't think you can do what you want to do. Each element of a control/indicator array is always identical in appearance to all the other elements of the array. The array elements only differ in the value they hold/display. You could add a second string indicator array alongside the boolean array and size its elements so that they lined up with the buttons and load the string array elements with whatever values you wanted to use as labels for the adjacent buttons. I've done this and, while it isn't as nice as what you suggest, it is possible to do and it does work. You can go so far as to hide the index display on the string array and (while the VI is running) control it off the index of the boolean array.
Message 2 of 9
(5,085 Views)

In addition to what Warren said, here are a couple of examples for how this can be done, but it doesn't look very nice.

In the first example, a cluster is used and the numeric is placed over the button, so you can't click where the numeric is.

The second one shows how to detect where you clicked on an array of numerics.

The new Xcontrols in LV 8.0 might be able to accomplish what you want, but I don't have it yet.


___________________
Try to take over the world!
Message 3 of 9
(5,080 Views)

Hi Alex

You can define your array, but instad of a single button you can insert a cluster, which contains a button and a numeric or a string.

Just have a look at the attachment.

Hope this helps.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 9
(5,079 Views)
 

Message Edited by Centex99 on 01-05-2006 09:16 AM

0 Kudos
Message 5 of 9
(5,065 Views)

Hi,

Thanks to all for your quick answers.

Presently, I have two sets of arrays side by side (an array of button and an array of numerical display) and the correlation between the two arrays is difficult for large systems. It's why I wanted to change this layout. Also, I need each button to be entirely available for a click because the application is touchscreen, and it becomes hard in this case to push on a specific   part of the button.

But I like the idea of creating an array of clusters. I will probably use this technique.

Thanks again

Alexandre boyer

 

0 Kudos
Message 6 of 9
(5,053 Views)

Use a Picture control and a mouse down event.

This thread will give you links for Picture control examples

http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=14&jump=true

The mouse down event just has to determine which button the click goes with.

Have fun,

Ben

PS If you use the approach, please post a simple example of your implementation. I am still collecting good examples.

Message Edited by Ben on 01-08-2006 12:05 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 9
(5,021 Views)

I have a the same problem... I was wondering if you were able to find a soln.

 

I have literally thousands of buttons and each button as a unique key code and unique name.

 

For Example :  

Button Name    – Key code #

PUSH              - 1

POP                 - 2

PULL               - 3

 

The way I program this simple algorithm is deadly painful. 

1)      I create 1000 buttons by going to control->buttons.

2)      Then I have to go through one by one to change the Boolean text to “PUSH,POP,PULL…”  

3)      Then used the Event Structure, adding in all the controls names “PUSH, POP, PULL..” In side each event, I placed the key codes “1,2,3..”

I have search and tried for weeks to find a better way, and still nothing comes to mind.  

 

Please help.

0 Kudos
Message 8 of 9
(4,768 Views)
0 Kudos
Message 9 of 9
(4,758 Views)