[Lazarus] Strange behavior of AutoSizeColumn in StringGrid

Jesus Reyes jesusrmx at yahoo.com.mx
Wed May 6 00:52:13 CEST 2015


El mar 5-may-15, Valdas Jankūnas <zmuogs at gmail.com> escribió:

>  Asunto: [Lazarus] Strange behavior of AutoSizeColumn in StringGrid
>  A: "General mailing list" <lazarus at lazarus.freepascal.org>
>  Fecha: martes, 5 de mayo de 2015, 14:43
>  
>  Hello,
>  
>  situation: GridColumn.Multiline is TRUE and one of
>  StringGrid's cell has 
>  multiline text. If I perform StringGrid.AutosizeColumn[s]
>  then column 
>  width become like all text of cell was in single line
>  (attached test 
>  project: try to press button several times).
>  
>    Is this a Bug?
>  

Well, apparently it could be a bug with a side effect :).

It seems the Multiline property is a Column's Title property not a column property
however it is treated as if it is a column property, something that should only affect
the title cell but it actually affects the whole column. That's the side effect.

If that is the intended behaviour (Multiline title property is a contribution, Werner?) 
then it's OK to me, in that case please try the attached patch and write back your results,
here I tested under Windows and it seems to work fine.

Jesus Reyes A.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autosizemultiline.diff
Type: application/octet-stream
Size: 1250 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150505/d4340105/attachment-0003.obj>


More information about the Lazarus mailing list