[lazarus] GTK team: please specify!

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Oct 30 12:48:37 EST 2003


On Thu, 30 Oct 2003 14:46:48 +0100
Micha Nelissen <M.Nelissen at student.tue.nl> wrote:

> Mattias Gaertner wrote:
> 
> > On Thu, 30 Oct 2003 08:59:31 +0100
> > Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> > 
> > 
> >>Hi,
> >>
> >>I need your help on these functions, are the coordinates specified in 
> >>clientrect coordinates or screen coordinates:
> >>
> >>1) (TGTKObject|TInterfaceBase).FillRect
> > 
> > 
> > relative to clientorigin
> 
> Doesn't seem to be so when testing controlselection.pp, DrawGrabbers... 
> FillRect is passed the screen-relative points of the grabber handle 
> instead of client-origin. But this may be a problem in DC.FormOrigin 
> instead... I removed in my local copy the Diff subtraction from the 
> grabbers.left,top and then it was drawn at the correct location on win32.

About TControlSelection.DrawGrabbers:

FGrabbers[g].Left/Top are holding the position of a grabber relative to the
client origin of the form.
The line
Diff:=DC.FormOrigin;
gets the DC origin also relative to the form origin.
Therefore the grabber is painted at FGrabbers[g].Left-Diff.X.

 
> >>2) (TGTKObject|TInterfaceBase).GetWindowOrgEx
> > 
> > 
> > screen
> > 
> > What is GetWindowOrgEx exactly supposed to return in the win32api? 
> 
> Returns the current drawing origin within the current device context. So 
> drawing a pixel at 10,15 with origin of 15,20 will draw a pixel at 25,35.

Is the 15,20 relative to the screen or the parent window?
And more important: What function returns the DC origin relative to the
screen?


Mattias






More information about the Lazarus mailing list