LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically achieve overlapped subpanels ‘bring front’ and ‘send back’

Lets say, I have Sub Panel 1 and Sub Panel 2 on my top-level GUI VI. I need to bring the Sub Panel 1 to front when a user clicks ‘Bring Sub Panel 1 Front’ button. To achieve this I need to programmatically bring the Sub Panel 1 to front on ‘Bring Sub Panel 1 Front’ button click event.

 

I did some quick search around and could not find right solution to this. Has anyone come across this requirement? How to achieve this?

 

 

AdarshaPakala_0-1626274460124.png

 

 

Thank you

Adarsh

LabVIEW from 2006

CLA from 2014

 

0 Kudos
Message 1 of 13
(2,370 Views)

I don't think this is possible the way you are trying to do it.  The feature you are using is a feature of the IDE and likely not available in the run-time engine so it can't be used in an application.  You could try to swap which VI is in which subpanel, then move their XY positions so it appears to bring one forward on top of the other.

 

Another option might be to abandon subpanels all together and go with Parent/Child window manipulation.  From there you can use the Windows Z level settings to move one on top of the other just like you do with normal windows.  I don't have any good examples of this, but the technique is used in this demo which embeds a Notepad window inside LabVIEW, which then went on into another demo I called Multi Panel Interface.

 

Still I feel like this type of UI/UX might be confusing and hard to use, and I'd suggest finding different ways to represent the data to the user.

Message 2 of 13
(2,364 Views)

Hooovahh is correct.  You cannot change Z-order at runtime.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 13
(2,337 Views)

Thank you for your ideas. I will try these options.

 

This 'special UI' requirement is not designers choice, its requirement from the customer. So I have to deal with it.

 

Thank you

Adarsh

LabVIEW from 2006

CLA from 2014 

0 Kudos
Message 4 of 13
(2,280 Views)

Well I'm not saying you can't make a good UI with this design, maybe you can.  I just know that if I got a requirement from a customer for a UI like this I'd try to steer them into another design.  Not just because it is hard to code, but also because I don't think it would work well.

 

I mean if they want a desktop experience, I'd just suggest they be separate windows, and let the user move and organize the windows how they like.

0 Kudos
Message 5 of 13
(2,251 Views)

I have a thought but it depends exactly on how close the actual requirement is to the version you posted here.

 

You could do this:

Have subPanels 1, 2 and 3.

1 and 2 are the two subpanels you have now.

3 is a third subpanel that is the exact size of 2 and in the same XY location, but you put it on the bottom of the Z order, and set it to not be visible.

When someone clicks the "Bring 1 to front" button, it sends message(s) to other bits of your code that do the following:

  • Turn on "defer front panel updates"
  • Remove the VI from subpanel 2
  • Set subpanel 2 to no longer be visible
  • Set subpanel 3 to be visible
  • Insert the VI in subpanel 3
  • Turn off "defer front panel updates"

 

This could get increasingly complex if the actual application has more than just two subpanels on it, but probably not too bad if it's just the pair of them.

0 Kudos
Message 6 of 13
(2,238 Views)

Why not just us a tab control?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 13
(2,188 Views)

I've used this to fake dynamic controls.

 

I used up to 3000 control placeholder subpanels. The active one got placed into the top level subpanel. It works well.

 

The good news is that updating controls in thousands of controls\indicators is as efficient as updating as many 'real' controls\indicators.

 

With almost no code you can allow the user to move the dynamic controls, which is pretty cool.

0 Kudos
Message 8 of 13
(2,160 Views)

wiebe@CARYA wrote:

I've used this to fake dynamic controls.

 

I used up to 3000 control placeholder subpanels. The active one got placed into the top level subpanel. It works well.

 

The good news is that updating controls in thousands of controls\indicators is as efficient as updating as many 'real' controls\indicators.

 

With almost no code you can allow the user to move the dynamic controls, which is pretty cool.


That sounds quite intriguing. What was the purpose of such a setup? How did a user select which out of the 3000 controls s/he wanted?

0 Kudos
Message 9 of 13
(2,151 Views)

@ConnerP wrote:

wiebe@CARYA wrote:

I've used this to fake dynamic controls.

 

I used up to 3000 control placeholder subpanels. The active one got placed into the top level subpanel. It works well.

 

The good news is that updating controls in thousands of controls\indicators is as efficient as updating as many 'real' controls\indicators.

 

With almost no code you can allow the user to move the dynamic controls, which is pretty cool.


That sounds quite intriguing. What was the purpose of such a setup? How did a user select which out of the 3000 controls s/he wanted?


The scenario was quite simple.

 

A GUI is created from a configuration file. All configured items are displayed on the FP (in subpanels). As far as the user can tell, these are all just normal controls.

 

Except that some elements where more then one control. As the subpanels where transparent, the user could see all controls, but the front most subpanel could block clicks to subpanels behind it. So, some hit testing checked for this, and made (the content of) the obstructed sub panel front most.

 

For the user, it all looked normal.

 

In fact, for any non-LabVIEW programmer, it would be normal as well 😫.

0 Kudos
Message 10 of 13
(2,145 Views)