LabVIEW Idea Exchange

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

Create Constant - Label causes resize of structure when plenty of whitespace is available

Status: New

When you create a constant on the diagram from an object with a name, often the new constant's label runs into the enveloping structure's border, causing the structure to resize.  This process is quite dumb, as even if there is lots of room around the constant, LabVIEW insists on forcing a resize due to the collision.  Since the space is there, surely the routine could recognize that and only force a resize if there is not enough space.

in the example, the control was against the LHS of the loop; after creating the constant, I moved it down for vertical clearance, then made the label visible.  The label forced the loop resize to the left, ignoring the space to the right.

 

structure resize image.png

11 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

This happens because you have "Place structures with Auto Grow enabled" in your options. Turn this off and that won't happen anymore:

 

ScreenHunter_001.jpg

 

 

You can also disable this for each structure individually, if you want a less drastic option.

GuessWho
Member

I know why it happens.  However, you don't really need to cut off your left leg to fix that torn toenail.  The auto grow feature is just fine, but some smarts are needed.

 

RavensFan
Knight of NI

Turning off Auto Grow would be very annoying and is not a solution.  I realize there are a handful of people who dislike Autogrow and you must be one of them.  Having Auto Grow turned off is risky as you may do something that should grow the structure, but instead it starts hiding code beyond the boundaries.

 

The problem here is caused by the default alignment of labels on constants, indicators, and controls.  Controls are left aligned with the terminal.  Constants and indicators are right aligned with the terminal or constant.  At least with my mini-experiment.

 

The real solution here is when you show the label for the constant and realize it grew your structure in a way you did not want, undo it.  Right click on the constant, properties, then edit the label and make it visible that way.

 

 

elset191
Active Participant

See this relatively recent post which is related

--
Tim Elsey
Certified LabVIEW Architect
X.
Trusted Enthusiast
Trusted Enthusiast

Ravens Fan, actually, check this recent post about constant label location. There appears to be a bug...

As far as autogrow is concerned, I'll return your answer: if you realize you need autogrow for a structure, you can just undo you insertion, turn it on and then put your stuff in it again...

GuessWho
Member

Sure, if you don't mind doing things that the software can do.  This forum is for ideas for improvements.  I think LabVIEW would be just a teensy bit better if, when it creates something, it identifies available space before blindly creating a new hole.  Yes, I can manually rejustify the label, but the damage is done, so then I have to undo it, fix it, and then redisplay it.  All because when I make it visible, there is no smarts about where it is placed.  THere are other similar gotchas.

When I show a large cluster as an icon, move it to the edge of a structure, then re-show the content, the item is resized in place, overlapping other things.  What if it had the smarts to place itself in whitespace, but remember where the icon was centered last?  THen when I reselect show as icon, everything is restored?  Other posters have suggested an edit window, but that's messy because it can't remain visible unless it becomes a subvi, which is another way of burying clusters.

 

YMMV.

altenbach
Knight of NI

By default, created constant don't show their label! You must have this option specifically enabled to show them (Environment:show created constant labels).

 

Long ago, I once thought this is a good idea, but I have since abandoned it. It gets too annoying in a majority if cases. 😉

GuessWho
Member

altenbach

yep.  two comments - style difference - I like to know what those buried constants are for; keeps me honest.  Having several constants on the diagram for the same purpose becomes easy to spot.

 

legacy code reconstitution - let's see, what is that constant for<desperate hope kicks in> maybe that so-and-so labelled the constant, or created a constant to replace a control/indicator, which would mean it might just have a meaningful (or misleading, I know) label.

 

Anyway, it's not worth the bandwidth.  I just have a hate on for doing cosmetic rubbish that I feel could be handled better automatically.

Thanks

GregSands
Active Participant

I wonder whether a solution to this problem (and this one) would be to separate the action (creating a constant) and the resizing in the Undo queue?  So one Ctrl-Z would un-resize, and the second would remove the constant? Although it may work better if there was some sort of Undo history.

SteenSchmidt
Trusted Enthusiast

I always disable autogrow as one of the first things. It always messes up my code, and I have no problem resizing code manually.

 

Cheers,

Steen

CLA, CTA, CLED & LabVIEW Champion