LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array of buttons with different boolean text ?

I'm looking for a method of displaying a 2D button matrix with
different boolean text on each button. It seems an array of booleans
must all have the same text. Perhaps a cluster could be used, but the
array makes button alignment easy and easy to determine which had been
pressed (radiobutton style with only one button true at a time).

Steve
0 Kudos
Message 1 of 6
(5,750 Views)
"Steve Parus" wrote in message
news:3defcc7a.16872645@news.itd.umich.edu...
> I'm looking for a method of displaying a 2D button matrix with
> different boolean text on each button. It seems an array of booleans
> must all have the same text. Perhaps a cluster could be used, but the
> array makes button alignment easy and easy to determine which had been
> pressed (radiobutton style with only one button true at a time).

Would an array of clusters work? You could have a button and string control
in each cluster.
0 Kudos
Message 2 of 6
(5,750 Views)
nospam.sparus@umich.edu (Steve Parus) wrote in message news:<3defcc7a.16872645@news.itd.umich.edu>...
> I'm looking for a method of displaying a 2D button matrix with
> different boolean text on each button. It seems an array of booleans
> must all have the same text. Perhaps a cluster could be used, but the
> array makes button alignment easy and easy to determine which had been
> pressed (radiobutton style with only one button true at a time).
>
> Steve
.....
It's easy to make them individuals in a cluster, and on the block
diagram use Cluster To Array to get it into array form for
manipulation. This can be superior to an array of buttons, not merely
because the buttons can thereby have differing colors and text. An
array of buttons cannot have the buttons Latch
ed When Pressed; when in
a cluster, however, the latching action is available.

Try this: take a cluster of four PB's (latched when pressed) put
inside a while loop. Initialize a boolean array of 4 to FALSE outside
the while loop, and attach it to a shift register input on the left
side of loop. Inside the loop, convert your cluster to an array. XOR
the shift register with this array from the buttons, and wire this to
the output shift register and to an indicator array. Set the boolean
to the loop so it will run free and start it up; on the control panel,
click on the PB's and you will see the outputs toggle.

Greg
0 Kudos
Message 3 of 6
(5,750 Views)
And use the string control as the way to place separate text onto each
individual button ? An alternative is to just use a 2D array of
buttons with separate text label on top of each button. With an array
of clusers, each cluster's buttons gets the same text labels as the
first cluster.

On Thu, 5 Dec 2002 16:55:04 -0800, "Adam Russell"
wrote:

>Would an array of clusters work? You could have a button and string control
>in each cluster.
Message 4 of 6
(5,750 Views)
On 6 Dec 2002 05:31:21 -0800, humenik@nscl.msu.edu (humenik) wrote:

>nospam.sparus@umich.edu (Steve Parus) wrote in message news:<3defcc7a.16872645@news.itd.umich.edu>...
>> I'm looking for a method of displaying a 2D button matrix with
>> different boolean text on each button. It seems an array of booleans
>> must all have the same text. Perhaps a cluster could be used, but the
>> array makes button alignment easy and easy to determine which had been
>> pressed (radiobutton style with only one button true at a time).

>It's easy to make them individuals in a cluster, and on the block
>diagram use Cluster To Array to get it into array form for
>manipulation. This can be superior to an array of buttons, not merely
>because the buttons can thereby have differing colors and text. An
>array of buttons cannot have the buttons Latched When Pressed; when in
>a cluster, however, the latching action is available.

When might that Latched When Pressed behavior be useful ? Using a 2D
array of buttons (not cluster), in LV 6.1, a Value Changed event for
the array can be used as you mention below to XOR the event's OldValue
and NewValue and wire that to a local variable copy of the array.
This easily gives a radio button effect for the entire 2D button
matrix. The array control automatcially arranges the visual
alignment of the buttons.

For the cluster method, I'd like to programmatically change which
button is true. All the approaches I come up with end up using
Array-to-Cluster which then requires the cluster size to be specified.
I may end up wanting to programmatically vary the number of buttons in
both dimensions and hence the cluster size. LV's Align Objects and
Distribue Objects ends up making the button visual alignment not
difficult (for a 12 x 8 matrix).

>Try this: take a cluster of four PB's (latched when pressed) put
>inside a while loop. Initialize a boolean array of 4 to FALSE outside
>the while loop, and attach it to a shift register input on the left
>side of loop. Inside the loop, convert your cluster to an array. XOR
>the shift register with this array from the buttons, and wire this to
>the output shift register and to an indicator array. Set the boolean
>to the loop so it will run free and start it up; on the control panel,
>click on the PB's and you will see the outputs toggle.
>
>Greg
0 Kudos
Message 5 of 6
(5,749 Views)
Yea I realized after I posted that that probably wouldnt be what he was
after. With my idea the label would be next to the button (in the string
control) rather than on the button.

"Steve Parus" wrote in message
news:3df0c3f3.6456517@news.itd.umich.edu...
> And use the string control as the way to place separate text onto each
> individual button ? An alternative is to just use a 2D array of
> buttons with separate text label on top of each button. With an array
> of clusers, each cluster's buttons gets the same text labels as the
> first cluster.
>
> On Thu, 5 Dec 2002 16:55:04 -0800, "Adam Russell"
> wrote:
>
> >Would an array of clusters work? You could have a button and string
c
ontrol
> >in each cluster.
>
Message 6 of 6
(5,749 Views)