Vincent Snijders wrote:
Mattias Gaertner wrote:

On Sat, 18 Mar 2006 16:04:12 +0100
darekM <[EMAIL PROTECTED]> wrote:

DT_SINGLELINE     Displays text on a single line only. Carriage
returns and linefeeds do not break the line.

Setting DT_SINGLELINE would prohibit to use custom line breaks.


if WordWrap=false then label should be in one line (eq. singleline), calculate rectangle should care about it,
when not  DT_SINGLELINE include, draw text is use more complicated part.
tLabel in most cases is single line
We have three cases:
1.  single line,
2.  multiple line divide by carriage return
3. multiple line divide by carriage return and anywhere - when is not insufficient place

in tLabel we have only WordWrap property, for me its not the same like dt_wordWrap only differ from single and multiple line, tLabel must not difference case 2 and 3, in most cases is the same, only cases 1 and 3



Why should TLabel ignore user's line breaks when WordWrap=false?
Do you think, it is this too complicated for the widgetsets?


This patch seems to be applied in 8956, but it breaks expected behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964.

Can I revert that patch?

IMHO, the user can make a difference between 1 and 2 by adding LineEndings in its text and between 1 and 3 by setting WordWrap to true. Note that AutoSize won't enlarged the width of label, unless the longest word doesn't fit, if you set WordWrap to true.


I have taken a better look and I propose this patch:

Vincent

Index: customlabel.inc
===================================================================
--- customlabel.inc     (revision 9073)
+++ customlabel.inc     (working copy)
@@ -365,11 +365,7 @@
     FillChar(TR,SizeOf(TR),0);
     With TR do begin
       Alignment := Self.Alignment;
-      if wordWrap then begin
-        WordBreak := True;
-      end else begin
-        SingleLine:=true;
-      end;
+      WordBreak := WordWrap;
       Clipping := True;
       ShowPrefix := ShowAccelChar;
       SystemFont:=false;

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to