From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting Programmatically move to front, back, forward and backward selection of objects

Is it possible

Scripting Programmatically move to front, back, forward and backward selection of objects: decoration, controls...

MoveTO_Whatever.PNG

Nitrof

0 Kudos
Message 1 of 12
(14,321 Views)

There are private methods of the Panel class to do exactly what you want.  Perhaps they can be exposed to the masses.

0 Kudos
Message 2 of 12
(6,520 Views)

The 'Panel:Move Selection Backward', 'Panel:Move Selection Forward', 'Panel:Move Selection To Back' and 'Panel:Move Selection To Front' methods are not expected to be private, but were incorrectly marked as such.

I've posted a LabVIEW 8.6 VI here where you can copy/paste these methods to where you wish to use them.  I'll fix them in LabVIEW 2011, but it's to late to correct their permissions in LabVIEW 2010.

Darin.K, thanks for letting us deliberately choose to release these methods instead of posting them yourself. 

0 Kudos
Message 3 of 12
(6,520 Views)

I tried to use the "move selection to Front" methods by accessing it from the vi scripting TopLevelDiagram, as well as with yours from panel class.

Unfortunately, they both give me the same error: "object reference is invalid".

When I programmatically select my control (property node -> selected), it shows up as selected and I can use ctrl-shift-K to move it to front while the prog is running. However, when I try to use those methods, it gives an error.

The "Make selection" method gives me the same error. Could you please explain me how do I select the object I want to mave to front?

Thanks a lot for your help.

0 Kudos
Message 4 of 12
(6,520 Views)

In theory, it should work... can you post the VI that you wrote? It might be a bug in the methods or it might be a bug in how you're setting up the call. Either way, a VI would be helpful.

0 Kudos
Message 5 of 12
(6,520 Views)

Here is a simple VI that gives the choice between MoveSelectionToFront or Ctrl+Shift+K. The 2nd method works but the 1st one gives me an error.

Thanks again for your help.

0 Kudos
Message 6 of 12
(6,520 Views)

Hey guys,

I'm working with the methods attached by TrevorChristman and they're fine!
However, was this issue solved in LV2011 ? I still can't find the methods in the panel ones.

I would appreciate some help on that.

0 Kudos
Message 7 of 12
(6,520 Views)

The methods are still private in 2011. I haven't checked newer versions.


___________________
Try to take over the world!
0 Kudos
Message 8 of 12
(6,520 Views)

Thanks for your reply!

0 Kudos
Message 9 of 12
(6,520 Views)

These were made available (if you have scripting turned on) in LV 2014.

0 Kudos
Message 10 of 12
(6,520 Views)