LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
DFGray

Shrink-Wrap Structures

Status: New

Often, when modifying code, I need to reduce the size of a structure due to removing code.  If I have a nested structure system (e.g. event structure in a case statement in a loop), this can get very tedious.  It would be nice to have a "shrinkwrap structure" functionality on the right-click menu as a counterpoint to the autogrow.  This would be an action that would reduce the structure size to something a bit bigger than the largest contents.  An option to set how much extra space to include would be nice.

16 Comments
Intaris
Proven Zealot

If it's manual, why not just drag the corner of the structure towards the opposite diagonal corner..... It will only let you make it small enought to not hide any code within.... I do this all the time.  For me, this "Manual" function is already implemented (more or less)

jcarmody
Trusted Enthusiast

I do that, too.  What's missing is the empty space around the code.  Once I shrink the structure I find myself grabbing the extreme objects and shift-arrow-ing around to auto-grow the structure those precious eight pixels.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

DFGray
NI Employee (retired)

I do not normally have autogrow structures enabled (I turn it off as soon as I install LabVIEW), so pulling in the bounds does not stop at the first item.  I would prefer autogrow to have a one-shot action ability, as well. I currently turn it on, then turn it off.

 

Note that the shrinkwrap function would work in both directions.  If you get the extents of all objects in the subdiagram, then resize your frame to fit, it will do what is needed.  If the frame grows, a makespace should generated, as well.

aeastet
Trusted Enthusiast

I like this idea. I have a consultant that I have do work and after he is done I always have to go back in and make thing "fit" again. When there are many cases and events and ... and... this takes a long time. This would save hours of work as long as it worked well. Like the code clean up tool is a good thought but dosen't really work on complicated stuff.

Tim
GHSP
Intaris
Proven Zealot

In order to have cake and eat it too (Mmmm, unlimited cake) how about regardless of autogrow setting the structure frame would latch briefly within a few pixels (8?) of the pre-defined autogrow size but still allow the user to override by simply dragging further.  This way autogrow in this instance would no longer be an option which has overriding function, but is rather a constant advisor as to where your code limits lie.

 

The ability to leave the structure AT the autogrow size should be possible visually of course so that it doesn't become a war between man and mouse.

X.
Trusted Enthusiast
Trusted Enthusiast

Would anybody trust NI to get it right? Just looking how terrible the clean up tool is or even how badly the simple autogrow or wire auto-routing methods behave, I would not.

And thus won't vote for this idea.

I don't want to be accused of having contributed to adding misery to the world.

 

On an optimistic note though, I have found a universal code shrinker:

 

ScreenHunter_001.jpg

 

This, for instance, allowed me to hide a rather large diagram within a much more manageable surface area.

And I feel not much better about the code. I can even disable it with one click!