From: Andreas H. <ah...@us...> - 2005-10-27 16:04:41
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28676/run Modified Files: JvJCLUtils.pas Log Message: VCL.NET support Index: JvJCLUtils.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvJCLUtils.pas,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** JvJCLUtils.pas 26 Oct 2005 20:56:19 -0000 1.165 --- JvJCLUtils.pas 27 Oct 2005 16:04:28 -0000 1.166 *************** *** 8242,8255 **** function MinimizeFileName(const FileName: string; Canvas: TCanvas; MaxLen: Integer): string; var R: TRect; begin Result := FileName; R := Rect(0, 0, MaxLen, Canvas.TextHeight('Wq')); ! {$IFNDEF CLR} UniqueString(Result); - {$ENDIF CLR} if DrawText(Canvas.Handle, PChar(Result), Length(Result), R, DT_SINGLELINE or DT_MODIFYSTRING or DT_PATH_ELLIPSIS or DT_CALCRECT or DT_NOPREFIX) <= 0 then Result := FileName; end; --- 8242,8264 ---- function MinimizeFileName(const FileName: string; Canvas: TCanvas; MaxLen: Integer): string; var + {$IFDEF CLR} + sb: StringBuilder; + {$ENDIF CLR} R: TRect; begin Result := FileName; R := Rect(0, 0, MaxLen, Canvas.TextHeight('Wq')); ! {$IFDEF CLR} ! sb := StringBuilder.Create(Result); ! // DrawText() doesn't exist with StringBuilder parameter (2005) ! if DrawTextEx(Canvas.Handle, sb, sb.Length, R, ! DT_SINGLELINE or DT_MODIFYSTRING or DT_PATH_ELLIPSIS or DT_CALCRECT or ! DT_NOPREFIX, nil) <= 0 then ! {$ELSE} UniqueString(Result); if DrawText(Canvas.Handle, PChar(Result), Length(Result), R, DT_SINGLELINE or DT_MODIFYSTRING or DT_PATH_ELLIPSIS or DT_CALCRECT or DT_NOPREFIX) <= 0 then + {$ENDIF CLR} Result := FileName; end; |