Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

MagiC/WDIALOG extension: File selector Library
[AES Function Reference]

file selector functions More...

Defines

#define SORTBYNAME   0
#define SORTBYDATE   1
#define SORTBYSIZE   2
#define SORTBYTYPE   3
#define SORTBYNONE   4
#define SORTDEFAULT   -1
#define DOSMODE   1
#define NFOLLOWSLKS   2
#define GETMULTI   8
#define SHOW8P3   1

Typedefs

typedef short __CDECL(* XFSL_FILTER )(char *path, char *name, GEMLIB_XATTR *xattr)

Functions

short mt_fslx_close (void *fsd, short *global)
void * mt_fslx_do (char *title, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short *sort_mode, short flags, short *button, short *nfiles, char **pattern, short *global)
short mt_fslx_evnt (void *fsd, EVNT *events, char *path, char *fname, short *button, short *nfiles, short *sort_mode, char **pattern, short *global)
short mt_fslx_getnxtfile (void *fsd, char *fname, short *global)
void * mt_fslx_open (char *title, short x, short y, short *handle, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short sort_mode, short flags, short *global)
short mt_fslx_set_flags (short flags, short *oldval, short *global)

Detailed Description

file selector functions

This File Selector library availability can be found calling mt_appl_getinfo(7). Bit 3 of ap_gout1, if equal to 1, says that mt_flsx_xx() functions are available.


Define Documentation

#define DOSMODE   1
 

TODO

#define GETMULTI   8
 

TODO

#define NFOLLOWSLKS   2
 

TODO

#define SHOW8P3   1
 

TODO

#define SORTBYDATE   1
 

TODO

#define SORTBYNAME   0
 

TODO

#define SORTBYNONE   4
 

TODO

#define SORTBYSIZE   2
 

TODO

#define SORTBYTYPE   3
 

TODO

#define SORTDEFAULT   -1
 

TODO


Typedef Documentation

typedef short __CDECL(* XFSL_FILTER)(char *path, char *name, GEMLIB_XATTR *xattr)
 

TODO


Function Documentation

short mt_fslx_close void *  fsd,
short global_aes
 

Close file selector window or file selector dialog

Parameters:
fsd Descriptor that was passed at the successful opening of a file selector window.
global_aes global AES array
Returns:
0 for error, else 1
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
The corresponding descriptor is cleared and the file selector window or dialog is closed.

void* mt_fslx_do char *  title,
char *  path,
short  pathlen,
char *  fname,
short  fnamelen,
char *  patterns,
XFSL_FILTER  filter,
char *  paths,
short sort_mode,
short  flags,
short button,
short nfiles,
char **  pattern,
short global_aes
 

File selector dialog

Parameters:
title 
path 
pathlen 
fname 
fnamelen 
patterns 
filter 
paths 
sort_mode 
[option CHECK_NULLPTR] sort_mode may be NULL
flags 
button 
[option CHECK_NULLPTR] button may be NULL
nfiles 
[option CHECK_NULLPTR] nfiles may be NULL
pattern 
[option CHECK_NULLPTR] pattern may be NULL
global_aes global AES array
Returns:
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
This function is a combination of mt_fslx_open() and mt_fslx_evnt(), but uses a dialog box without a window.

see mt_fslx_open() and mt_fslx_evnt() for more details.

short mt_fslx_evnt void *  fsd,
EVNT events,
char *  path,
char *  fname,
short button,
short nfiles,
short sort_mode,
char **  pattern,
short global_aes
 

Service file selector window

