LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying a front panel decorative box

Hi

I have an application whose front panel has several decorative boxes
(smooth and lowered style) used for aesthetic purposes. When my
application starts I would like to adapt my front panel display to
match varying screen dimensions. How would I go about dynamically
changing these objects? Do the boxes have any properties that are
modifiable?

Thanks
John
0 Kudos
Message 1 of 7
(3,300 Views)
You can access references to the decorations via a front panel reference. Wire the front panel reference to a property node and select the controls property, it will give you references to all the decorations. You now need to know the indexes of the references you want, get those indexes and you can read and write the size property of the decoration(s). I have attached a simple example that resizes two decorations when the front panel is rescaled, just run it and resize the window...the properties will rescale accordingly.

In the example the rescaling is curde; it just finds how large a percentage the window has changed and change the size of the decorations approx. the same. In real life you may want to put in logic that controls the size in a more refine
d way.

Mads
0 Kudos
Message 2 of 7
(3,300 Views)
Hope this will help too in one way or another.

Comment welcome 🙂
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 3 of 7
(3,300 Views)
Hi John,

If you have LabVIEW 6i or later, you can also go to "File >> VI Properties..." and select "Window Size." Here, there is a checkbox for "Scale all objects on front panel as window resizes."

If you want to control when and/or which front panel objects scale with the window size, you can use the "Open VI Reference" from the Application Control palette, and an "Invoke Node" connected to it with the "Set FP Scaling" method enabled. (All of this is also relevant only for LabVIEW 6i and later.)

I hope this helps! Have a great day!

Liz Fausak
National Instruments
0 Kudos
Message 4 of 7
(3,300 Views)
Taht's the decorations[] property...not the controls property. (It's correct in the example).
0 Kudos
Message 5 of 7
(3,300 Views)
Same as mine, but I used events to get the front panel rescaling.

Events are nice for this, but on the other hand they fire continously when you rescale. If you drag the window back and forth rapidly things may hang due to all the events that have been generated in the event que. Sometimes I miss a way to flush the events que...(or is there?).
0 Kudos
Message 6 of 7
(3,300 Views)
err... my LV7 is still on its way 😛 so, I have not seen your example code yet...

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 7 of 7
(3,300 Views)