I coded my "mouse_leave" event and have a couple of problems. Shown
below is my code.
First, some background. I have a UODW that sits on a tab. The tab sits
on a window. Currently I am dragging the mouse over a UODW and firing
off the code in the descendant of this UODW.
I have SetCapture and ReleaseCapture defined as "user32.dll" on my
UODW for now, in my Local External Functions.
When I use "SetCapture( Handle( Parent ) )", the application locks up
in a very big way. Why is this doing this?
My second problem is xpos and ypos. Even though I convert xpos(ypos)
to Units using PixelsToUnits, the xpos and ypos when dragged over the
UODW start referencing at zero. For example, drag the mouse accross
the UO's leftmost border, the xpos shows zero units, than increases
dramatically to a value several times larger than the actual UO.
For example, if my UO has width of 1111 and height of 196, my
xpos(ypos) will have max values of 5056 and 768 respectively.
In additionally, the other pieces of my code, like (This.x) and
(This.x + This.width) will correctly display the PB Units where this
UO has been dropped on the tab. That works fine. The error seems to
come from xpos(ypos). It's as if the pointer has no idea where it is,
and what units its using.
Anybody ever encounter this?
IF NOT ibCaptured THEN
SetCapture( Handle( this ) )
//SetCapture( Handle( Parent ) )
ibCaptured = TRUE
This.trigger event ue_mouse_in()
Xpointer = PixelsToUnits(xpos, XPixelsToUnits!)
Ypointer = PixelsToUnits(ypos, YPixelsToUnits!)
IF Xpointer < (This.x) OR &
Xpointer > (This.x + This.width) OR &
Ypointer < (This.y) OR &
Ypointer > (This.y + This.height) THEN
llx = string(This.x)
llxx = string(This.x + This.width)
lly = string(This.y)
llyy = string(This.y + This.height)
This.object.LabelA = 'X:'+string(Xpointer)+' ['+ llx +', '+ llxx
This.object.LabelB = 'Y:'+string(Ypointer)+' ['+ lly +', '+ llyy
IF ReleaseCapture() THEN
ibCaptured = FALSE
This.trigger event ue_mouse_out()