Parameters:
fsd Descriptor that was passed at a successful opening of a file selector window.
events EVENT structure as for wdlg_evnt and fnts_evnt. The events are serviced by the dialog if they are intended for the associated window.
path Pointer to the selected path if the dialog was quit successfully, i.e. by a click on the OK button or by double- clicking on a file.
fname Pointer to the selected filename if the dialog was quit successfully, i.e. by a click on the OK button or by double- clicking on a file.
button 
[option CHECK_NULLPTR] button may be NULL
nfiles 
[option CHECK_NULLPTR] nfiles may be NULL
sort_mode 
[option CHECK_NULLPTR] sort_mode may be NULL
pattern 
[option CHECK_NULLPTR] pattern may be NULL
global_aes global AES array
Returns:
Is 0 if the dialog is to be quit, else 1
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
Events, i.e. mouse clicks, messages and keypresses are passed on to the file selector window and serviced by it if appropriate. When an event has been serviced then the corresponding bit in the EVENT structure will be cleared.

short mt_fslx_getnxtfile void *  fsd,
char *  fname,
short global_aes
 

Examine further selected files

Parameters:
fsd Descriptor that was passed at a successful opening of a file selector window
fname see below
global_aes global AES array
Returns:
0, when no further file is selected, fname is unchanged.
1, when a filename after fname was copied.
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

void* mt_fslx_open char *  title,
short  x,
short  y,
short handle,
char *  path,
short  pathlen,
char *  fname,
short  fnamelen,
char *  patterns,
XFSL_FILTER  filter,
char *  paths,
short  sort_mode,
short  flags,
short global_aes
 

Open file selector window

Parameters:
title Window title of file selector, may be NULL
x 
y Screen coordinates of the upper left corner of the window.
For x=y=-1 the window will be centred.
handle Window handle after successful opening
[option CHECK_NULLPTR] handle may be NULL
path Complete path, starts with drive and ends with '\'
pathlen Length of path buffer, i.e. maximum pathlength + 1 (for EOS)
fname Buffer for the filename
fnamelen Length of filename buffer, i.e. maximum length of filename + 1 (for EOS)
patterns Filemask, e.g. "*.TXT" or "*.PRG,*.APP". The alternatively selectable masks are separated by EOS and terminated by EOS,EOS.
filter May be NULL. The filter function is called before the mask comparison. If it returns 0 then the file is invalid, if 1 is returned then the filename will be displayed.
paths Path "history" e.g. "C:\\BIN\\" etc. The alternatively selectable paths are separated by EOS and terminated by EOS,EOS.
sort_mode Sort mode for the display. The modes are:
  • SORTBYNAME (0)
  • SORTBYDATE (1)
  • SORTBYSIZE (2)
  • SORTBYTYPE (3)
  • SORTBYNONE (4)
SORTBYNONE here means the physical order on the disk.
flags Various settings:
  • DOSMODE (1)
    DOSMODE is the compatibility mode that is also used by fsel_(ex)input and basically returns filenames in the 8+3 format. For this all directories are called with Dopendir(DOPEN_COMPAT).
  • NFOLLOWSLKS (2)
    If NFOLLOWSLKS is set, then symbolic links will not be followed, i.e. date and time etc., as well as the XATTR- structure that is passed to filter, belong to the link itself.
  • GETMULTI (8)
    If GETMULTI is set, one can select and pass several files at the same time. For this fslx_getnxtfile() is used if fslx_evnt() or fslx_do() in the parameter nfiles signals that there are still further files selected.
global_aes global AES array
Returns:
a descriptor for further actions or NULL if an error has occurred (not enough memory or no more window handles free).
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
The corresponding descriptor will be created and the file selector window opened.

short mt_fslx_set_flags short  flags,
short oldval,
short global_aes
 

Global system settings

Parameters:
flags Various flags, at present only:
  • SHOW8P3 (1)
    SHOW8P3 is valid only for the display of directories on DOS drives. It corresponds to the switch "Show TOS Files as '8+3'" in Magxdesk.
oldval Previous value
[option CHECK_NULLPTR] oldval may be NULL
global_aes global AES array
Returns:
0, if error
1, if OK
Since:
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
This function is used (e.g. by MAGXDESK) in order to set the switch "Show TOS Files as '8+3'" for the file selector as well.


Generated on Wed Nov 3 22:42:21 2004 for GEMLIB by  doxygen 1.3.9.1