Selectors library FontSel()
Programming guideline of WinDom

FselInput()

NAME

FselInput - universal file selector.

PROTOTYPAGE

int FselInput( char *path, char *name, char *ext, char *title char *lpath, char *lext)

PARAMETERS

path:
directory where the file selector is opened, then the directory of the selected item.

name:
name of a default file, then the name of the selected file,

ext:
file mask,

title:
selector title,

lpath:
list of predefined directores or NULL,

lext:
list of predfined file mask of NULL,

return:
1 if an object has been selected, 0 else.

DESCRIPTION

FselInput() is a custom call of the GEM file selector. If an alternative file selector is available ('FSEL' cookie, Selectric, BoxKite 2, FLSX extensions), it is used instead of the GEM standard file selector.

When the function returns, parameters path and name are filled in with the directory and the filename selected. Then FselInput() can be used as a file and a directory selector. If the path parameter is an empty string, the current directory is used. If the ext parameter is an empty string, the default mask used by FselInput() will be "*.*".

Parameter title set fileselector title and can be used for any TOS version. If fileselelector does not support this feature, that parameter has not effect.

The lpath and lext allows you to define a list of preset directories. There list are displayed inside the file selector if it is possible that is the case with Selectrics, BoxKit 2 and the FLSX selectors. A list is a string whose each items are delimited by a ; character:

     	"C:\\\USR;C:\\USR\BIN"
     	"*.C,*.H;*.PRJ,*.RSC"
FselInput() adds in the directories preset, the path of the user directory (if the $HOME environ variable is defined). The environ variables $FSELPATH and $FSELMASK are used to build a default list of directories and file mask. The additional lists given by lpath and lext are adding in these lists. Environ variables provide a way to configure globally all WinDom clients. In addition, it is possible, for the user, to configure a specific application : the windom.fsel.path and windom.fsel.mask variable in the configuration file define the list of directories and file mask. These values are adding to the lists displayed by the file selector.

If the system has a FSLX extension (see appl_getinfo()), the file selector is display in a modal window.

The windom.fsel.fslx variable from the WinDom configuration file set to FALSE forces FselInput() to not use the FSLX extension.

     
         int CallFsel ( name) {
     		static char path[255]=""; /* Fist usage : current directory */
             char fullname[255]="";
     
             if( FselInput( path, name, "Load a file", "", NULL, NULL)) {
                 strpcy( completname, path);
                 strcat( completname, name);
                 strpcy( name, fullname); /* return the full path */
                 return 1;
             } else
     			return 0;
          }
SEE ALSO

windom.fsel.path, windom.fsel.mask, windom.fsel.fslx