LabVIEW Idea Exchange

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

Resize Front Panel window based on selected objects

Status: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.

For creating a GUI, determining the size of the front panel window can be a challenge (or just plain tedious). 

 

The following scenario is fairly common:

1)  Position the top and left edges of the front panel window so that the top and left edges of the desired front panel objects are shown.

2)  Resize the window (using the bottom right corner) to fit the bottom right edges of the desired front panel objects.

 

It would be nice to be able to select certain front panel objects (ie, controls, indicators, decorations, etc), and then have the window resized based upon the position of those front panel objects. 

 

01-Selection.jpg

 

The entire window would be resized so that the top-most, bottom-most, left-most, and right-most bounds of the selected front panel objects become the new front panel window bounds (of course, taking into account other components like the menu bar, scrollbars, etc.).  Any cases where this would not work would result in a message stating why the operation cannot be performed.

 

02-Resized.jpg

 

Optional items:

a)  The top-left edge of the selected front panel objects could become the new front panel origin. 

b)  There could be a pixel padding that allows an additional border around the selected front panel objects, but have that hidden away in a configuration option (labview.ini) or further nested in the menu.

6 Comments
tst
Knight of NI Knight of NI
Knight of NI

A related idea - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/We-need-to-uncouple-the-quot-edit-mode-quot-FP-size-fr...

 

 

(And the first comment there also links to something you can do today to get something similar).


___________________
Try to take over the world!
deyyoung
Member

@tst - Thanks for the tip!

 

Well, after making some minor changes to the OpenG vi "Fit VI window to Content__ogtk.vi" (found in appcontrol), and following the Integrating into the LabVIEW Menus document, I created my own tool to do this. Now I can select my objects, go to Tools->Front Panel Window and click "Fit VI Window to Selected Contents", and I'm done.

 

If there is interest, I can post this tool in one of the Community pages (LabVIEW Add-on Dev Center).

I'd still like to see this integrated into LabView proper, though.  

 

Regards,

Daniel

 

tst
Knight of NI Knight of NI
Knight of NI

If you use the right click framework (or Quick Drop keyboard shortcuts) you don't even need the decoration and the menu integration - you can select the controls and operate directly on them. Getting the coords is relatively easy by getting the size and position and doing an Array Max and Min on that data. If you want to save some time, you can download the Code Capture Tool from LAVA and look through its source code, as somewhere in there there's a piece of code which captures the selected elements of a front panel and uses that logic.


___________________
Try to take over the world!
deyyoung
Member

I'm not too terribly fond of the right-click framework.  I guess if I used LV all the time I could remember such shortcuts, but to me a menu option is much easier.  If I forget where something is, I can search for it pretty easily in the menu.

 

The menu option I created works great and is already saving me time and trouble.

tst
Knight of NI Knight of NI
Knight of NI

The RCF does give you a menu, and it's usually a much shorter menu, because it's only the RCF items and it depends on context. It does have problems, but I don't think this is one of them. You can see an example here at the beginning of the video - http://www.screencast.com/t/9G90X8jIx


___________________
Try to take over the world!
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.