Reformats the path to fit entirely within an EDITLINE control.

Syntax

NewPath = SRP_Path("FitToEditline", Path, CtrlEntId)

Parameters

ParameterDescription
PathA path without command line parameters.
CtrlEntIdFully qualified name of an EDITLINE control.

Returns

The path reformatted to fit within the control.

Remarks

The FitToEditline service reformats the given path so it will fit within the width of the given EDITLINE control. It takes into account the control's font and margins, which is why this service only targets the one type of control. If the path needs to be reduced in size, then it replaces the middle of the path with ellipses. At all times, the service attempts to ensure that the filename and extension are always visible. Only when the control is too small to fit the filename does it begin to replace characters there as well.

Example

Path = "C:\Users\Johnny Appleseed\AppData\Local\SomeApplication\Logs\2016_02_04_16_55_22.log"
Result = SRP_Path("FitToControl", Path, @Window:".MY_EDITLINE")

Depending on the font, an EDITLINE with a width of 283 pixels might result is something like "C:\Users\Johnny Applese...\2016_02_04_16_55_22.log".

See Also

Expand, MakeRelative

  • No labels