[Lazarus] WordWrap in TLabel

Martin lazarus at mfriebe.de
Sat Sep 14 16:19:09 CEST 2013


On 14/09/2013 15:08, Jürgen Hestermann wrote:
>
> Am 2013-09-14 15:09, schrieb Bart:
>> On 9/14/13, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:
>>
>>> Does anybody know where the routine resides that actually
>>> does the splitting into lines of TLabel.Caption (if WordWrap is true)?
>>> I don't like it's behaviour and want to change (overwrite) it.
>> Probably done by the widgetset.
>
> I fear that it's like that.
> Too bad that programmers have less and less
> of their programs under their control.
>
See

function TCustomLabel.CalcFittingFontHeight(const TheText: string;
   MaxWidth, MaxHeight: Integer;
   var FontHeight, NeededWidth, NeededHeight: integer): Boolean;


A flag is given to DrawText

You can look up DrawText in each widgetset, it may exist with and 
without themes...
Best to hit it in the debugger, and see where it goes.

---
What exactly do you want to change?

IMHO it works very well, even with auto-sizing, BUT you need to anchor 
left and right to other controls





More information about the Lazarus mailing list