📄 iodlg.h
字号:
*/
l_bool (*new_linkdirectory) ( p_filelistbox o );
/*
function for making new link to file. If this link was successfull made,
it returns true, otherwise it returns false.
*/
l_bool (*new_link) ( p_filelistbox o );
} t_filelistbox;
#define FILELISTBOX(o) ((p_filelistbox)(o))
#define FILELISTBOX_ITEM_ATTRIB(o, i)((o)?((p_filelistbox_item)(o)->at((o), i))->info.attrib:0)
#define FILELISTBOX_ITEM_DATE(o, i) ((o)?((p_filelistbox_item)(o)->at((o), i))->info.date:0)
#define FILELISTBOX_ITEM_TIME(o, i) ((o)?((p_filelistbox_item)(o)->at((o), i))->info.time:0)
#define FILELISTBOX_ITEM_SIZE(o, i) ((o)?((p_filelistbox_item)(o)->at((o), i))->info.size:0)
#define FILELISTBOX_ITEM_FILENAME(o, i) ((o)?((p_filelistbox_item)(o)->at((o), i))->info.filename:NULL)
#define FILELISTBOX_ITEM_PATH(o, i) ((o)?((p_filelistbox_item)(o)->at((o), i))->info.path:NULL)
typedef struct t_filelistctrl *p_filelistctrl;
typedef struct t_filelistctrl {
struct t_view obclass;
p_filelistbox filebox;
p_history his;
} t_filelistctrl;
#define FILELISTCTRL(o) ((p_filelistctrl)(o))
/* t_filehistory */
/*
object t_filehistory is used for showing extension of available files in the
history box. The "rec" of items in the t_filehistory.obclass.list is structured
by the format t_filehistory_item ...see above. It means, that each item contains
the same information as in t_filelistbox_item. You are able to make an item by
function new_filehistory_item you will see later in this section.
*/
typedef struct t_filehistory *p_filehistory;
typedef struct t_filehistory {
/* inherite variable / functions from t_history, t_textline, t_view, t_object classes */
struct t_history obclass;
/* point to filelistbox, that's change the box of items / files / directories
whenever the item in the history is changed
*/
p_filelistbox filebox;
} t_filehistory;
#define FILEHISTORY(o) ((p_filehistory)(o))
/* t_filetextline */
/*
object t_filetextline is used for manipulating with the name of files and by
this way you can save data to other file, than exists.
*/
typedef struct t_filetextline *p_filetextline;
typedef struct t_filetextline {
/* inherite variable / functions from t_history, t_textline, t_view, t_object classes */
struct t_history obclass;
/* point to filelistbox, that's change the box of items / files / directories
whenever the text in "obclass.obclass.text" was changed
*/
p_filelistbox filebox;
/* point to filehistory, that contains information about extensions and whenever
is extension changed it automaticaly change "obclass.obclass.text" to the
selected extension of filehistory.
*/
p_filehistory filehistory;
/*
the old/current name of file ( extension ) if the directory was selected.
*/
l_text filename;
} t_filetextline;
#define FILETEXTLINE(o) ((p_filetextline)(o))
/*
returns list, that contains items (p_item) and each item contains (rec) - pointer
to one t_filelistbox_item. => returns list of files / directories / links defined
in "flags" from the path "path} and exetension "files". "isize" is the standard
size of the icon. You can use ICON_16 (default), or ICON_32. To get what's the
default size of icon use "system_item_size" from "view.h". "flags" may be
combination of FA_XXXX flags from _iodir.h. FA_ALL get all files, FA_DIR only
directories.
*/
p_list get_listbox_item_dirfiles ( l_text path, l_text files, l_int flags, l_int isize );
/*
make new t_filelistbox_item and return pointer to this item.
"name" is the text that will be displayed in the item. ( directory / file ).
"icon" is the icon of item, "sel" defines if the item was automatically selected,
"flags" defines flags for listbox, see LF_XXXX in "dialogs.h". "attrib" may contains
combination of FA_XXXX file atributes, see "_iodir.h". "date" is the packed date
of file / directory when was created, "time" is packed time of file / dir when was
created. "size" is the size of file, if it's dir, the default value is ZERO for this
value. "path" is the path of the file. "filename" is the real name of the file. For
example, the difference between "name" and "filename" is in links, because SEAL not
displayes extension of link. "properties" is pointer to the function that show
the properties about the file / directory. "set_data" is pointer to the function
that copy data from file "src" to this file / directory.
*/
p_filelistbox_item new_filelistbox_item_ex ( l_text name, BITMAP *icon,
l_bool sel, l_int flags,
l_int attrib, l_word date,
l_word time, l_dword size,
l_text path, l_text filename,
l_bool (*properties)(l_text filename),
l_int (*set_data)(p_object o, t_file *dst, t_file *src, l_dword *ind ) );
/* free previous allocated item "t_filelistbox_item" */
void free_filelistbox_item ( void *o );
#define new_filelistbox_item(n,i,se,f,a,d,t,s,p,fn) new_filelistbox_item_ex(n, i, se, f, a, d, t, s, p, fn, NULL, NULL)
#define new_filehistory_item(n,f) new_filelistbox_item(n, NULL, false, 0, 0, 0, 0, 0, NULL, f)
#define free_filehistory_item free_filelistbox_item
/*
set properties for link to file if "filelink" is true, or link to directory
when "filelink" is false. the "path" is the name of file that contains info about
link, and "linkinfo" is the link to other file / directory.
returns true if all was succesfull, otherwise returns false.
*/
//l_bool link_properties ( l_text filename, l_text linkinfo, l_bool filelink );
/*
make new link to file if "filelink" is true, or link to directory when "filelink"
is false. the "path" is the new name of file that we will create and "linkinfo" is
the link to other file / directory. returns true if all was succesfull, otherwise
returns false.
*/
//l_bool link_new ( l_text path, l_text linkinfo, l_bool filelink );
/* t_filelistbox_item functions */
/*
get properties about file "filename" and return true if file exists, otherwise
it returns false
*/
l_bool file_properties ( l_text filename );
/*
get properties about directory "filename" and return true if directory exists,
otherwise it returns false
*/
l_bool dir_properties ( l_text filename );
/*
get properties about link to directory "filename" and return true if link exists,
otherwise it returns false
*/
//l_bool linkdir_properties ( l_text filename );
/*
get properties about link to file "filename" and return true if link exists,
otherwise it returns false
*/
//l_bool linkfile_properties ( l_text filename );
/*
copy data from file "t_file" to file "dst". "o" is the object that will be checked
and process will be continued until object "o" will not be closed.
"ind" is the current position of copying.
*/
l_int file_set_data ( p_object o, t_file *dst, t_file *src, l_dword *ind );
/*
copy data from file/directory "t_file" to directory "dst". "o" is the object that
will be checked and process will be continued until object "o" will not be closed.
"ind" is the current position of copying.
*/
l_int dir_set_data ( p_object o, t_file *dst, t_file *src, l_dword *ind );
/*
copy data from file "t_file" to directory "dst". "o" is the object that
will be checked and process will be continued until object "o" will not be closed.
"ind" is the current position of copying.
*/
l_int linkdir_set_data ( p_object o, t_file *dst, t_file *src, l_dword *ind );
/*
copy data from file "t_file" to directory "dst". "o" is the object that
will be checked and process will be continued until object "o" will not be closed.
"ind" is the current position of copying.
*/
l_int linkfile_set_data ( p_object o, t_file *dst, t_file *src, l_dword *ind );
/* t_filelistbox functions */
/*
filelistbox - is used for work with files/directories in listbox
- cols number of columns
- flags flags of listbox + flags of filelistbox
...listbox flags
LF_NONE
LF_UNDERSEL select item whenever is mouse under it
LF_SELECTABLE select more item for copying
...filistbox flags
FL_SAVE main button works as save button
FL_OPEN main button works as open button
FL_DIROPEN main button works as diropen button
- path path to directory, from where is the first output of files
- file name of file, that is as the first in file textline
- atrib file atributions, atrrib of files that may be displayed by
filelistbox. Definitions are defined in _iodir.h and <dir.h>
`FA_RDONLY' Include read-only files in the search
`FA_HIDDEN' Include hidden files in the search
`FA_SYSTEM' Include system files in the search
`FA_LABEL' Include the volume label in the search
`FA_DIREC' Include subdirectories in the search
`FA_ARCH' Include modified files in the search
...in _iodir.h
`FA_LINK' link to file
`FA_LINKDIR' link to dir
`FA_LINKDRIVE' link to drive
`FA_NOTPARENT' not show parent directory ".."
- file_sel
function that is called for all files, when file is focused,
argument is [path to file/filename] of current file.
*/
extern p_filelistbox (*filelistbox_init) ( p_filelistbox o, t_rect r, l_int cols, l_int flags, l_text path, l_text file, l_int attrib, void (*file_sel)() );
p_filelistbox _filelistbox_init ( p_filelistbox o, t_rect r, l_int cols, l_int flags, l_text path, l_text file, l_int attrib, void (*file_sel)() );
void filelistbox_setup ( p_object o );
l_bool filelistbox_drag_where ( p_view o, p_data rec, t_point where );
void filelistbox_rewrite_item ( p_listbox o, l_long item );
p_list filelistbox_get_selected_items ( p_listbox o, l_bool sel );
void filelistbox_load_list ( p_filelistbox o, l_text path, l_text file );
l_dword filelistbox_file_menu ( p_filelistbox o );
l_text filelistbox_get_file ( p_filelistbox o );
l_int filelistbox_file_handle_ex ( p_filelistbox o, l_text opath, l_text ofile, l_int attrib, l_text filename );
l_int filelistbox_file_handle ( p_filelistbox o );
l_bool filelistbox_change_name ( p_filelistbox o );
l_bool filelistbox_new_directory ( p_filelistbox o );
l_bool filelistbox_new_linkdirectory ( p_filelistbox o );
l_bool filelistbox_new_link ( p_filelistbox o );
/* t_dirhistory functions */
/*
create new history of drives, where (r) is the area where will be history
placed. (limit) is the maximum number of characters of drivename. (flags) is
combination of HF_XXXX flags, ...see dialogs.h. (filelistbox) is the pointer
to t_filelistbox that's changed whenever is drive from history changed.
extern p_dirhistory (*dirhistory_init) ( p_dirhistory o, t_rect r, l_int limit, l_int flags, p_filelistbox filebox );
p_dirhistory _dirhistory_init ( p_dirhistory o, t_rect r, l_int limit, l_int flags, p_filelistbox filebox );
l_dword dirhistory_show_box ( p_history o );
void dirhistory_load_list ( p_dirhistory o, l_text path );
*/
/* t_filehistory functions */
/*
create new t_filehistory object, that's used for showing extension of available
files in the history box. The "rec" of items in the t_filehistory.obclass.list
is structured by the format t_filehistory_item ...see above. It means, that
each item contains the same information as in t_filelistbox_item.
You are able to make an item by function new_filehistory_item you will see later
in this section. (r) is the area, where will be object placed. (list) is the list of
items that contains important information stored in t_filelistbox_item, see above.
(limit) is the maximum number of characters of filehistory text. (flags) is
combination of HF_XXXX flags, ...see dialogs.h. (filelistbox) is the pointer
to t_filelistbox that's changed whenever is drive from history changed.
*/
extern p_filehistory (*filehistory_init) ( p_filehistory o, t_rect r, p_list list, l_int limit, l_int flags, p_filelistbox filebox );
p_filehistory _filehistory_init ( p_filehistory o, t_rect r, p_list list, l_int limit, l_int flags, p_filelistbox filebox );
l_dword filehistory_show_box ( p_history o );
/* t_filetextline */
/*
create filetextline, that's used for manipulating with the name of files and by
this way you can save data to other file, than exists. "r" is the area where the
line will be displayed. "limit" is the maximum number of characters of filename.
"flags" is combination of TF_XXXX flags, ...see dialogs.h. "filebox" is the pointer
to t_filelistbox object and "filehistory" to t_filehistory object.
*/
extern p_filetextline (*filetextline_init) ( p_filetextline o, t_rect r, l_int limit, l_int flags, p_filelistbox filebox, p_filehistory filehistory );
p_filetextline _filetextline_init ( p_filetextline o, t_rect r, l_int limit, l_int flags, p_filelistbox filebox, p_filehistory filehistory );
void filetextline_translate_event ( p_object o, p_event event );
/* dialogs */
l_dword menu_file_copy_where ( l_text filename );
/* dialogs */
/*
main file-dialog window
- caption name of window
- bname name of main button
- path path to directory, from where is the first output of files
- file name of file, that is as the first in file textline
- hislist list of file extensions
hislist making...
p_list p = list_init(_malloc(sizeof(t_list)), 0, free_filehistory_item);
p->insert(p, new_filehistory_item("All files", "*.*"))
p->insert(p, new_filehistory_item("Bitmap files", "*.bmp"))
....
- atrib file atributions, atrrib of files that may be displayed by
filelistbox. Definitions are defined in _iodir.h and <dir.h>
`FA_RDONLY' Include read-only files in the search
`FA_HIDDEN' Include hidden files in the search
`FA_SYSTEM' Include system files in the search
`FA_LABEL' Include the volume label in the search
`FA_DIREC' Include subdirectories in the search
`FA_ARCH' Include modified files in the search
...in _iodir.h
`FA_LINK' link to file
`FA_LINKDIR' link to dir
`FA_LINKDRIVE' link to drive
`FA_NOTPARENT' not show parent directory ".."
- flags flags of filelistbox
FL_SAVE main button works as save button
FL_OPEN main button works as open button
FL_DIROPEN main button works as diropen button
- file_sel
function that is called for all files, when file is focused,
argument is [path to file/filename] of current file.
returns the file that was opened or saved. if the dialog-window was canceled,
it returns NULL.
*/
extern l_text (*file_dialog) ( l_text caption, l_text bname, l_text path, l_text file, p_list hislist, l_int attrib, l_int flags, void (*file_sel)() );
/*
show dialog window with box of directories only
*/
#define dir_dialog(c,bn,p) file_dialog(c, bn, p, NULL, NULL, FA_DIREC, FL_DIROPEN, NULL)
#define save_dialog(p,f,l) file_dialog(TXT_SAVEFILEAS, TXT_SAVE, p, f, l, FA_ALL, FL_SAVE, NULL)
#define open_dialog(p,f,l) file_dialog(TXT_OPENFILE, TXT_OPEN, p, f, l, FA_ALL, FL_OPEN, NULL)
l_text _file_dialog ( l_text caption, l_text bname, l_text path, l_text file, p_list hislist, l_int attrib, l_int flags, void (*file_sel)() );
p_filelistctrl _filelistctrl_init ( p_filelistctrl o, t_rect r, p_filelistbox filebox );
extern p_filelistctrl (*filelistctrl_init) ( p_filelistctrl o, t_rect r, p_filelistbox filebox );
l_bool filelistbox_get_data ( p_object o, t_data *rec );
l_bool filelistbox_set_data ( p_object o, t_data *rec );
void filelistbox_translate_event ( p_object o, p_event event );
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -