LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control hovering over container elements on front panel

Solved!
Go to solution

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

0 Kudos
Message 1 of 10
(3,679 Views)

Drag it off of the tab control and back on the tab control where you want it. It is that easy.

Tim
GHSP
0 Kudos
Message 2 of 10
(3,677 Views)

@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.

0 Kudos
Message 3 of 10
(3,666 Views)
Solution
Accepted by topic author LLindenbauer

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.

Tim
GHSP
0 Kudos
Message 4 of 10
(3,652 Views)

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.

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

@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.

0 Kudos
Message 6 of 10
(3,538 Views)

@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.

0 Kudos
Message 7 of 10
(3,537 Views)

 


@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.

0 Kudos
Message 8 of 10
(3,535 Views)

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.

Message 9 of 10
(3,518 Views)

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!

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 10 of 10
(3,515 Views)