04-03-2013 11:16 AM
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
Solved! Go to Solution.
04-03-2013 11:38 AM
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
04-03-2013 11:39 AM - edited 04-03-2013 11:40 AM
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.
04-03-2013 11:39 AM - edited 04-03-2013 11:40 AM
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.
04-03-2013 11:44 AM - edited 04-03-2013 11:48 AM
OpenG has a VI called 'Fit VI Window to Largest Decoration' on their Application Control Palette.
Serves me right for getting distracted.
04-03-2013 11:46 AM
@elset191 wrote:
OpenG has a VI called 'Fit VI Window to Largest Decoration' on their Application Control Palette.
O'rly?
04-04-2013 08:10 AM
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
12-19-2013 09:02 AM
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.