Mattias Gaertner napisał(a):
On Sat, 18 Mar 2006 13:35:51 +0100
darekm <[EMAIL PROTECTED]> wrote:

  
Mattias Gaertner wrote:

    
On Tue, 14 Mar 2006 18:21:32 +0100
darekm <[EMAIL PROTECTED]> wrote:

 

      
tLabel should care about WordWrap property

attached patch repair it
   

        
Thanks. Applied.

Mattias

 

      
Thanks

but I find new item:


Index: include/customlabel.inc
===================================================================
--- include/customlabel.inc    (wersja 8956)
+++ include/customlabel.inc    (kopia robocza)
@@ -39,7 +39,8 @@
     R := Rect(0,0, Width, Height);
     OldFont:=SelectObject(DC, Font.Handle);
     Flags:=DT_CalcRect;
-    if WordWrap then inc(Flags,DT_WordBreak);
+    if WordWrap then inc(Flags,DT_WordBreak)
+                else inc(Flags,DT_SingleLine);
    

From
http://msdn.microsoft.com/library/default.asp?url="">

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

Darek




  
     DrawText(DC, PChar(Caption), Length(Caption), R, Flags);
     SelectObject(DC, OldFont);
     // add one to be able to display disabled label



Darek
PS. What's about my previously patch (tComboBox)
  now I have much more investigation:
    

Applied.
I changed the NumLines>1 with a DT_CALCRECT<>0. 

  
[...]
    

Mattias

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


  

Reply via email to