Doc - gui - FileSelector
Class: FileSelector
File selector GUI window handler
Constructor
pos.gui.FileSelector(root: string, action: string, onSelect: function)
Creates a new File selector window at starting at root, and action text.
onSelect is called when the action button is pressed and get the path to the selected file, and the File Selector's window.
Variables
| Type |
Name |
Description |
number |
w |
Window pixel width |
number |
h |
Window pixel height |
string |
root |
Current file browser root directory |
string |
action |
Action button text |
function |
onSelect |
On select callbakc |
Private Variables
| Type |
Name |
Description |
Window |
_p.window |
Selector window |
number |
_p.windowIndex |
Selector window __menuIndex |
TextInput |
_p.pathInput |
Path input |
ScrollField |
_p.scrollField |
File scroll field |
TextInput |
_p.fileInput |
File name input |
Button |
_p.upBtn |
Path up button |
table |
_p.fileBtns |
List of file select buttons |
Instance Functions
| Return |
Name |
Description |
nil |
show() |
Makes the selector visible |
nil |
hide() |
Hides the selector |
nil |
dispose() |
Disposes of the file selector and removes the window |
nil |
updateFiles(path: string) |
Updates the current root path, and updates the file buttons |