Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-07

GetFormRelativeMousePosition, GetCaretPos?

11 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Marc Weustink: ??? GetCaretPos hasn't anything to do with a mouse, so I don't think it is used. The…
Show quoted text 34 lines
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

Reply by email

Marc Weustink
to Marc Weustink: Pfff.... took some time and xlib hacking, but GetCursorPos is in CVS now. BTW, If someone…
Show quoted text 9 lines
At 02:32 29-7-2003 +0200, I wrote: >At 12:37 28-7-2003 +0200, I wrote: > >Pfff.... took some time and xlib hacking, but GetCursorPos is in CVS now. > >BTW, If someone is doing GTK2, GetCursorPos should be overridden and >reimplemented to use native gdk calls. Eehh.... I mean, the GTK version is in CVS.

The Win32 version is in CVS also

Marc

Reply by email

Marc Weustink
to Micha Nelissen: In the IDE designer these (see subject) two functions are used to determine the mouse…
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.

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.

Marc

Reply by email

Marc Weustink
to Marc Weustink: + From: Micha Nelissen + Sent: maandag 28 juli 2003 8:49 + + + > + > I guess that is a…
Show quoted text 26 lines
At 12:37 28-7-2003 +0200, I wrote: >+ From: Micha Nelissen >+ Sent: maandag 28 juli 2003 8:49 >+ >+ Marc Weustink wrote: >+ >+ > >+ > I guess that is a typo. GetCaretPos should have been GetCursorPos >+ > >+ > Fixed that. >+ >+ If the following is all fixed then positioning of controls on the >+ designer form work correctly, they get the position you want instead of >+ centered: >+ >+ winapi.inc:GetCursorPos -> interface:GetCursorPos -> >+ win32intf:GetCursorPos. >+ >+ You need to add that last one in win32winapi and win32winapih. > >OK, I'll look at it tonight. Pfff.... took some time and xlib hacking, but GetCursorPos is in CVS now. BTW, If someone is doing GTK2, GetCursorPos should be overridden and reimplemented to use native gdk calls.

Eehh.... I mean, the GTK version is in CVS.

Marc

Reply by email

Micha Nelissen
to Marc Weustink: ??? GetCaretPos hasn't anything to do with a mouse, so I don't think it is used. The…
Marc Weustink wrote 23 lines
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.

If the following is all fixed then positioning of controls on the designer form work correctly, they get the position you want instead of centered:

winapi.inc:GetCursorPos -> interface:GetCursorPos -> win32intf:GetCursorPos.

You need to add that last one in win32winapi and win32winapih.

Regards,

Micha.

Reply by email

Micha Nelissen

Hi,

In the IDE designer these (see subject) two functions are used to determine the mouse position? 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.

Regards,

Micha.

Reply by email

Micha Nelissen
to Marc Weustink: ??? GetCaretPos hasn't anything to do with a mouse, so I don't think it is used. The…
Marc Weustink wrote 21 lines
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

Please take a :GetCursorPos. It calls GetCaretPos.

Thanks,

Micha.

Reply by email

Marc Weustink
to Marc Weustink: ??? GetCaretPos hasn't anything to do with a mouse, so I don't think it is used. The…
Micha Nelissen wrote 13 lines
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.

Show quoted text 10 lines
>>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.

Marc

Reply by email

Micha Nelissen
to Marc Weustink: ??? GetCaretPos hasn't anything to do with a mouse, so I don't think it is used. The…
Marc Weustink wrote 10 lines
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.

Show quoted text 8 lines
> 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.

Regards,

Micha.

Reply by email

Marc Weustink
to Micha Nelissen: If the following is all fixed then positioning of controls on the designer form work…
Show quoted text 20 lines
+ From: Micha Nelissen + Sent: maandag 28 juli 2003 8:49 + + Marc Weustink wrote: + + > + > I guess that is a typo. GetCaretPos should have been GetCursorPos + > + > Fixed that. + + If the following is all fixed then positioning of controls on the + designer form work correctly, they get the position you want instead of + centered: + + winapi.inc:GetCursorPos -> interface:GetCursorPos -> + win32intf:GetCursorPos. + + You need to add that last one in win32winapi and win32winapih. OK, I'll look at it tonight.

Pfff.... took some time and xlib hacking, but GetCursorPos is in CVS now.

BTW, If someone is doing GTK2, GetCursorPos should be overridden and reimplemented to use native gdk calls.

Marc

Reply by email

Marc Weustink
to Micha Nelissen: If the following is all fixed then positioning of controls on the designer form work…

+ From: Micha Nelissen
+ Sent: maandag 28 juli 2003 8:49
+
+ Marc Weustink wrote:
+
+ >
+ > I guess that is a typo. GetCaretPos should have been GetCursorPos
+ >
+ > Fixed that.
+
+ If the following is all fixed then positioning of controls on the
+ designer form work correctly, they get the position you want instead of
+ centered:
+
+ winapi.inc:GetCursorPos -> interface:GetCursorPos ->
+ win32intf:GetCursorPos.
+
+ You need to add that last one in win32winapi and win32winapih.

OK, I'll look at it tonight.

Marc

Reply by email