06-18-2018 03:00 PM - edited 09-02-2020 03:26 PM
A LabVIEW Quick-Drop (QD) plug-in for aligning and distributing elements on afrontpanel or blockdiagram.
This plug-in is based on the existing Align & Compress BD/FP Objects plug-in. The plug-in is completely refactored and changes the handling and the keymap of the original plug-in.
Thanks to Jim for his incredible plug-in.
The design idea behind the usage of the plug-in is to simply handle the alignment using the left hand on the keyboard and the WSAD keys. Therefore you will be very fast to organize your elements on the VI.
The plug-in is published as a VIPM Community package. Search for QuickDrop AlignElements
in the VI Package Manager and install it easily.
https://www.vipm.io/package/mnprojects_lib_quickdrop_alignelements/
At first you have to select some elements either on the fronpanel or the blockdiagram of the VI.
The Quick Drop plug-in uses the default shortcut A
.
There are three possible ways to act with the plug-in using the mouse or only the keyboard.
With the mouse you can simply act with the plugin
Firstly press CTRL+SPACE
to open the quick drop dialog, then press CTRL+A
to open the plug-in dialog containing the alignment and distribution buttons. The different buttons can be pressed to move the objects.
At the end the dialog can be closed by clicking on the close button in the corner or by pressing the ESC
key.
A faster way to handle this Quick Drop plug-in is by using the keyboard.
After selecting some elements press CTRL+SPACE
and CTRL+A
to open the dialog window. Afterwards you can use one of the following keys to execute the wanted alignment:
W
: TopS
: BottomA
: LeftD
: RightC
: Horizontal CenterV
: Vertical CenterQ
: Vertical GapE
: Horizontal GapAfter pressing a key for alignment the panel will immediatelly be closed.
If you move the mouse pointer over one of the buttons you will see the shortcuts for each operation. (Only some of the distribution elements can be controlled by key.)
The last option to handle the plugin is based on Darren's suggestions.
After selecting some elements open the Quick Drop dialog by pressing CTRL+SPACE
. Insert one or more of the above characters into the combo box. Then press CTRL+A
. The plug-in will immediatelly execute the alignment or distribution of the elements.
On of my favorites is to open the Quick Drop with CTRL+SPACE
. Then insert AQ
into the combo box and press CTRL+A
. This will align the elements to the left and distribute it with an equal vertical gap. I use this to arrange the VI input and output elements on the blockdiagram.
Like the original plug-in the increment and decrement buttons of a numeric control will be hidden during alignment (based on this idea exchange).
By default this behavior is activated. It is possible to deactivate it in the LabVIEW.ini.
You can control certain aspects of operation of this plug-in by setting the following LabVIEW.ini tokens:
Token | Default Value | Description |
---|---|---|
QDAlignElements.HideIncDec | True | Hide Inc/Dec buttons of Numeric Controls during alignment. |
The plug-in is developed in LabVIEW 2017.
The source code of the project can be found on Github.
If you find some bugs, have questions or other comments please feel free to reply.
08-28-2018 01:57 AM
Uhhh yeah I always wanted to have this !
Okay I though about coding this with the arrow-keys but with WASD-keys one can do it with only one hand.
Perfect 😉
08-28-2018 11:06 AM
I've been thinking for years that I should write this plug-in, but I never got around to it. Nice work! Here are some changes I suggest making (here's a screenshot that illustrates some of them):
Again, nice work. I think I'll be using this plugin a lot.
07-12-2019 02:11 PM
Hy Darren,
thank you for your tips and the link to your presentation. It will improve my code. I've added your requested feature with the combo box to the plug-in.
Will it be possible to add this plug-in to the List of Community Quick Drop Keyboard Shortcuts?
Martin
07-15-2019 01:27 PM
> Will it be possible to add this plug-in to the List of Community Quick Drop Keyboard Shortcuts?
Done, and I love the latest changes!
09-02-2020 10:42 AM - edited 09-02-2020 10:53 AM
Hey guys,
Let me just start by saying how grateful I am for this tool. It has saved me a TON of time cleaning up garbage BDs and FPs, and of course when creating new ones. That being said, there is some behavior that doesn't quite match up to the behavior when clicking the built-in align and distribute buttons.
I've noticed basically the entire time using it that for numeric controls on the FP, the left align operation doesn't take into account the increment/decrement button (IDB hereafter). Well after cleaning up like 50 FPs this morning, I finally decided to delve into the code to figure out why. It appears as though it is an intended behavior, even though it doesn't match up to the built-in left align button's behavior. Before the alignment starts, you hide all IDBs on selected numeric controls, and after the operation completes you show them all. Which is fine; it is your tool and we are just lucky enough to have it.
What might not have been intended (and what prompted me to actually write this), is that if you do any sort of A&D operation on numeric controls, once the operation completes even the ones that previously did not have the IDB visible now do.
It's an easy fix; I'll probably just remove the code in red so it works better for me personally. But I'm curious. Why hide IDBs on numerics before the operation and show them after?
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
09-02-2020 03:45 PM
Hy Redhawk,
I'm glad to see that my plug-in is in use and also helps others.
I took the behavior of the Inc/Dec buttons from the original plug-in.
After your inputs I published a new version of the package and I hope the new release will be available soon on VIPM.
With the current version 1.1.0.3 I fixed the bug that the Inc/Dec buttons of all numeric controls are added after the alignment. So if a inc/dec was hidden before the alignment it will also be hidden after it.
I also add the option to disable this behavior with an entry in the LabView.ini.
Take a look at the Github page for instructions: https://github.com/matrixx567/LabView_QuickDrop_AlignElements
Thank you for your inputs. It helps to improve the plug-in.
Greets,
Martin