LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pop-up Window Location

Solved!
Go to solution

I want my pop-up window to appear near the control that summons it.  I've read about this on other threads, but my implementation does not work--the pop-up always appears in the same place, and its location has nothing to do with the location of the control that summons it.

 

I've attached images showing the VI and its pop-up sub VI.

 

The VI:

 

 

The pop-up:

 

(Edited for bad HTML.)

Message Edited by DJDDA on 12-19-2008 01:05 PM
Download All
0 Kudos
Message 1 of 9
(4,649 Views)

since your using an event structure, the mouse down or mouse up or mouse "down?" will give you button coordinates. From the coordinates you can then fine tune where you position your control.

 

If you must use value change event, you could wire in the "Open VI", "Panel" "Controls[]" property find the match for the ref and get the controls position property...

 

just 2 out of many to do this

 

regards

Message 2 of 9
(4,635 Views)
Solution
Accepted by DJDDA
Your problem has to do with local coordinates vs global coordinates. The Left and Top properties are in local coordinates, meaning they are relative to the top left of the window. The FP.PanelBounds are in global coordinates. This means they are relative to the top-left of the monitor. Thus, you need the location of the window that contains the "Fine Gain" control and account for that when setting the location of your popup.
Message 3 of 9
(4,629 Views)

Is there a property node (or anything else) that will give the location of the mouse pointer when it fires, then?  I found one for "Cursor," but it doesn't seem to be as simple as just "the mouse is here."

 

Until I can find something like that, I'll probably just find a reference for the location of the window and add its position to the position of the control to get a total.

0 Kudos
Message 4 of 9
(4,616 Views)

There is a 'Panel to Global Coordinates' method.

 

Here is an (untested) piece of code that should work:

 

 

Ton

 

 

Message Edited by TonP on 12-19-2008 10:21 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 9
(4,591 Views)

Well, here's what I did.  It works, though I still want something that gives me my mouse pointer location.

 

I'm curious, though--what does adding zero do for you, TonP?

 

 

 

 
 
 
 
 
Edit: I just figured out what Richjoh meant.  Yeah, that would do it, thanks!
Message Edited by DJDDA on 12-19-2008 03:32 PM
0 Kudos
Message 6 of 9
(4,586 Views)
Never mind that last edit.  Mouse pointer location is also given only in local coordinates, my little addition tree would still be necessary.
0 Kudos
Message 7 of 9
(4,580 Views)

The coordinates constant I used is meant for input from the 'Mouse Down' coordinates.

That should only be used if the coordinates are 'control local', otherwse you can chime in later.

 

Besides there is no need to add horizontal and vertical coordinates separate, you can add them in one run like I have shown.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 8 of 9
(4,573 Views)
Oh, right.  Thanks.
0 Kudos
Message 9 of 9
(4,560 Views)