Quick Drop Enthusiasts

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Drop Keyboard Shortcut – Arrange VI Window

The Arrange VI Window plugin arranges front panel controls based on the connector pane. It also resizes and repositions both front panels and block diagrams to minimize white space and position windows near the upper left corner of the screen. Windows are sized and positioned based on the size of the monitor. If there are too many items, only a portion of the content is shown.

 

To install this shortcut, unzip the attachment in one of the following locations (no LabVIEW restart required):

<LabVIEW 20xx>\resource\dialog\QuickDrop\plugins

<LabVIEW Data>\Quick Drop Plugins

 

This shortcut is intended for use with LabVIEW 2014 through 2018. If you have LabVIEW 2019 or later, this shortcut is built-in; for those versions of LabVIEW, you can also activate it for Front Panels by pressing Ctrl-U.

 

This shortcut was inspired by the following: https://forums.ni.com/t5/LabVIEW-APIs-Documents/Quick-Drop-Align-front-panel-controls-to-connector-p...

 

The following is an example with front panel controls and indicators laid out inconsistenly with the connector pane, and with a lot of unused space on the sides.

FP Example Before.png 

With this plug-in installed and the default shortcut assignment, pressing Ctrl-Space, Ctrl-F results in the following:

FP Example After.png 

Note that the positions of the controls and indicators on the front panel are now consistent with the positions on the connector pane. The height and the width of the front panel window are sufficient to accommodate controls and indicators with reasonable vertical spacing and margins. In addition, the width accommodates all toolbar items.

 

Any items on the front panel that are not on the connector pane such as additional indicators and decorations get shifted together and placed below the lowest controls and indicators associated with the connector pane.

 

You can use this plug-in with front panels of globals and controls in which case the plug-in only resizes and repositions the window.

 

To continue the example, assume that the starting point was the following block diagram.

BD Example Before.png 

Pressing Ctrl-Space, Ctrl-F results in the following:

BD Example After.png 

 

Note that all items are moved together toward the upper left corner of the window and the height and the width of the block diagram window are sufficient to accommodate all the items with reasonable margins. In addition, the width accommodates all toolbar items.

 

You can control certain aspects of operation of this plugin by setting the following LabVIEW.ini tokens:

Token

Default Behavior or Value

Description

VIWin.DisplayWorkspaceRight

Depends on the computer – refer to the Description

Intended for team development. Specifies the minimum monitor width between the team members so that the shown portion of VI windows fits even on smallest monitors. If the INI token is not present the value obtained from the Right component of the Display: Primary Workspace property of the Application class is used.

VIWin.DisplayWorkspaceBottom

Depends on the computer – refer to the Description

Intended for team development. Specifies the minimum monitor height between the team members so that the shown portion of VI windows fits even on smallest monitors. If the INI token is not present the value obtained from the Bottom component of the Display: Primary Workspace property of the Application class is used.

ArrangeVIWin.BD.MinWindowWidth

780

Specifies the minimum block diagram widow width. Expressed in pixels.

ArrangeVIWin.BD.MinWindowHeight

200

Specifies the minimum block diagram widow height. Expressed in pixels.

ArrangeVIWin.FP.MinWindowWidth

715

Specifies the minimum front panel widow width. Expressed in pixels.

ArrangeVIWin.FP.MinWindowHeight

200

Specifies the minimum front panel widow height. Expressed in pixels.

ArrangeVIWin.BD.LeftGap

45

Specifies the gap between the left edge of the monitor and the left edge of the window. Expressed in pixels.

ArrangeVIWin.BD.TopGap

45

Specifies the gap between the top edge of the monitor and the top edge of the window. Expressed in pixels.

ArrangeVIWin.BD.MinRightGap

15

Specifies the minimum gap between the right edge of the monitor and the right edge of the window. The gap may be larger than this value depending if a relatively narrow window accommodates all relevant contents. Expressed in pixels.

ArrangeVIWin.BD.MinBottomGap

15

Specifies the gap between the top edge of the monitor and the top edge of the window. The gap may be larger than this value depending if a relatively short window accommodates all relevant contents. Expressed in pixels.

ArrangeVIWin.FP.LeftGap

15

Specifies the gap between the left edge of the monitor and the left edge of the window. Expressed in pixels.

ArrangeVIWin.FP.TopGap

15

Specifies the gap between the top edge of the monitor and the top edge of the window. Expressed in pixels.

ArrangeVIWin.FP.MinRightGap

45

Specifies the minimum gap between the right edge of the monitor and the right edge of the window. The gap may be larger than this value depending if a relatively narrow window accommodates all relevant contents. Expressed in pixels.

ArrangeVIWin.FP.MinBottomGap

45

Specifies the gap between the top edge of the monitor and the top edge of the window. The gap may be larger than this value depending if a relatively short window accommodates all relevant contents. Expressed in pixels.

SnapGridFrontPanelSize

12

