Shortens a fully qualified path name so that it can be drawn with a specified length limit.
function MinimizeName(const Filename: TFileName; Canvas: TCanvas; MaxLen: Integer): TFileName;
TFileName MinimizeName(const TFileName Filename, TCanvas Canvas, int MaxLen);
FileCtrl
Use MinimizeName to obtain a version of a file name and path that can be drawn on a limited size drawing surface. MinimizeName replaces directories in the path portion of the file name with dots until the resulting name fits the specified number of pixels in length.
MinimizeName returns the shortened name.
Filename is the fully qualified path name that (possibly) needs to be shortened.
Canvas is the drawing surface on which the resulting name is to be rendered. It is used to determine font metrics.
MaxLen is the length, in pixels, available for drawing the file name on the canvas.
AdjustLineBreaks
WrapText
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|