07-14-2021 09:56 AM
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?
Thank you
Adarsh
LabVIEW from 2006
CLA from 2014
07-14-2021 10:07 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-14-2021 10:39 AM
Hooovahh is correct. You cannot change Z-order at runtime.
07-16-2021 01:19 AM
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
07-16-2021 08:07 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-16-2021 11:37 AM
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:
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.
07-17-2021 09:51 AM
Why not just us a tab control?
07-19-2021 03:10 AM
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.
07-19-2021 07:39 AM
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?
07-19-2021 07:56 AM
@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 😫.