Full paths for files deep in a folder tree can be incredibly long, as in
special folder paths like this:
C:\Documents and Settings\username\My Documents\My Pictures\Subfolder\Very
Long Filename.ext
Displaying these in controls such as TLabel, TEdit, TListBox and TComboBox,
either requires incredibly wide controls (and forms) or some sort of
abbreviation.
I'm considering 3 options:
1. Ellipsize the names using the MinimizeName() function.
Two problems here: This will often require that you store all displayed
filenames somewhere else in their full form, so that they can be used to
e.g. open a file. This would be a real chore with things like comboboxes
and MRU menus. Also, a user is often unable to deduce the full path from
the ellipsized version (too much is missing).
2. Convert the special folder paths into a short version that can be
displayed to the user AND expanded back to the long form when needed, using
simple string replacement. For example, the above path could be displayed
as
My Pictures\Subfolder\Filename\Very Long Filename.ext
Two problems: Coming up with recognizable short forms for all the special
folders a user is likely to encounter (e.g. user vs common folders); and it
doesn't work with long paths in general. OTOH, a (minor?) advantage is that
special folder paths can also be *stored* in their short form, so that they
can be exchanged with other systems where the special folder paths are
different because of locale, Windows version, or customization of special
folder locations.
3. Displayed the full path and let it flow off the end of the control. Use
Hints to display the entire path, adding line breaks at appropriate " " or
"\", to avoid excessive Hint width.
Problem here is you may want to use the Hints for real hints, or they may
be disabled. You'd also have to deal with showing different Hints when the
mouse hovers over each item in lists of paths.
Any brilliant ideas on how to address this issue? How do you deal with it?
Pete