[lazarus] GetFormRelativeMousePosition, GetCaretPos?

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jul 28 02:06:49 EDT 2003


On Sun, 27 Jul 2003 19:12:10 +0200
Marc Weustink <marc at dommelstein.net> wrote:

> At 18:59 27-7-2003 +0200, Micha Nelissen wrote:
> >Marc Weustink wrote:
> >
> >>At 17:50 27-7-2003 +0200, Micha Nelissen wrote:
> >>
> >>>Hi,
> >>>
> >>>In the IDE designer these (see subject) two functions are used to 
> >>>determine the mouse position?
> >>
> >>??? GetCaretPos hasn't anything to do with a mouse, so I don't think it 
> >>is used.
> >
> >I thought so too, but check GetFormRelativeMousePosition in
> >designerprocs.pas.
> 
> I guess that is a typo. GetCaretPos should have been GetCursorPos
> 
> Fixed that.
> 
> >>>AFAIK, there is no caret on a form and on windows GetCaretPos returns 
> >>>the client position of the caret of whatever it currently is in. Please
> >
> >>>explain.
> >>
> >>The Caret (on windows) is system wide. There is only one Caret (that's 
> >>why you don't have to specify a handle in GetCaretPos) and it is per
> >def. >in the currently focused window.
> >
> >The strange thing is that the form origin is subtracted from it, but
> >since GetCaretPos is client relative position, this can never give a
> >correct result.
> 
> Indeed, but GetCaretPos shouldn't been used there anyway.

Right. We have to fix this.


Mattias






More information about the Lazarus mailing list