LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with value change event on boolean button

Hi,
 
We have observed that placing text over a boolean button, stops it from responding to a value change event when the mouse is brought down over the text area of the button (except in cases when the text was 'boolean text')
 
To elaborate:
 
There are four possible ways of having text placed over a boolean button; namely
1) Label
2) Caption
3) Boolean Text
4) Text created by text tool

We also wish to underline one letter of the word which is placed over the text. But boolean text does not allow this. If you underline one letter, save, close and then reopen the VI; you find the complete word to be underlined!
This does not with method 1,2 and 4. BUT, when using method 1,2 and 4 if the text is placed over the button, the button does not respond to value change!!
 
Any inputs what is causing this and way out?
 
Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 8
(3,586 Views)
By placing text with the text tool over the Boolean button you are "covering" the button. If the entire button is covered by text you actually are clicking on the text box and not the button. The Boolean never recieves the mouse click and that is why it doesn't respond.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 8
(3,578 Views)
Andrew, thanks for your reply.
 
I too deduced that the text is "covering" my button. But then whats the way out? I need the text to be on the button and I still want the button to respond if I click anywhere on it. Right now, it responds when I click outside the textbox area.
 
Second, why doesn't the boolean text pose the same problem?
 
- Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 8
(3,571 Views)

The Boolean Text does not pose a problem because it is built into the control, you only choose its value and if it is visible or not.

OK, for a work around you will really have to want this text on the button bad. The only way I could get the text I wanted onto the button in the format I wanted was to customize the control doing the following.

Please note I am by no means an expert with customizing controls so if any one in the forum knows how to do this better PLEASE by all means reply as I would like this information as well.

1. Open a blank VI and create a Text box with the text and format including sizeyou wish. Make sure your use the paint function to make the backround of the text box the same color as the Button or a different color if you like. If you leave it as transpraent the result will be a white backround using this process.

2. Copy the text box to the clip board. (ctl-c)

3. Open Paint and paste, save the file as *.jpg

4. Using a picture editor open the *.jpg and crop the picture so only the text is left and save the file and copy it to the clipboard.

5. Place the boolean button you wish to use on the front panel, Make the Boolean Text NOT visible if it isn't already, Size , right click on it goto Advanced->Customize....

6. You are now in the costomize contol window, Right click on the Boolean goto Import Picture->Decal. This has now pasted a picture of the text on the button.

7. Save the control and say yes to replace it on the front panel.

You will have to do this with each button for different text (There has to be a better way???)

Anyway hope this is of some help.

Regards,

 

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Message 4 of 8
(3,557 Views)

I have figured out a way to underline 1 letter in boolean text.

This method uses the property node of the boolean.

I usually have an initializion case for my vi's so I put this in there.  If you don't have that make sure this is one of the first thing your vi does.

1. Create Property node for boolean

2. Expand Property node to 4 Properties

3. Set the first property to Boolean Text\Font\Underline to False

4. Set the second property to Boolean Text\Selection\Start to the begining character of the string you want underlined

5. Set the third property to Boolean Text\Selection\End to the end character of the string you want underlined

6. Set the fourth property to Boolean Text\Font\Underline to True

I have attached a VI developed in 7.1 to illustrate this.

Dan Shangraw, P.E.


   

Message 5 of 8
(3,428 Views)
Here is the vi

Dan Shangraw, P.E.


   

0 Kudos
Message 6 of 8
(3,427 Views)
Your method will not work in LV 8.2. It does work in LV 7.1. Just a warning for anyone using 8.2.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
Message 7 of 8
(3,417 Views)

Dan and Andrew, thanks!

That does make life easy.

Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 8 of 8
(3,406 Views)