This INI token is not specific to the tool. It reflects front panel grid size specified through Tools>Options>Front Panel. Note that front panel grid size is not available on a per-VI basis through VI Server/scripting. Expressed in pixels.

ArrangeVIW.FPObj.HorizontalMarginFactor

2

Specifies the minimum margin between vertical edges of the window and the closest vertical edges of controls/indicators. Expressed in grid size units. For example, if grid size is 12 and this factor is 2, the minimum margin is 24 pixels.

ArrangeVIW.FPObj.VerticalMarginFactor

2

Specifies the minimum margin between horizontal edges of the window and the closest horizontal edges of controls/indicators. Expressed in grid size units. For example, if grid size is 12 and this factor is 2, the minimum margin is 24 pixels.

ArrangeVIW.FPObj.HorizontalSpacingFactor

3

Specifies the minimum horizontal space between adjacent columns of controls/indicators. Expressed in grid size units. For example, if grid size is 12 and this factor is 3, the minimum space is 36 pixels.

ArrangeVIW.FPObj.VerticalSpacingFactor

3

Specifies the minimum vertical space between adjacent rows of controls/indicators. Expressed in grid size units. For example, if grid size is 12 and this factor is 3, the minimum space is 36 pixels.

ArrangeVIWin.BDCanvasMargin

10

Specifies the margin between the edges of the window and the contents. Left margin is always honored. Top margin is honored as long as both leftmost and topmost items can be made visible at the same time. Right and bottom margins are honored if possible, based on other constraints. Expressed in pixels.

  

Kosta

 

Kosta
Message 1 of 48
(11,931 Views)
To install this shortcut, unzip the attachment in one of the following locations (no LabVIEW restart required):

<LabVIEW 20xx>\resource\dialog\QuickDrop\plugins

<LabVIEW Data>\Quick Drop Plugins

 

Are there advantages/disadvantages to installing in either of the suggested locations?

^TeraTech.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Check out this lengthy post of mostly complaints)
0 Kudos
Message 2 of 48
(11,627 Views)

@TeraTech wrote:
To install this shortcut, unzip the attachment in one of the following locations (no LabVIEW restart required):

<LabVIEW 20xx>\resource\dialog\QuickDrop\plugins

<LabVIEW Data>\Quick Drop Plugins

 

Are there advantages/disadvantages to installing in either of the suggested locations?


Do you want these plugins to be available for all users or just the current user?  Also some users won't have write permissions to places under Program Files and may only be able to install them under the location for just their user account.

0 Kudos
Message 3 of 48
(11,621 Views)

If you install the plugin in the LabVIEW folder, you can only use it in that LabVIEW version. If you install it in the LabVIEW Data folder, you can use it in any version of LabVIEW (2014 or later) installed on your computer.

Message 4 of 48
(11,608 Views)

Hooovahh and Darren, Thank you for answering TeraTech's question.

Kosta
0 Kudos
Message 5 of 48
(11,589 Views)

Does the plugin align controls/indicators in a way which satisfies "VI Analyzer"?

 

I can't find anything that explains what "VI Analyzer" is looking for in terms of control/indicator alignment to the control-grid. Its just never happy!

 

 

0 Kudos
Message 6 of 48
(10,881 Views)

There are several tests that ship with the VI Analyzer Toolkit that relate to front panel control position. I assume you're referring to the 'Control Alignment' test, and yes, this plugin will arrange your panel in such a way that the Control Alignment test is satisfied.

 

See here for a list of all VI Analyzer Toolkit tests.

0 Kudos
Message 7 of 48
(10,871 Views)

A checkbox was added to the Control Alignment VI Analyzer test for LabVIEW 2019 to make the test work better with Arrange VI Window Quick Drop. I use that test configured as shown below:

 

Control Aligment Configuration.png

 

You may get a false positive if you check both the "master rectangle" and the "top/bottom" boxes when one or more controls are type defs. NI VI Analyzer R&D team is aware of this.

 

Kosta
0 Kudos
Message 8 of 48
(10,859 Views)

Is there an easy way to make this resize a window but NOT move it to the top left corner? I work on multiple displays, and it's fantastic that it fixes sizing issues, but it also shoves it to the wrong screen and I have to bring it back every time. I'd rather there be an option to keep the top-left corner where it is, and JUST resize it.

0 Kudos
Message 9 of 48
(10,009 Views)

Why are you saving your VIs on a non-primary monitor? If somebody else opens your code and doesn't have your same monitor setup, it will be inconvenient for the VIs to not open in the top-left.

 

But to answer your question, there is no built-in way to disable this behavior. If you want to modify the code yourself, check out:

 

_Arrange VIWin SubVIs\Arrange VIWin - Resize BD.vi

 

That's where the BDWin.Bounds property is set, and you can add a little math in there to keep the calculated bounds, but instead of using a new top-left on the primary monitor, use the top-left that the window already had.

Message 10 of 48
(9,999 Views)