LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programatically switch a control from the default style to the system style

I was wondering if there was any way to conditionally make a control look like either the default control style or the system control style. The front panel that contained the control would not be running. I'm running Labview 8.0. One possisble way I'm thinking of is changing the type descriptor but I'm not sure how to write to it (I can read it from the 7.x flatten to string function). Another way I'm thinking is maybe changing or applying a typedef but I'm not sure if that's possible either.
CLED (2016)
Message 1 of 8
(2,921 Views)
The easiest way I can think of to do this is to create a version of each and then programatically show/hide one or the other version.  Other than that, we don't really have any public facitilites to programatically replace controls.  The type descriptor for system and modern controls are exactly the same.  The only difference between them is a few images applied to the control and the fact that on system controls the images and control adapt to the platform that they are running on.
Message 2 of 8
(2,914 Views)
I was thinking more along the lines of making a strict typedef of the system control and using its type descriptor. And one can only read that image overlay with the property node: no writing right?

Thanks

Message Edited by InfiniteNothing on 05-15-2007 03:52 PM

CLED (2016)
Message 3 of 8
(2,904 Views)
An XControl would be a great idea. 
 
Basically you could set a mode on it which would show either a modern or system control.  You would only have one control to manage and one terminal to write.
 
Basically in the XControl you would always update both controls, but only make one visible at a time.
 
Good thinking.
0 Kudos
Message 5 of 8
(2,891 Views)
I revisited this and tried the XControl method. It does work, but it's very cumbersome due to the ridiculous complexity of implementing XControls. When XControls were introduced I thought, cool! Then I saw what it took to create them, and quickly forgot about them. Trying this simple thing with an XControl has only solidified that conclusion for me. If the user wants to pursue this method then it will work, but be prepared to deal with more work than you'd expect.
Message 6 of 8
(2,854 Views)
In case anyone was wondering, I was trying to batch freshen up some old VIs.
CLED (2016)
Message 7 of 8
(2,848 Views)

" ... If the user wants to pursue this method then it will work, but be prepared to deal with more work than you'd expect."...

Smiley Very Happy My sentiments, exactly. There may come a day when I need to spend an afternoon making one really cool control ... but I don't see it happening anytime soon. Smiley Happy

Message Edited by PaulG. on 05-17-2007 05:04 PM

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 8 of 8
(2,837 Views)