Dirlist class provides a quick and easy way of showing entries in a directory. It features lots of control attributes, many of them known from the popular asl file requester.
This class is *not* intended to replace asl.library! Nobody wants to see every MUI application coming with another selfmade file requester. Please continue using ASL for real file requesting purposes!
However, sometimes it may be useful to have a little directory list placed somewhere in your user interface. Imagine an answering machine tool that stores incoming calls in a preconfigured directory. Using a dirlist object, you can include the GUI for selecting a call in your window with lots of other gadgets like "Play", "Delete", etc.
Dirlist class creates a listview with six columns representing all files attributes: Name, size, date, time, flags and comment. If you do not want to have all of these attributes displayed, you can use Listviewcolumn class to make adjustments.
Dirlist class is a subclass of listview class. Thus, you can use most attributes and methods of listview class on it too. For example, if you want to read the entries of your directory, just send the dirlist object a Listview.GetEntry method, or if you want to listen to changes in the active list entry, set up a notification on Listview.Active.
If you use Listview.GetEntry on this class, you will
get six return values representing the six different columns
of the dirlist listview. Note that you will always get six return
values even if you made adjustments to the column display using
Listviewcolumn class. The protection
flags are returned as a single number containing a bitfield
combination of the
#FILEATTR_XXX constants from
When creating a dirlist object in XML code, you always have to add at least one column to it. This is done by using the Listviewcolumn class. Here is an example of a minimal dirlist declaration with just a single column (the name column, that is):
<dirlist> <column/> <!-- Name --> </dirlist>
Here is a declaration that includes all six columns:
<dirlist> <column/> <!-- Name --> <column/> <!-- Size --> <column/> <!-- Date --> <column/> <!-- Time --> <column/> <!-- Flags --> <column/> <!-- Comment --> </dirlist>
If you only want to have the name column and the comment column displayed, you can use the Listviewcolumn.Col attribute to achieve this:
<dirlist> <column/> <!-- Name --> <column col="5"/> <!-- Comment --> </dirlist>
To reverse the order of columns use:
<dirlist> <column col="5"/> <!-- Comment --> <column col="4"/> <!-- Flags --> <column col="3"/> <!-- Time --> <column col="2"/> <!-- Date --> <column col="1"/> <!-- Size --> <column col="0"/> <!-- Name --> </dirlist>
See Listview class for details.
See Listviewcolumn class for details.