Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial: How to design your own boolean buttons chp. 2

No. 2. Adding dimmed states to your customized boolean buttons

This tutorial shows you a simple way to customize your boolean controls

In this tutorial you will use Paint to create pictures for 4 states of a boolean button and add the pictures to the button. Boolean buttons can have four states, false, false while pressed, true and true while pressed. The pressed states are dimmed.

Creating the pictures

Open Paint and create a 16 by 18 pixels/dots picture. I have added pictures for a button you can use to turn horisontal grid lines on/off in a chart:

Button states.JPG

The leftmost button is the false state, next is true state, then false while pressed state and finally true while pressed state. In Paint the frame and the gridlines are one dot wide. I have saved all four pictures in the attached paint file (.JPG).

Adding the pictures to the button

  1. Open an empty front panel in Labivew
  2. Right click the panel and go to the Classic Boolean Controls palette
  3. Drop a Checkbox button on the front panel
  4. Go to your pictures in Paint and mark your false state picture. Then copy it
  5. Return to Labview, left click your button and choose Mechanical Action - Switch When Released. This will enable all four states.
  6. Choose Edit - Customize Control. The Customize control window opens with your button displayed
  7. Click the Wrench button on the tools menu bar. It switches to a pair of Twizers
  8. Right click your button and scroll down to Picture Item. Four pictures are displayed
  9. Make sure the first picture is selected. This is the buttons False state picture
  10. Right click the button and choose Import Picture from Clipboard. The copied picture is pasted onto the button's False state
  11. Return to Paint and copy the second picture, the True state picture
  12. Right click your button and scroll down to Picture Item. Select the second picture and import picture from clipboard
  13. Return to Paint and copy the third picture, the False while pressed state picture
  14. Right click your button and scroll down to Picture Item. Select the third picture and import picture from clipboard
  15. Return to Paint and copy the fourth picture, the True while pressed state picture
  16. Right click your button and scroll down to Picture Item. Select the fourth picture and import picture from clipboard
  17. Exit the Customize control window answering Yes to the Replace the original control... question and choose not to save the changes
  18. You return to the front panel and your button has four new pictures!

Known problem

If you don't succeed in pasting from clipboard to the button click outside the button and then choose Edit - Paste from the labview menu. A copy of your picture is pasted on to the panel. Right click your button and choose Import Picture from Clipboard. You should now mange to paste the correct graphics to the button. Finally delete the copy of your picture that you pasted on to the panel.

Comments

  • This is a simplified procedure. The button you edited exists only in the vi in which you created it. You can make copies of the button but if you customize one of the copies the changes will only apply to that customized copy



Contributors