next up previous contents index
Next: The Save Button: Save Up: The Open Button: Open Previous: Object Tests   Contents   Index


The File Selection Panel

The File Selection panel allows the user the navigate the host's file systems, and select a file for input to the program.

The panel provides two windows; the left window displays the subdirectories in a tree format, and the right window displays a listing of files in a columnar form. The panel is similar in operation to the Windows Explorer tool provided by Microsoft.

When the panel first appears, the directories listing contains a single entry, which is shown selected, and the files window contains a list of files found in that directory. The tree "root" is selected by the application, and may or may not be the current directory. If the directory contains subdirectories, a small box containing a `+' symbol will appear next to the directory entry. Clicking on the `+' will cause the subdirectories to be displayed in the directory listing, and the `+' will change to a `-'. Clicking again on the `-' will hide the subdirectory entries. Clicking on a subdirectory name will select that subdirectory, and list its files in the files listing window. The `+' box will appear with subdirectories only after the subdirectory is selected.

Clicking on the blue triangle in the menu bar will push the current tree root to its parent directory. If the tree root is pushed to the top level directory, the blue triangle is grayed. The label at the bottom of the panel displays the current root of the tree. There is also a New Root item in the File menu, which allows the user to enter a new root directory for the tree listing. In Windows, this must be used to list files on a drive other than the current drive.

The Up menu is similar, but it produces a drop-down list of parent directories. Selecting one of the parents will set the root to that parent, the same as pressing the blue triangle button multiple times to climb the directory tree.

The New CWD button in the File menu allows the user to enter a new current working directory for the program. This will also reset the root to the new current working directory. The small dialog window which receives the input, and also a similar dialog window associated with the New Root button, are sensitive as drop receivers for files. In particular, one can drag a directory from the tree listing and drop it on the dialog, and the text of the dialog will be set to the full path to the directory.

The files listed in the files listing always correspond to the currently selected directory. File names can be selected in the files listing window, and once selected, the files can be transferred to the calling application. The ``Go'' button, which has a green octagon icon, accomplishes this, as does the Open entry in the File menu. These buttons are only active when a file is selected. One can also double-click the file name which will send the file to the application, whether or not the name was selected.

Files can be dragged and dropped into the application, as an alternative to the ``Go'' button. Files and directories can also be dragged/dropped between multiple instances of the File Selection panel, or to other file manager programs, or to other directories within the same File Selection panel. The currently selected directory is the target for files dropped in the files listing window. When dragging in the directory listing, the underlying directory is highlighted. The highlighted directory will be the drop target.

By default, a confirmation pop-up will always appear after a drag/drop. This specifies the source and destination files or directories, and gives the user the choice of moving, copying or (if not in Windows) symbolically linking, or aborting the operation.

In Xic, the variable NoAskFileAction can be set to skip the confirmation. This was the behavior in releases prior to 3.0.0, and experienced users may prefer this. However, some users may find it too easy to inadvertently initiate an action.

If the NoAskFileAction variable is set, the following paragraphs apply.

The drag/drop operation is affected by which mouse button is used for dragging, and by pressing the Shift and Ctrl buttons during the drag. The normal operation (button 1 with no keys pressed) for drag/drop is copying. The other options are as follows:

Operations
Button 1 Copy
Shift-Button 1 Move
Control-Button 1 Copy
Shift-Control-Button 1 Link
Button 2/3 Ask

Above, ``Ask'' means that a dialog will appear asking the user what operation to perform. Options are move, copy, or (symbolically) link. Both the source and destinations are shown in the pop-up, and can be modified.

If a directory is the source for a copy, the directory and all files and subdirectories are copied recursively, as with the ``-R'' option of the Unix ``cp'' command.

Only one file or directory can be selected. When the operation is copy, the cursor icon contains a `+' in all cases. This will appear when the user presses the Ctrl key, if the underlying window supports a move operation.

The File menu contains a number of commands which provide additional manipulations. The New Folder button will create a subdirectory in the currently selected directory (after prompting for a name). The Delete button will delete the currently selected file. If no file is selected, and the currently selected directory has no files or subdirectories, it will be deleted. The Rename command allows the name of the currently selected file to be changed. If no file is selected, the name change applies to the currently selected directory.

The Listing menu contains entries which affect the file name list. By default, all files are listed, however the user can restrict the listing to certain files with the filtering option. The Show Filter button displays an option menu at the bottom of the files listing. The first two choices are ``all files'' and the set of extensions known to correspond to supported layout file formats. The remaining choices are editable and can be set by the user. The format is the same as one uses on a Unix command line for, e.g., the ls command, except that the characters up to the first colon (`:') are ignored. It is intended that the first token be a name for the pattern set, followed by a colon. The remaining tokens are space-separated patterns, any one of which if matching a file will cause the file to be listed.

In matching filenames, the character `.' at the beginning of a filename must be matched explicitly. The character `*' matches any string of characters, including the null string. The character `?' matches any single character. The sequence `[...] ' matches any one of the characters enclosed. Within `[...] ', a pair of characters separated by `-' matches any character lexically between the two. Some patterns can be negated: The sequence ` [^...] ' matches any single character not specified by the characters and/or ranges of characters in the braces. An entire pattern can also be negated with `^'. The notation `a{b,c,d}e' is a shorthand for `abe ace ade'.

The Relist button will update the files list. The file listing is automatically updated when a new filter is selected, or when Enter is pressed when editing a filter string.

The files are normally listed alphabetically, however if List by Date is selected, files will be listed in reverse chronological order of their creation or last modification time. Thus, the most-recently modified file will be listed first.

The Show Label toggle button controls whether or not the label area is shown. The label area contains the root directory and current directory, or a file info string. By default, the label area is shown when the pop-up is created as a stand-alone file selector, but is not shown when the pop-up appears as an adjunct when soliciting a file name.

When the pointer is over a file name in the file listing, info about the file is printed in the label area (if the label area is visible). This is a string very similar to the ``ls -l'' file listing in Unix/Linux. It provides:

  1. The permission bit settings and file type codes as in ``ls -l'' (Unix/Linux only).
  2. The owner and group (Unix/Linux only).
  3. The file size in bytes.
  4. The last modification date and time.

While the panel is active, a monitor is applied to the listed files and directories which will automatically update the display if the directories change. The listings should respond to external file or directory additions or deletions within half a second.

The File Selection pop-up appears when the File Select button in the Xic File Menu is pressed. Variations of File Selection panel appear when the user is being prompted (from the prompt line) for a path to a file to open or write, such as for the commands in the Convert Menu. The Open File dialog is used when a path to a file to open is being requested. It is almost the same as the File Selection panel, except that selecting a file will load that path into the prompt line. The Save File dialog is used when the user is being prompted for the name of a file to save. This does not contain the list of files found in the other variations, but allows the user to select a directory.


next up previous contents index
Next: The Save Button: Save Up: The Open Button: Open Previous: Object Tests   Contents   Index
Stephen R. Whiteley 2024-09-29