05-14-2020 10:43 AM
Dear all!
Midway through the journey of the LabVIEW examples, I found myself puzzled by the "Programmatically Manipulate a Tab Control" example. In it, a boolean button is displayed hovering above the tab control so that it remains visible on all pages. I am now looking for a way to recreate this hovering effect to place an element above some container, but not actually inside the container.
In the description of the example in my german version, it is written that the floating control has been created at an empty spot on the front panel and then dragged onto it, without putting it into the tab container. I have tried to replicate this, but it seems like an incredibly fickle task to stop the control from dropping into the container, having to start over or save often alongthe path - almost like a game of skill and luck.
I have just now found some guidance with this article https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/ctl_on_tab_ctl_pages/ - but holding down the keyboard until satisfied also does not strike me as a scalable solution.
How would one go about using this feature in a well-behaved manner - VI-Scripting? Is it possible to "lift off" an element from a container?
Best Regards,
Leo
Solved! Go to Solution.
05-14-2020 10:49 AM
Drag it off of the tab control and back on the tab control where you want it. It is that easy.
05-14-2020 10:56 AM
@aeastet wrote:
Drag it off of the tab control and back on the tab control where you want it. It is that easy.
This drops the control inside the container. I do not want the control to drop inside the container. I do want the control to hover above the contrainer.
05-14-2020 11:07 AM
I would use a bar at the side or bottom of the window that is visible for every window. If you have a tab control make a section of the screen not roll with the tab control. There is no easy way to make a floating control.
05-14-2020 11:32 PM
Place the control on a blank part of the front panel. Single-click on it to select it (walking ants). Use the cursor keys to move it over the tab control.
05-15-2020 04:05 AM - edited 05-15-2020 04:05 AM
@aeastet wrote:
I would use a bar at the side or bottom of the window that is visible for every window. If you have a tab control make a section of the screen not roll with the tab control. There is no easy way to make a floating control.
Thanks! This made me notice that the element does not drop in if there is another element blocking the way.
So the trick would be to place a large helper object (e.g. a box decoration) across the tab control. It needs to be so large that it floats and does not drop into the tab control itself. New elements and controls can then be droppped onto that helper object - even directly from the palette. The new elements will be registered as floating above the container)
Afterwards, the helper object can be removed. The control will stay hovering above the container. Fine adjustments can then be done using the smash-keyboard method.
Then can be even done for objects already hovering that would otherwise drop - just paint a new hovering helper decoration, covering the object. Then, use Ctrl-J (or the re-order menu) and send it back down the layers until it is below the desired object, which then can be moved freely using mouse.
As added conveneince, the helper object can be made transparent to see the content of the container.
Another trick this showed me is that resizing does not trigger the dropping mechanism, so one could "walk" the object to its position by resizing until satisfied.
I have tried this with Tab Controls and Clusters and it works just fine.
Thanks again - knowing that there just is no simple way gave me confidence to try these workarounds.
05-15-2020 08:32 AM
@aeastet wrote:
I would use a bar at the side or bottom of the window that is visible for every window. If you have a tab control make a section of the screen not roll with the tab control. There is no easy way to make a floating control.
Thank You - this led me to some experimentation and I found a few tricks to help place floating controls.
I came up with a method using a helper object, such as a decoration box, placed across the container (I have tried and conformed that this works with clusters and tab controls). If a new element or control is placed on this helper object, it will also float above the container below. If all desired controls are in place, the helper container can be removed and the elements are still hovering. this has the benefit that new controls can be placed directly where they are supposed to hover.
For elements already placed (non-hovering) inside the container, they have to be brought in front of the decoration first, using the reordering menu.
Thanks again for stating that there is no easy way - this has allowed me to search for workarounds.
05-15-2020 09:31 AM - edited 05-15-2020 09:31 AM
@aeastet wrote:
I would use a bar at the side or bottom of the window that is visible for every window. If you have a tab control make a section of the screen not roll with the tab control. There is no easy way to make a floating control.
Thank You! My reply gets removed repeatedly (my original reply was much longer). The solution was to float a decoration element over the container. Controls can then be comfortably put on the decoration and stay floating is the decration is removed.
05-15-2020 10:49 AM
I'm glad you found a method that works for you! To me though, it seems like adding an extra decoration and then deleting it would be more work that just using the arrow keys. I use the arrow keys all the time to move objects around on the front panel even when they are not on top of another object. I usually press shift while pressing the arrow keys to move objects a far distance and then press the arrow keys without shift to get it exactly where I want. For me, it is intuitive and not really tedious.
05-15-2020 10:57 AM
As with everything in the programing world, there is usually more than one way of doing things. I am glad you shared your discovery with us so that now I know two ways of accomplishing the task!