On Tue, 25 Jul 2006 10:53:25 +0200 (Romance Daylight Time)
Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

> 
> 
> On Tue, 25 Jul 2006, Mattias Gaertner wrote:
> 
> > On Tue, 25 Jul 2006 09:49:03 +0200
> > Micha Nelissen <[EMAIL PROTECTED]> wrote:
> >
> >> Michael Van Canneyt wrote:
> >>> Creating a separate GUI object for each object in your database is a
> >>> very bad idea;
> >>> I worked with such programs, and at 250 tables in the model, such
> >>> programs become
> >>> incredibly slow. A redraw takes forever.
> >>
> >> TGraphicControls like TBevel and TCustomLabel should be ok, as they are
> >> drawn by the LCL (also clipped IIRC, Mattias?) and do not consume
> >> OS/widgetset resources.
> >
> > Yes, they are clipped.
> > I just tested: 1000 TShapes in a TScrollBox are no problem. Although it
> > needs double buffering.
> > Under gtk you can also put 1000 buttons without problem.
> > And 1000 TListBoxes with 20 items each are slow, but still usable.
> > Although the LCL caches write warnings because they suspect a leak. ;)
> >
> > I tested cross compiled under wine:
> > It is really slow.
> >
> > So, the LCL does not scale too bad.
> >
> > Maybe someone wants to test under native window:
> >
> > procedure TForm1.FormCreate(Sender: TObject);
> > var
> >  i: Integer;
> >  j: Integer;
> > begin
> >  for i:=0 to 999 do begin
> >    with TListBox.Create(Self) do begin
> >      SetBounds((i mod 33)*100,(i div 33)*100,100,100);
> >      for j:=1 to 50 do
> >        Items.Add(IntToStr(j));
> >      Parent:=ScrollBox1;
> >    end;
> >  end;
> > end;
> 
> Your code doesn't work under Delphi. You need to assign the parent before
setting the position :-)

Hehe.

This LCL feature can be used as an optimization. As long as the parent is
not set, no handle is created and there is no communication with the other
components on the form, so changing properties is fast. That's why when
creating a control manually set the 'Parent' last. 
Do we have already a LCL tips wiki page?

 
> Other than that it seems to work at normal speed. Couldn't test scrolling
in lazarus, 
> since the scrollbox doesn't show the scrollbars.

AutoScroll = true

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to