LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a possibility to justify the values of controls which are contained in a cluster?

Hi,

I tried to right-justify the values of the controls in a cluster programmatically, but without success. I can use property nodes and justify caption or label but not the value itself. I know that i can do that manually by using the font dialog.
So, let me know if there is a possibility to do this programmatically!

Steve
0 Kudos
Message 1 of 7
(3,114 Views)
Depending on the 'type' of each element in the cluster, the justification property is slightly different. So you can't just put the cluster's array of control references into a for loop and change them all in one hit.
You can create separate control references for each element in the cluster and change them that way. (see attached)


Message Edited by Troy Kujawski on 05-31-2007 06:21 PM

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Download All
Message 2 of 7
(3,107 Views)
Hey Troy,

thanks for your immediate answer. That solved my problem partly. The rest I solved myself and want let you know. I have many controls in the cluster. But lets say, all numeric controls' label texts start with "numeric". So i can filter those numeric VIs by comparing the label texts with a constant (here it is "numeric"). Then when a numeric control was found, i can typecast it to the numeric type where all numeric control properties are available.

Best regards,

Steve
Download All
0 Kudos
Message 3 of 7
(3,096 Views)
Just a pointer, try "Match True/False String" to clean up your logic. It will check the beginning of the input string and compare it with whatever you wire to the true and false inputs.
 

Message Edited by Marc A on 05-31-2007 08:52 AM

0 Kudos
Message 4 of 7
(3,080 Views)
Hi Mark,

thanks for the hint to clean up the logic. I copied the logic from an "old" project and didn't really think if there is a better way to do this since that was not my problem. Nevertheless, thanks for your reply.

Steve
0 Kudos
Message 5 of 7
(3,070 Views)
Just a few notes.
 
You should really not be using type cast for changing between reference types. The To More Specific Class node would be better. This does compile time checking to make sure that the cast is at least to a related class and allows error io handling at run time. In this case it makes it trivial to remove the control name assumptions from the code.
 
By using the staticly bound control reference as the type input, the reference created is strictly typed. This means it not only restricts to digital numerics but also to double precision digital numerics. Using the class specifier constant allows you to make the code generic to a digital numeric with any representation.
 
If you do want to handle multiple types of controls, you can also select between different types with the Class Name property. You can then have one case structure to handle as many classes as you want. One note on this is the class name will always be the most specific class. So if you want to do something to all numerics, you actually have to look for "Digital", "Enum", "Ring", "ColorRamp", "Slide" and "Knob". You'll just have to decide if listing these 6 classes makes your code more understandable than doing a To More Specific Class on Numeric. It probably depends on how many other control classes you want to handle.
 

Message Edited by GregR on 05-31-2007 09:50 AM

Message 6 of 7
(3,060 Views)
GregR, thanks for your advice. I think I am going to have the "perfect solution" now Smiley Happy
0 Kudos
Message 7 of 7
(3,027 Views)