07-09-2016 05:51 AM - edited 07-09-2016 05:52 AM
Hello. I am attempting to align controls on a front panel (see attached). It appears that I need something more than the alignment tools on the toolbar, or a different strategy... What I typically do in UML tools is to align a single column of controls (such as the "Pulse Width" row) by placing the highest and lowest control where I want them and then distribute the column evenly. Then I align the top and bottom rows to the top and bottom controls, and distribute the other columns evenly. However, LabVIEW appears to use an averaging algorithm to align items rather than using one item as the baseline (e.g. the first or last item selected). So I end up doing an iteration exercise which leaves me with carpal tunnel syndrome and a desire to post on the forum for a better way 🙂
Thanks,
-Jamie
07-09-2016 07:58 AM
07-09-2016 08:09 AM
And both do a lousy job when dealing with controls with differing sizes as shown in the attached image. If the column headers (Pulse Width, etc.) were implemented as labels or captions on the first row of controls it would be even worse.
I think there are some suggestions posted on the Idea Exchange requesting improvements in the way the alignment and distribution tools work, but they do not seem to be gaining much traction.
If I were a conspiracy theorist, I would suspect that the UI department at NI was being paid off by someone who benefitted from programmers with carpal tunnel. However, I have met some of the UI developers and know that they are good people.
Lynn
07-09-2016 08:19 AM
Yes I have. The problem is that I can't align a control to another control's location, only to some mean location. So if I want to align controls in a grid fashion, I have to iteratively use the distribute and align functions.
07-09-2016 08:30 AM
Would Scripting allow you to place controls exactly where you wanted? If so, you could use Scripting to place controls exactly where you wanted (do I hear an echo?).
Bob Schor
07-09-2016 10:44 AM - edited 07-09-2016 05:00 PM
Aligning all these controls in two dimensions is like herding cats.
A better apporach is to use higher structures. For example you could use a 2D array of numerics and a 1D array of switches. Or you could create a cluster with a boolean and three numeric controls (or a horizontal 1D array of three controls), then create a vertical 1D array of those clusters. If you combine the top labels into one large label with spaces, they will be always be aligned horizontally. If you use the caption of the array container for labeling, it will remain grouped with the control. (Make sure to watch the font settings and avoid symbolic fonts, so the font sizes don't change on other system, but that's a different discussion)
If you make the containers transparent, it won't look much different to what you have. If anything, it will make more efficient use of the available area.
Not only will things stay perfectly aligned, it is likely that your diagram is also significantly simplified, replacing piles of wires and terminals with a much smaller number.
07-09-2016 01:42 PM
Yes, Altenbach, this is why you are a Knight -- you go right to the heart of the problem and state the (what should be obvious to the rest of us) logical suggestion!
Bob Schor
07-18-2016 12:34 PM
Reasonable, but an "align to" option would also solve the problem. I've used UML/SysML tools that do this to pretty good effect.
07-18-2016 08:39 PM
If I use an array of switches, how do I use the individual switches to drive an event structure?
07-18-2016 09:55 PM