LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

size front panel to fit decoration

Solved!
Go to solution

Hi All,

 

Does anyone know if there is a way to size a front panel based on a decoration.

 

e.g. I  have a front apnel GUI with a flat frame decoration. 

 

I spend a while tweaking the front panel to show only what's inside the flat frame decoration.  I go back and change some stuf and have to repeat this tweaking.

 

It'd be cool if I could just highlight the decoration object and tell the VI to resize based on the decoration.

 

I tried This VI -> Panel -> Decos[] ->  Index[2] -> MasterRect to set the FP.PanelBounds.

It sets it to the same size as the decoration but not actually where the decoration is located, see attached VI.

 

Any ideas?

 

-Sean

0 Kudos
Message 1 of 8
(6,314 Views)

You could try using the position property of the decoration to move it's position to 0,0, which should line up the top left corner

Ian S
Applications Engineer CLA
National Instruments UK&Ireland
0 Kudos
Message 2 of 8
(6,311 Views)
Solution
Accepted by SeanJ

You need to set the origin of the pane of the front panel as well.

 

 

But like Ian was saying, it is probably better to design your front panel and your decoration so that its located at 0,0 and placed at the upper left corner of the window.

0 Kudos
Message 3 of 8
(6,308 Views)

OpenG already has a VI to do this. You can get it here or through VIPM. Fit VI to Largest Decoration.vi  I think it does what you want.

Message 4 of 8
(6,307 Views)

OpenG has a VI called 'Fit VI Window to Largest Decoration' on their Application Control Palette. 

 

Serves me right for getting distracted.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 5 of 8
(6,299 Views)

@elset191 wrote:

OpenG has a VI called 'Fit VI Window to Largest Decoration' on their Application Control Palette.


O'rly?

Message 6 of 8
(6,296 Views)

Thanks for the support guys,

 

I thought the openg option would be the handiest but it throws up the following error:

 

Error 1 occurred at Property Node (arg 1) in Fit VI window to Largest Dec__ogtk.vi->OFSO2 Fibre Delay Lengths.vi

Possible reason(s):

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @. ========================= NI-488:  Command requires GPIB Controller to be Controller-In-Charge.

Property Name: Front Panel Window:Panel Bounds

 

It fails at the last property node FP.PanelBounds with inputs Left: 402 Top: 249 Right: 778 & Bottom: 709

 

 

0 Kudos
Message 7 of 8
(6,264 Views)

I had the same problem, and in my case it was because the "Minimum Panel Size" in VI Peroperties/Window Size was larger than the largest decoration. I changed it to anything smaller, and the error was not thrown anymore.

Message 8 of 8
(6,067 Views)