[lazarus] GTK team: please specify!
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Oct 31 10:22:48 EST 2003
On Fri, 31 Oct 2003 16:16:05 +0100
Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> Mattias Gaertner wrote:
>
> > On Fri, 31 Oct 2003 12:51:10 +0100
> > Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> >
> >
> >>>>>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.
> >>
> >>Indeed. I have fixed the code.
> >
> >
> > No.
> >
> > You changed the Diff, which is absolutely correct. The bug lies
> > somewhere in the calculation of DC.FormOrigin.
> > Maybe my lines above were ambigious. An example:
> > A designer form is at 100,200, has a TGroupBox at 30,30, with a border
> > of 5,5. And there is an non visual component icon at 50,50. These 50,50
> > is relative to the client origin of the form. This means the icon should
> > be drawn at 15,15 in the client area of the groupbox.
> >
> > Paint messages:
> > Don't take this example too serious, it is the system that is important.
> > When the LCL gets a paint message for the groupbox, the designer gets
> > also the paint message. The paint message DC origin (0,0) is the
> > left,top of the client area of the groupbox. So, relative to the client
> > area of the form it is 35,35 = DC.FormOrigin.
> > So, the icon (at 50,50) is painted at 15,15.
>
> Indeed, but IN the groupbox !
Yep. I was talking about a paint message for the groupbox.
You can't paint with a paint message for a form on every control of the
form, because of the internal clipping of the interface.
If the interface is capable of sending one paint message for the whole form,
then the designer could use only this message. But as we didn't had such an
interface, it is not yet supported.
> If I now move the groupbox, windows
> remembers it's painted image and the invisible component moves with it.
> How is this handled?
Normally, moving a control, should invalidate it, which result in a paint
message for the control, which will automatically repaint the control and
the designer will repaint the icon (at the new position, so that it appears
to be fixed).
Mattias
More information about the Lazarus
mailing list