04-27-2009 02:36 PM
Is there a way to reset a front panel control or indicator's appearance to default values? For instance, let's say you take a complext front panel, change all the font to ridiculous sizes, color everything random colors and resize all the controls and indicators to weird sizes, then save the VI. What would then be the most efficient way to reset the controls and indicators to the default appearance that they had when they were originally created? Is the fastest way to create a new control or indicator for each ruined control and indicator and rewire the whole block diagram?
-root
Solved! Go to Solution.
04-27-2009 02:53 PM
Having been in that same situation... it has always been easier for me to start over. If anyone has any other ideas, I would love to hear them.
04-27-2009 03:04 PM
You could do a replace (right click) on the modified control and replace with the original control this would save you the rewiring but still require some manual labor.
04-28-2009 01:13 AM
If you have access to private methods, you could traverse the front panel, call the replace method for each control and then use the position and sizing properties to make sure it's in the same place.
But since you want the fastest way, a manual replace would probably be the best.
04-28-2009 11:15 AM - edited 04-28-2009 11:16 AM
Ah, of course. Thanks, falkpl. I did notice something kinda weird, though. When you replace a control or indicator with the original control or indicator, only certain things get reset, and it's different for every type of control. In order to reset all the properties (except for the label properties), I usually have to swap the control with a control of a completely different type or class then replace the new control with the original.
It's really weird to note what gets reset when you replace a modified control with itself. A modern Boolean gets completely reset (except for the label font properties, which is apparently never reset on any control.) A modern numeric will be resized, but nothing else gets reset. A classic text ring retains it's size, colors and text properties. A modern intensity graph gets resized and the text gets reset, but the colors don't.
Now here's the super strange part. Sometimes when you swap a control for a different type of control, you retain properties that get reset if you just replace it with itself; for example- if you swap a modern intensity graph with a modern digital waveform graph, and then swap it back to a modern intensity graph, the font doesn't get reset, even though it does if you replace the intensity graph with itself! Explain that one! 🙂 LabVIEW is weird.
Anyway, swapping them out does the trick nicely. Thanks again falkpl!
-root
P.S. If your buddy ever walk into your office and says "Hey, check out this weird behavior with the front panel", save the VI you are working on. Autosave always picks the worst time, and undo only remembers what happened after the catastrophy.