LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom control color property

Solved!
Go to solution

With the included controls like the OK boolean you can change the true or false color by going to Properties >> Apperance >>Colors.  Then click the color box to change the state color.  Is it possible to do the same with a custom boolean control?

 

  I have searched some and it does not sound like it is possible, but I figured that I would ask.  I have a diagram where I used some pipes from the DSC module image navigator to make some boolean pipes.  I just changed the properties for the different colors then pasted them into a boolean control for true/false cases.  But now I am thinking of changing the colors from gray/red to gray/green.  Is there an easier way than just starting over and making new booleans with the desired colors?  Or is there a better trick for custom controls I don't know?

 

Thanks

 

0 Kudos
Message 1 of 13
(4,224 Views)
You should be able to control those colors programmatically for a Boolean control by right clicking on it on the block diagram and choosing Create >> Property Node >> Colors[4]. The context help (Ctrl-H) describes which pairs are used for True/False.
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 2 of 13
(4,190 Views)

On the booleans included with LabVIEW that works great.  But when I create a custom boolean that does not work.  So I am asking about custom booleans.

 

Thanks

 

0 Kudos
Message 3 of 13
(4,184 Views)
If you've replaced one of the states with an image then you won't be able to use Colors[] property to change the color for that state.
0 Kudos
Message 4 of 13
(4,167 Views)
Custom boolean?  Well that depends on the level of customization.  An instance of a Strict type def control must have all of the same properties as the strict type def. (it will look and operate exactly like the definintion).  An instance of aa type def control must be of the same LabVIEW type.  you could programmatically reassign property values of a type def.

"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 13
(4,165 Views)
This still works for a standard Boolean button. Other custom Booleans may involve pasted images which lay over the base and cover the color. Could you post the custom control you are working with?
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 6 of 13
(4,164 Views)

Hello Jeff,

 

  I can't use strict type def's because each piece of pipe is a different shape/size.  I attached a sample control that shows what I am doing.  Are there pre-made boolean pipes somewhere? 

 

I wish there was a semi-strict type def so only the true/false images were strict but dimensions were not.

0 Kudos
Message 7 of 13
(4,140 Views)
The problem is that the control you attached is saved as a Strict Type Def, which means you can't change the colors of the booleans.  Make the control a regular Type Def.  You can create a property node on the VI of that dropped control and write to the Colors(4) property (a cluster of 4 colors).  When it is set as a strict typedef as you have now, that property can only be read, not written to.
Message 8 of 13
(4,130 Views)

Here is a sample of the control as a type def and a vi with the Colors(4) property cluster.  I must be doing this wrong or not explaining it correctly.  So if you could look at the files and be able straighten me out I would appreciate it. 

Download All
0 Kudos
Message 9 of 13
(4,115 Views)
Solution
Accepted by topic author _Bryan

You are not doing something wrong, this is just a limitation of labview that has frustrated me for years.  The colors array only works with decorations, which are very limited.  If you import an image to the true/false images That are not labView decorations then the color property are not used.  You do have one option which I cahe done to some suscess:  Import a semitransparent overlay as a decal over a solid decoration color, then change the color[] array and all is good.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 13
(4,111 Views)