ControlDragging was: Re: [lazarus] CVS Changes
smiller at lakefield.net
Wed Jun 14 21:44:27 EDT 2000
I agree that if it would send the corrd's based on the sender then this
would be much easier. However, by using Mouse.CursorPos I was using the
coord's based on the position on the screen. That would work fine but it's
a bit tougher to calculate the new location (Take the mouse x , subtract the
form's left add the difference between where you clicked ititially and the
left of the control).
Take a look at other product/projects of mine below!
Get paid to surf the net!
Get paid to surf the net by clicking here too!!!
Home page : http://www.lakefield.net/~smiller
Auto-IP Publisher : http://www.autoip.net
Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard
Lazarus : http://www.lazarus.freepascal.org
----- Original Message -----
From: "Marc Weustink" <weus at quicknet.nl>
To: <lazarus at miraclec.com>; <lazarus at miraclec.com>
Sent: Wednesday, June 14, 2000 3:48 PM
Subject: ControlDragging was: Re: [lazarus] CVS Changes
> At 13:30 14-06-2000 -0500, Shane Miller wrote:
> >Press the NEW FORM button.
> >Select the Button component and drop it onto the form.
> >Drag the button 2 pixels up. It probably moved a little. Now do it
> >It doesn't work.
> >If you look at the output (look at designerform.pp in mousedown and
> >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem
> >be reported incorrectly.
> >If you MOVE the form then try it again it's reported correctly.
> >This also occurs when trying to place controls onto the form. Sometimes
> >they appear correctly, sometimes not.
> >When they dont you can move the form and thn the next one appears
> >Any ideas?
> Mouse.Cursorpos is given in screen coordinates, not in form coordinates.
> Onmousedown you store Cursorpos (or better, the given X and Y),
> onmouseUp you calc the difference with the new Cursorpos (or better, the
> given X and Y) THe difference is added to the Left and Top.
> I committed a solution which normally should work, however it doesn't due
> to a bug in the MouseMove and MouseUp handlers
> MouseMove / MouseUp should always give the mouseposition X and Y in the
> Sender coordinates. It does as long as the up event occoured in the
> control itself. However if you are outside the control you get the X and Y
> in Form coordinates.
> To unsubscribe: mail lazarus-request at miraclec.com with
> "unsubscribe" as the Subject
> archives at http://www.miraclec.com/list_archives/lazarus
More information about the Lazarus