Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-05

Strange behavior of AutoSizeColumn in StringGrid

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Valdas Jankūnas

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?

Valdas Jank?nas

Reply by email

Valdas Jankūnas

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?

Valdas Jank?nas -------------- next part -------------- A non-text attachment was scrubbed... Name: test.zip Type: application/x-zip-compressed Size: 2718 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150505/71176848/attachment.bin>

Reply by email

Jesus Reyes

El mar 5-may-15, Valdas Jank?nas escribi?:

Show quoted text 16 lines
Asunto: [Lazarus] Strange behavior of AutoSizeColumn in StringGrid A: "General mailing list" 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.freepascal.org/pipermail/lazarus/attachments/20150505/d4340105/attachment.obj>

Reply by email

Valdas Jankūnas
to Jesus Reyes

2015.05.06 01:52, Jesus Reyes ra??:

Show quoted text 12 lines
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.

tested on Linux: AutosizeColumn[s] stops working. But if I add line "aRect := Rect(0, 0, High(integer), High(integer));" before "DrawText..." then it works, also bug is gone.

Valdas Jank?nas

Reply by email

Jesus Reyes A.
to Valdas Jankūnas: 2015.05.06 01:52, Jesus Reyes ra??: tested on Linux: AutosizeColumn[s] stops working. But…
Valdas Jank?nas wrote 13 lines
2015.05.06 01:52, Jesus Reyes ra??: > 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. > tested on Linux: AutosizeColumn[s] stops working. But if I add line "aRect := Rect(0, 0, High(integer), High(integer));" before "DrawText..." then it works, also bug is gone.

I'm sorry for my previous two messages. I hope this time it will go ok. the following is what I replied in both cases.
- - - - - - - - - -

Weird, now I have tested in both Linux and Mac and it works fine without your change......

Anybody else?

Jesus Reyes A.

Reply by email