Module vFileBrowser
int, number of visible rows (stored in vtable)
self.path |
string, absolute folder path - file part is ignored |
self._file_ext |
string |
self._file_types |
table>{ext1 = {icon},ext2 = {icon},...} |
self._show_columns |
table{string,string,string...}
decide which columns to show (leave blank to show all) |
self._show_header |
boolean, show_header (stored in vtable) |
self._show_parent_folder |
boolean, whether to show a "..." entry at the top
(note: this option is only relevant when @show_folders is set) |
self._single_select |
boolean, use single-click to select (open) item |
self.root_folder |
string, enforce this as root folder (restrict browsing) |
self.on_file_open |
function, callback event |
self.on_checked |
(function) callback event |
elm |
(function) callback event |
elm |
(function) callback event |
self.selection |
(vSelection) |
Functions
-
open_item (item)
-
choose action (depends on item type)
Parameters:
Returns:
table
-
get_header_def ()
-
Returns:
table
-
get_items ()
-
get all items in table
-
get_selected_item ()
-
get selected item (first one, if multiple)
Returns:
table or nil
-
create_path (str)
-
return bool
Parameters:
-
delete_selected ()
-
delete selected items in table
Returns:
bool
-
delete_folder (str)
-
delete selected folder (including workaround for non-POSIX systems)
TODO refactor into Filesys
Parameters:
Returns:
-
bool
-
string (error message)
-
match_file_type (file_path)
-
get icon and extension in case of recognized file type
Parameters:
- file_path
TRACE("vFileBrowser
match_file_type(file_path)",file_path)
Returns:
string(icon) or nil when not matched
-
rename_file ()
-
rename the currently selected file (single item)
-
set_path (str)
-
display the indicated path
Parameters:
-
is_root_folder (str)
-
check if current folder is "root" (TODO: custom root folder)
Parameters:
Returns:
boolean
-
update_row_styling ()
-
decorate selection rows (visible on next update)
-
clear_row_styling ()
-
reset row styling (taking effect immediately)
Fields
-
self.path
-
string, absolute folder path - file part is ignored
-
self._file_ext
-
string
-
self._file_types
-
table>{ext1 = {icon},ext2 = {icon},...}
-
self._show_columns
-
table{string,string,string...}
decide which columns to show (leave blank to show all)
-
self._show_header
-
boolean, show_header (stored in vtable)
-
self._show_parent_folder
-
boolean, whether to show a "..." entry at the top
(note: this option is only relevant when @show_folders is set)
-
self._single_select
-
boolean, use single-click to select (open) item
-
self.root_folder
-
string, enforce this as root folder (restrict browsing)
-
self.on_file_open
-
function, callback event
- elm
(vFileBrowser)
- item
(table)
-
self.on_checked
-
(function) callback event
- elm
(vFileBrowser)
- item_id
(int)
-
elm
-
(function) callback event
- elm
(vFileBrowser)
self.on_changed_path = args.on_changed_path or nil
-
elm
-
(function) callback event
- elm
(vFileBrowser)
self.on_resize = args.on_resize or nil
-
self.selection
-
(vSelection)