RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
FileCtrl.MinimizeName Function

Shortens a fully qualified path name so that it can be drawn with a specified length limit.

Pascal
function MinimizeName(const Filename: TFileName; Canvas: TCanvas; MaxLen: Integer): TFileName;
C++
TFileName MinimizeName(const TFileName Filename, TCanvas Canvas, int MaxLen);

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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!