SetCapture(Parent)

SetCapture(Parent)

Post by rzogli » Sat, 21 Feb 2004 23:45:47


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?

Zog


IF NOT ibCaptured THEN
SetCapture( Handle( this ) )
//SetCapture( Handle( Parent ) )
ibCaptured = TRUE
This.trigger event ue_mouse_in()
ELSE
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[1] = 'X:'+string(Xpointer)+' ['+ llx +', '+ llxx
+']'
This.object.LabelB[1] = 'Y:'+string(Ypointer)+' ['+ lly +', '+ llyy
+']'

IF ReleaseCapture() THEN
ibCaptured = FALSE
This.trigger event ue_mouse_out()
END IF
END IF
END IF
 
 
 

1. Parent and grand parent and great grand parent etc.

2. <Parent ID=1><Parent ID=2><Parent ID=3><Parent ID=4><Parent ID=5>

I am using XSD View to generate XML Data using IIS for SQLXML SP2.
However, the data, after being queried by XPath, turns out to be not
in its original hierarchy but like the following:

<Parent ID=1><Parent ID=2><Parent ID=3><Parent ID=4><Parent ID=5>
<Child></Child><Child></Child><Child></Child><Child></Child><Child></Child>
<GrandChild></GrandChild><GrandChild></GrandChild><GrandChild></GrandChild><GrandChild></GrandChild><GrandChild></GrandChild>


Is there any quick thing I should look first?

Thanks.

3. Problem with SetCapture

4. Help using SetCapture and MouseUp event

5. Need help with SetCapture & Release Capture API

6. hWnd, Extender and SetCapture

7. Custom Combo BOX -> setCapture problem!

8. SetCapture

9. Implementing SetCapture with OwnerDraw button

10. Problem with SetCapture

11. wxJoystick second SetCapture problem

12. questions around SetCapture (image grab)

13. SetCapture not caputring mouse events for me

14. SetCapture before mouse click is made

15. SetCapture Problem