Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mouseup()
Message
From
25/06/2003 18:10:28
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00803849
Message ID:
00804026
Views:
29
Thanks for the pointer. I was using AmouseObj() but the problem was that I was calling drag() as well. For some reason, this caused a situation where I had to manually set focus to the form by clicking on it before mouseup() would fire. When I removed the drag() call, it just works. The only thing missing is that the mousepointer loses it shape when it's not over the original form, but I can live with that. Thanks again.

Gary

>AmouseObj() work well in design mode.
>Try the following sample.
>
>Click on the shape and while keeping the leftmouse pressed, drag over a form in desing mode.
>On mouse up, the name of the control will be showed in a messagebox...
>
>
>myForm=CREATEOBJECT('form1')
>myForm.Show()
>READ EVENTS
>
>DEFINE CLASS form1 AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 78
>	Width = 131
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>	ADD OBJECT shape1 AS shape WITH ;
>		Top = 24, ;
>		Left = 36, ;
>		Height = 24, ;
>		Width = 60, ;
>		Name = "Shape1"
>
>
>	PROCEDURE shape1.MouseUp
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>		this.MousePointer=0
>		IF AMOUSEOBJ(myArray)=4 AND myArray[1]<>this
>			MESSAGEBOX("Object="+myArray[1].name)
>		ENDIF
>	ENDPROC
>
>
>	PROCEDURE shape1.MouseDown
>		LPARAMETERS nButton, nShift, nXCoord, nYCoord
>		this.MousePointer=4
>	ENDPROC
>
>	
>	PROCEDURE QueryUnload
>		CLEAR EVENTS
>	ENDPROC
>	
>ENDDEFINE
>
>
>
>
>>Yuri,
>>I use AMOUSEOBJ(), but the trick is calling it. I can't seem to find any combination of events that will fire my code. The toolbox app that comes with VFP seems to be able to drop objects on a container class without requiring that every possible class that can have an object dropped on it have custom dragdrop code. Even when I put code in the dragdrop method, I can't get it to fire unless the form in running. How does one get the target form to run it's dragdrop code in design time? Thanks.
>>
>>Gary
>>
>>
>>>I believe AMOUSEOBJ() and sys(1270)(which is " a reference to the object that is under the current mouse position") should help here.
>>>
>>>>Hi all,
>>>>I'm trying to figure out how to recognise when the left mouse button has been released over a different form than the one where the mouse was pressed. I'm trying to drag from a listbox on one from and drop something on a form in the class designer. Right now it sort of works. When I release over the class being designed, nothing happens until I click on the class. Then my mouseup code runs and adds the object. I think I have tried every combination of drag(), mousemove(), etc. and I can't seem to trap that event over another form until I click on that form. It's possible to do this because the toolbox does it, but I cannot for the life of me figure out how they trap this event. Any ideas? Thanks.
>>>>
>>>>Gary
Previous
Reply
Map
View

Click here to load this message in the networking platform