Hi
Attached patch enable SingleLine for draw tLabel
1. correct calculate size of text for drawtext with DT_SINGLELINE
2.We should enable SingleLine in Paint and CalcSize (as I set) or
disable in both.
Darek
Index: interfaces/gtk/gtkwinapi.inc
===================================================================
--- interfaces/gtk/gtkwinapi.inc (wersja 9016)
+++ interfaces/gtk/gtkwinapi.inc (kopia robocza)
@@ -2782,7 +2782,10 @@
If (Flags and DT_SingleLine) > 0 then begin
// ignore word and line breaks
GetTextExtentPoint(DC, Str, Count, AP);
- theRect.Right := theRect.Left + Min(MaxLength, AP.cX);
+ if (Flags and DT_CalcRect)<>0 then
+ theRect.Right := theRect.Left + AP.cX
+ else
+ theRect.Right := theRect.Left + Min(MaxLength, AP.cX);
theRect.Bottom := theRect.Top + TM.tmHeight;
end
else begin
Index: include/customlabel.inc
===================================================================
--- include/customlabel.inc (wersja 9016)
+++ include/customlabel.inc (kopia robocza)
@@ -40,6 +40,7 @@
OldFont:=SelectObject(DC, Font.Handle);
Flags:=DT_CalcRect;
if WordWrap then inc(Flags,DT_WordBreak);
+ else inc(Flags,DT_SingleLine);
DrawText(DC, PChar(Caption), Length(Caption), R, Flags);
SelectObject(DC, OldFont);
// add one to be able to display disabled label