09-26-2023 10:46 AM
Hi all,
I was wondering if it is possible to choose a file path dialog with an enum/ring drop down menu instead of searching file explorer for a file path? Or would it just be better to link it to an array with the file paths in it.
09-26-2023 11:06 AM
Hi,
I guess you mean choose a file path from a ring control (not a "file path dialog", which makes no sense).
Yes it is possible.
First you need to list the possible file paths, for example by using function "List Folder" (from the Advanced File Functions palette) that can list the files/folders inside a folder:
Then use property "Strings[]" of a Ring control to dynamically set the items of its drop-down menu:
Regards,
Raphaël.
09-26-2023 11:11 AM - edited 09-26-2023 11:19 AM
Your question is not very clear. What should be in the ring? (Filenames? Start paths?)
You can use a ring and place any strings as items, they can be paths!. (You can only use an enum if the items are static at runtime)
(I typically use a single column listbox that I fill with the result of :"list folder" (with a suitable pattern to only show interesting files!) where I can e.g. preview the data by selecting an item and load it by double-clicking.)
A listbox is easier to operate, because it is a single click and all content is visible at all times. You can even add metadata as symbols to show additional info, e.g. if it has been processed before. For a ring, you only see one entry until you click, then you need to drag down and release to select an item. Much more work!
09-26-2023 11:36 AM
I have an XControl that's a "Combo Path". Would you like it?
09-26-2023 04:49 PM
Hi all,
Thank you for the suggestions!
Basically, I want to open pdfs like manuals etc. through touch screen and going through file explorer is more difficult so I was just wondering if it was possible to display the pdfs that the user can open in a simple format such as a menu or a list. Please let me know of your suggestions!
Raphaël, I will try the list folder out.
Altenbach, the listbox is interesting I will look into that.
Paul, yes I would appreciate taking a look at your XControl Combo Path.
Thanks,
TK
09-27-2023 04:42 AM
@Teekayy wrote:I was wondering if it is possible to choose a file path dialog with an enum/ring drop down menu instead of searching file explorer for a file path?
You can't change an enum's values when the control isn't idle.
You'd need to use a ring, or combo box, or listbox. Or even a table or array... But if you use a table array, letting the user select an item from an array won't be as convenient as with a ring, combobox or listbox.
There are dozens of little tweaks you can do here.
For instance, in stead of passing the array of string by wire, you can get them back from a property node. If you have more than 1 ring\listbox\combobox, you can use the reference returned by the event... Anyway, that's probably all for later concern...
09-27-2023 12:41 PM
Thanks all,
This is my prototype.
09-28-2023 03:18 AM - edited 09-28-2023 03:22 AM
@Teekayy wrote:
Thanks all,
This is my prototype.
Well, that works as a prototype... 👍
Not sure where you want to take this.
In selection mode, you can set the listbox to scalar (it's now an array). That will be a clearer (unless you want the user to select multiple, but you'd need a button to apply the selection, and for loops to process the array of files).
You can put the case structure in the event, as it is having it outside the event only complicates things (it might be good for future use of course, if more than 1 event requires the action).
You probably want to put a while loop around it all, but as this is just a prototype, it all depends on your future plans.