Recent

Author Topic: head hurting - DBGrid Word Wrapping  (Read 15322 times)

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Re: head hurting - DBGrid Word Wrapping
« Reply #15 on: July 01, 2013, 09:02:05 am »
Hi Taazz

Thanks for the second example

It says it requires "virtualtreesextra"

I don't have this - is it requried for the revised code?
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: head hurting - DBGrid Word Wrapping
« Reply #16 on: July 01, 2013, 12:44:13 pm »
no, and I do not know why it says that just remove the requirement.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

cazzajay

  • Jr. Member
  • **
  • Posts: 94
Re: head hurting - DBGrid Word Wrapping
« Reply #17 on: July 02, 2013, 09:11:28 am »
Thank you that worked a charm!
Windows XP 32 bit / Lazarus 1.0.6 / FPC 2.6.0

robertom

  • Newbie
  • Posts: 1
Re: head hurting - DBGrid Word Wrapping
« Reply #18 on: November 08, 2025, 01:52:08 am »
Although a little late, the code for Word Wrapping was quite useful to me, and I am grateful to cazzajay and taazz. However, I noticed that under specific conditions, the line break generated a blank line while adjusting the column width. After analyzing the code and debugging, I discovered that the triggering condition occurred when the column edge coincided with a word followed by a space. Therefore, I recommend that in Unit1.pas, on line 91, "SetString(Line, S, E - S + 1)" be changed to:
Code: Pascal  [Select][+][-]
  1.     begin
  2.       if E < S then
  3.         SetString(Line, S, P - S)
  4.       else
  5.         SetString(Line, S, E - S + 1);
  6.     end
  7.  
I hope this will be useful to someone else. Greetings and thank you.
« Last Edit: November 08, 2025, 02:01:38 am by robertom »

 

TinyPortal © 2005-2018