[lazarus] datasource - dataset

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Mon Dec 30 12:44:16 EST 2002




On Mon, 30 Dec 2002, [iso-8859-1] Jesus Reyes wrote:

> > There is no GetDisplayWidth function. What should it
> > do according to you ?
> > Something like:
> > Function TField.GetDisplayWidth : Longint;
> >
> > begin
> >   If FDisplayWidth<>0 then
> >     Result:=FDisplayWidth
> >   else
> >     Result:=DataSize
> > end;
> >
> > Or what ?
>
> Yes, or maybe:
>
> ....
>    else
>       Result:=GetDefaultWidth;
>
> which is currently implemented in TField. Some other
> derivatives could override it or just let the default
> that TField set, being still free of setting
> DisplayWidth directly.
>
> By the way, something like:
>
>       property Size; default 20;
>
> declared in TStringField really set Size:=20 when
> one creates a instance of TStringField?

No.

> or it has
> another purpose? I'm affraid the reference manual does
> not mention it

The 'default' is a hint for the streaming property: it means that if the
value equals the default value, the streaming system should not stream the
value of that property. It saves time and space

But you must still set the default value in the constructor or some other
place.

Michael.






More information about the Lazarus mailing list