Module vFileBrowser

int, number of visible rows (stored in vtable)

Functions

open_item (item) choose action (depends on item type)
get_header_def ()
get_items () get all items in table
get_selected_item () get selected item (first one, if multiple)
create_path (str) return bool
delete_selected () delete selected items in table
delete_folder (str) delete selected folder (including workaround for non-POSIX systems) TODO refactor into Filesys
match_file_type (file_path) get icon and extension in case of recognized file type
rename_file () rename the currently selected file (single item)
set_path (str) display the indicated path
is_root_folder (str) check if current folder is "root" (TODO: custom root folder)
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
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:

  • item

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:

  • str
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:

  • str (string)

Returns:

  1. bool
  2. 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:

  • str
is_root_folder (str)
check if current folder is "root" (TODO: custom root folder)

Parameters:

  • str

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)
generated by LDoc 1.4.2