12-19-2008 01:01 PM - edited 12-19-2008 01:05 PM
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.)
Solved! Go to Solution.
12-19-2008 01:21 PM
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
12-19-2008 01:33 PM
12-19-2008 02:02 PM
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.
12-19-2008 03:19 PM - edited 12-19-2008 03:21 PM
There is a 'Panel to Global Coordinates' method.
Here is an (untested) piece of code that should work:
Ton
12-19-2008 03:24 PM - edited 12-19-2008 03:32 PM
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?
12-19-2008 03:37 PM
12-19-2008 03:50 PM
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
12-19-2008 04:23 PM