[Lazarus] Visual "uglyness" when creating TSynEdit @ runtime in my app

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Jan 5 10:37:03 CET 2013


On Sat, 05 Jan 2013 08:32:54 +0000
Martin <lazarus at mfriebe.de> wrote:

> On 05/01/2013 01:06, Mattias Gaertner wrote:
> > On Sat, 5 Jan 2013 00:47:38 +0100
> > Bart <bartjunk64 at gmail.com> wrote:
> >
> >> On 1/4/13, Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> >>
> >>> It sounds like a bug in the LCL Win32 interface.
> >>> I don't have win32 here to test.
> >>> There should be no Paint events during your code. Are there?
> >> How do I test this?
> > Set the OnPaint event of the synedit and add a debugln.
> >
> >   
> 
> Just for reference, I did some tests on Win Vista 32 bit
> 
>    s:=PageControl1.AddTabSheet;
>    l := TSynEdit.Create(self);
>    l.Align := alClient;
>    l.Parent := s;
>    PageControl1.ActivePage := s;
> 
> ActivePage will trigger painting, but it first aligns the SynEdit, so I 
> get a correct display.

Does "trigger" means immediate paint or a normal queued message?
There should be no immediate paints. Except those explicitly forced
by the user code.

 
>    s:=PageControl1.AddTabSheet;
>    PageControl1.ActivePage := s;
>    l := TSynEdit.Create(self);
>    l.Align := alClient;
>    l.Parent := s;
> 
> - again ActivePage causes painting, but synEdit is not existent yet-
> - l.Parent := s;  causes SynEdit to be correctly resized. Also paints 
> the SynEdit's Scrollbars (does not call synEdit paint, only scrollbars / 
> Scrollbars cover client area)
> 
> and therefore finally
> 
>    s:=PageControl1.AddTabSheet;
>    PageControl1.ActivePage := s;  // paint tabsheet
>    l := TSynEdit.Create(self);
>    l.Parent := s;                               // paint scrollbars, not 
> yet aligned
>    l.Align := alClient;                      // paint scrollbars 
> (again), this time aligned. Since synedit itself does not yet paint, the 
> previous painted scrollbars remain a visible image

It seems the Win32 intf triggers immediate paints.
Maybe some win32 developer can explain why.

Mattias




More information about the Lazarus mailing list