-
Notifications
You must be signed in to change notification settings - Fork 3
File Dropdown
George Joseph edited this page Jan 19, 2020
·
2 revisions
Derived from Element -> Widget -> Select
"File Dropdown" works somewhat like the File List widget except it lists the files in a "dropdown" select box. You can add actions to be triggered when a file is selected like "print" or "macro" or you can send the DUEUI.EVENTS.PRINT, DUEUI.EVENTS.RUN, or DUEUI.EVENTS.REFRESH events to this widget.
There's a convenience widget File Select that has this dropdown plus refresh and action buttons already defined.
{
/*
* All attributes of Element, Widget, and Select
*/
"id": "print_files",
"type": "file_dropdown",
/* The default directory is "/gcodes" */
"directory": "/macros/",
/*
* For the label, you can strip any "XX_" prefix from the
* front, and any ".g" or other suffix from the
* end.
*/
"strip_prefix": true,
"strip_suffix": true,
/*
* You can sort them based on the "file"
* name which would include any "XX_" prefix
* or you can sort them based on the "label"
* after any of the following transforms are done.
*/
"sort": "label",
}