Sign in Join

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

Mailing lists / lazarus / 2017-05

TEdit appears empty when text is too long

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Denis Kozlov

Hi,

Has anybody experienced this problem or might know what is going on here?

At around 5K characters the content of TEdit suddenly appears empty/blank (visually). The content is correct when retrieved programmatically. If enough characters are removed (programmatically) the content will show up again. Changing the font size changes this limit, where the limit is lower for a larger font size.

It is as if the issue is bound by the visual width of entire text content, as opposed to just the small visible part.

Tested on Windows 7:
Lazarus 1.4.4 r49931 FPC 2.6.4 i386-win32-win32/win64 Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Lazarus 1.9.0 r54874 FPC 3.0.2 i386-win32-win32/win64

Also tested with Delphi 7, where the limit appeared past 50K characters.

Sample project is attached.

I will appreciate any clues to what's going on here.

Thanks,
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EditTextTooLong.zip
Type: application/octet-stream
Size: 3586 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170512/0c93354a/attachment.obj>

Reply by email

Alexey
to Denis Kozlov

I only say that ATBinHex component cannot draw too long lines (by DrawTextW? TextOutW?) when API takes more than 4K chars (fixed to using only small cnt of chars).

Denis Kozlov wrote
width of entire text content, as opposed to just the small visible part.
Regards, Alexey

Reply by email

Denis Kozlov
to Alexey

Thanks. This seems to confirm my theory.

Alexey wrote 8 lines
I only say that ATBinHex component cannot draw too long lines (by DrawTextW? TextOutW?) when API takes more than 4K chars (fixed to using only small cnt of chars). On 12.05.2017 02:10, Denis Kozlov via Lazarus wrote: > width of entire text content, as opposed to just the small visible part.

Reply by email

Denis Kozlov
to Denis Kozlov: Has anybody experienced this problem or might know what is going on here? At around 5K…

I have tested Windows API directly using DrawText, TextOut and ExtTextOut functions - they all suffer from this problem.

The problem is bound by the total width of the drawn text (not just the small visible portion), where beyond some point it breaks. There appears to be no feasible workaround. It may be possible to programmatically break apart long text and draw it in chunks, but that is ugly and only addresses the symptoms of an unstable problem within Windows platform.

Moving on now...

Denis

Denis Kozlov wrote 26 lines
Hi, Has anybody experienced this problem or might know what is going on here? At around 5K characters the content of TEdit suddenly appears empty/blank (visually). The content is correct when retrieved programmatically. If enough characters are removed (programmatically) the content will show up again. Changing the font size changes this limit, where the limit is lower for a larger font size. It is as if the issue is bound by the visual width of entire text content, as opposed to just the small visible part. Tested on Windows 7: Lazarus 1.4.4 r49931 FPC 2.6.4 i386-win32-win32/win64 Lazarus 1.6.4 r54278 FPC 3.0.2 i386-win32-win32/win64 Lazarus 1.9.0 r54874 FPC 3.0.2 i386-win32-win32/win64 Also tested with Delphi 7, where the limit appeared past 50K characters. Sample project is attached. I will appreciate any clues to what's going on here. Thanks, Denis

Reply by email