01-05-2006 08:01 AM
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
01-05-2006 08:15 AM
01-05-2006 08:21 AM
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.
01-05-2006 08:26 AM
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
01-05-2006 09:13 AM - edited 01-05-2006 09:13 AM
Message Edited by Centex99 on 01-05-2006 09:16 AM
01-05-2006 09:30 AM
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
01-08-2006 12:03 PM - edited 01-08-2006 12:03 PM
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
01-25-2007 11:19 AM
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.
01-25-2007 11:58 AM
Green_Tea's cross posting here.
http://forums.ni.com/ni/board/message?board.id=170&message.id=226072&jump=true
Ben