[lazarus] Win32 bug: tcontrol's painting themselves intgroupboxes

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Sep 1 14:34:40 EDT 2003


On Mon, 01 Sep 2003 13:49:21 +0200
Micha Nelissen <M.Nelissen at student.tue.nl> wrote:

> Mattias Gaertner wrote:
> 
> > On Sun, 31 Aug 2003 20:59:49 +0200
> > Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> > 
> > 
> >>Mattias Gaertner wrote:
> >>
> >>
> >>>On Sun, 31 Aug 2003 18:54:50 +0200
> >>>Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> >>>
> >>>
> >>>
> >>>>On Sun, 31 Aug 2003 16:58:18 +0200
> >>>>Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>The problem is the following: if a tcontrol paints itself to it's
> >>>
> >>>parent>>
> >>>
> >>>>>DC, and the parent's clientrect is different than the origin, the 
> >>>>>tcontrol's will paint themselves to the wrong position, namely the 
> >>>>>parent.topleft, not the topleft of the clientrect. This happens with 
> >>>>>TColorButton's in TGroupboxes for example. How do we solve this?
> >>>>>
> >>>>>FYI: Delphi has not solved this, a control at position (0,0) in a 
> >>>>>tgroupbox is painted on top of the caption, while we want it in the 
> >>>>>clientrect.
> >>>>
> >>>>Right.
> >>>>An additional problem is, that the gtk paints before and the win32
> >paint>>>during message handling and they both uses different DC origins.
> >There>>
> >>>are>plenty of possibilities, where the origin can be moved to fix this.
> >I>>will>also look into this ...
> >>>
> >>>
> >>>Maybe I find a solution.
> >>
> >>Hmm, not quite :(. The groupbox caption is not drawn anymore. It seems 
> >>the window rect has stayed in the same position, but the whole box has 
> >>moved up. Difference in top position of tcontrols and twincontrols has 
> >>stayed the same.
> > 
> > 
> > Hmm. It works for me. I have to test more examples...
> 
> Well, what did you try? Can you try attached example? It is a modified 
> groupbox example.

Works under wine.
Probably the menu is making problems.

 
> > BTW, GetCLientBounds was not implemented and so I started it. It is not
> > complete yet. 
> 
> To what extent can it be blamed?

Don't know. It was just a note, that some central dimension/position
functions are not yet implemented and this can result in strange errors,
including double bugs and quantum computing.


Mattias






More information about the Lazarus mailing list