LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change location of front panel contents programmatically

Solved!
Go to solution
Is there a way to programmatically control the location of front panel contents upon VI execution?  This is similar to defining the front panel location using a property node and the Front Panel Window: Panel Bounds by defining the pixel location of the front panel.  However I also need to do this for the front panel contents as well.
0 Kudos
Message 1 of 9
(5,380 Views)
See for example.  Probably not the exact effect you are looking to achieve but it shows the 'position' property
0 Kudos
Message 2 of 9
(5,375 Views)
I've found a way to use the position property to reorient the contents to whatever location desired in the VI front window but still need a way to use that position to change the location of the contents...
0 Kudos
Message 3 of 9
(5,367 Views)

btram wrote:
I've found a way to use the position property to reorient the contents to whatever location desired in the VI front window but still need a way to use that position to change the location of the contents...

 

I am a little confused now.  What do you mean by reorient the contents to whatever location, and how is that different than changing the location of the contents?  Changing the location of the contents implies moving them, which is what the position property does.   Are you looking to scale your contents with the front panel?  That's a whole different matter with its own set of problems.  You can set objects to scale with the pane (with mixed results), but I don't believe there is a way to programmatically change the bounds of an individual control (at least in LV8.2).
Message Edited by Darin.K on 08-12-2009 05:40 PM
0 Kudos
Message 4 of 9
(5,354 Views)
If, by "contents", you mean everything on the FP needs to move, then you could put everything on a tab control (set to transparent perhaps) and you just have to programmatically move one item.
Richard






0 Kudos
Message 5 of 9
(5,343 Views)
I don't think "move" is the correct word.  What I really mean is I need the front panel to automatically scroll to a certain position when I execute it.  This effect is useful if somehow the front panel contents get moved or are repositioned in the front panel and saved the VI automatically recenters over certain (or all) objects when the VI starts.  If there is a way to calculate the position of the top left background grid then I can tell the objects to "move" to that location and this will have the same effect.  I just need the objects to move relative to its position on the screen position and not the background grid.
0 Kudos
Message 6 of 9
(5,315 Views)

Well, you're still saying you want to move objects.

 

I center all of my GUI's with the node shown. In this case, 10/-1000 was where the contents I wanted the user to see were located. Even if I save the VI while the front panel is off-center, it will always start in the exact place every time. Now, if I move objects manually off the ROI, I have to re-adjust that node.

 

Another (better?) way is to use OpenG's Fit VI Window to Content or (the one I like better) Fit VI Window to Largest Decoration. Either of these methods will position your pane to the stuff that is in it. In the later case, make a big box the size of your pane, and pow!

 

You're either moving objects or moving the pane relative to the objects, take your pick.

 

 

node.gif

Message Edited by Broken Arrow on 08-13-2009 10:39 AM
Richard






Message 7 of 9
(5,309 Views)
Solution
Accepted by topic author btram

you can use the property node bounds>>all elements

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 8 of 9
(5,304 Views)
Exactly what works, thanks!  Also, you can reposition the origin as suggested above which has the same effect.
0 Kudos
Message 9 of 9
(5,298 Views)