Jump to content

disable boolean buttons in array


Stimpson

Recommended Posts

Hello everybody.

I have an array on the FP which I filled with 8 Boolean OK Buttons. These represent the single bits in a byte. If you click the Buttons, the value of the boolean array changes from 0-255, you get the idea. Is there a way to disable single OK buttons in this array, so you can only click and change the MSB or LSB or whatever bit you want? I only found an option to disable all OK Buttons in the array. Obviously that's insufficient.

See the attachment for more clarification.

Regards,

Stimpson

Download File:post-6155-1158242021.vi

Link to comment

Array elements all have the same properties and appearance, so you can't disable just a single element. What you can do instead is create a cluster of 8 booleans. You can then convert it into an array for your calculation and get the Controls[] property to control the properties of each boolean.

Another option would be along the lines of blocking the change, like using a Mouse Down? event and discarding it if it's on a "disabled" button or using a value change event and reseting the values of changed elements if they are "disabled". Personally, I don't like these solutions. If you only need 8 booleans, go with the cluster.

Link to comment

The cluster works pretty good. Thank you.

Another thing popped up though: I want to enter a hex value with a 'control' and this should alter the OK Buttons according to the entered hex value. But at the same time, i want the value of aforementioned 'control' alter accordingly when i click the OK Buttons.

In other words: I have two controls that affect each others value. So this gives me troubles when they are executed synchronously. Stacked sequence gives me the problem that it works in only one direction properly.

Boy, that sounds complicated as hell while being so basic. :oops:

Link to comment
The cluster works pretty good. Thank you.

Another thing popped up though: I want to enter a hex value with a 'control' and this should alter the OK Buttons according to the entered hex value. But at the same time, i want the value of aforementioned 'control' alter accordingly when i click the OK Buttons.

In other words: I have two controls that affect each others value. So this gives me troubles when they are executed synchronously. Stacked sequence gives me the problem that it works in only one direction properly.

Boy, that sounds complicated as hell while being so basic. :oops:

Maybe you are looking for something like this?

Download File:post-1172-1158248591.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.