SaveDialog suggested filenames to match extension filter - delphi

When my program displays a SaveDialog to save a file I can use the Filter and Filter Index properties to restrict the files displayed to certain extensions. Also, when I set the DefaultExt property then, as the user types a filename, matching files in the folder are displayed as suggestions in a dropdown box and one can be selected with the mouse.
For example if the filter is set to "*.xml" then only filenames matching that extension appear in the the dialog list of files. But if the user type "Test", then you will get a dropdown list of suggestion files like:
TestA.doc
TestB.xml
Test123.pdf
TestX.xml
(if those files are present in the folder)
But I would like the suggestion list to only contain the files that match the filter, such as *.xml. Is that possible? The problem is that users can hit the wrong suggestion and save their file with the wrong extension.

TSaveDialog internally uses the IFileDialog interface of Windows. That interface doesn't offer any way in which to change how to filter files in suggestion dropdown text box of File Name field.
You can :
Implement own dialog from scratch
Use component like DexExpress which is not free
Check result of save dialog after execution of it and validate the user selection file and show proper message to user if the file is not valid

Related

Share sheet - exclude options which are not provided as Type Properties in UIActivityType

I want to exclude Add to iCloud Drive, Add to Reading List, Save to Files & Print from share sheet.
I could exclude Add to Reading List and Print options using following code. Because these type properties have been provided.
activityViewController.excludedActivityTypes = [ UIActivityType.print, UIActivityType.addToReadingList ]
After with when I search google I found a way to remove options which are not included in type properties as follows (Ex: Add to iCloud drive)
UIActivityType(rawValue: "com.apple.CloudDocsUI.AddToiCloudDrive")
I want to know that how can we find row values to exclude other options which are not defined in type properties. For instance Save to Files
The simplest way to determine what UIActivityType values are used for undocumented types is to add a completionWithItemsHandler: block which logs the UIActivityType parameter that it is called with. Then use your app to share something and select the activity type that you want to find the value for. The completion hander will be called, logging its type.
Alternatively, you can create your own object which implements UIActivityItemSource, add that to the item activities that you are sharing and implement activityViewController(_:itemForActivityType:) and log the type.
I tried Geoff's suggestion (logging the UIActivityType by implementing a completionWithItemsHandler) for my purposes: disabling 'Add to Notes', 'Add Reminder', and 'Save to Files'. It works EXCEPT for 'Save to Files'.
The logged type of the Save to Files UIActivityType is the same one listed in this question, and adding this to the excludedActivityTypes does not work as of iOS 11.1.2. Others (here, and here) have run into this issue as well.
For the time being it seems there is no way to exclude the Save To Files UIActivityType. Hopefully Apple will update the documentation on how to do so soon.

Can you include an input field in a drop down list using select-2?

I am using select-2 for a list of states. I think its great and love the search input field it provides. I'm wondering though, is it possible to include another input so someone can manually enter information ~ I am hoping to add an "Other" or "International" field to this drop down so instead of including all the states / provinces / territories of the world I provide a field they can manually enter if the territiry if it's not included in the drop down list.
Is an input in a drop down even possible? I would like to try and stick with Select2 as I like the added features it provides.
You can add items manually to the select2 dropdown using the "tagging" function. See the link for more information: https://select2.org/tagging

Search option in multi-select listbox document property

I am trying to create a multi-select list box document property with unique values in a column. But, I don't see a search box feature like in the default list box property.
Please advise as how should I include this option in the list box document property that I created.
For the default listbox filter, we can choose if the search option to be included or not (as shown in the screenshot below). Don't we have this option available for document property?
Thanks for your help!
You can use any Jquery Plugin (check here - Here or Here ) or any JS library like Check this .

Populating multiselect OpenDialog with a series of filenames

I use an OpenDialog with Multiselect enabled to allow more than one jpg file to be displayed on a screen. When the dialog is closed, I iterate through the Files list and create a delimited string of filenames which is stored in a memo field of an Access table.
If the user wants to edit the selection, I want to parse the delimited string value and put the filenames into the OpenDialog and have it displayed in the same way it was when they were first selected, however, the dialog only has one filename in the edit box of the form. When the dialog is closed, only this file is in the files list.
How do I re-populate the Files list? We are using Delphi XE on W7-10.
Also, is it possible to have the list "unsorted"? The files list returns filenames in a sorted order, there is no "sorted" property. I would like to be able to have the user select the files in the order they wish to display them. At the moment, sorting is done in a custom editing form that allows them to be dragged to position. This is written out to the delimited string and written to the table.

Umbraco drop down list with content entered by admin - xpath dropdown?

In Umbraco 6.1, I need to add a field to a Document Type that gets it's possible values from a list that an admin user can add to via the back end.
I figured I'd do this by creating a Developer/Data Type of type XPath DropDownList and have that point to a folder in my Umbraco content through the XPath Expression //Configuration/lookup-lists/course-availability. I've set the Type of Document and Value to Node Id/
This drop down list isn't displaying the SimpleTextItems that are within this folder (its empty).
Any ideas?
I believe you're looking to select content from a specific folder in your content-tree, is this correct? Look into the Multi-Node Tree Picker in this case as you can configure this pick 1-n nodes in any specific folder or type..
If the above is not what you're looking for, you might also check the uComponents dropdown that an admin with access to the Developer section can edit the 'pre-values'.
Whatever you're looking for exactly - some data type in the uComponents package is most likely the answer. If not (u'd be surprised!), you may have to code your own .
Your XPath is incorrect.
your Xpath should be something like (loads all existing documents with doctype:SimpleText and in first level of Umbraco tree)
$ancestorOrSelf/ancestor-or-self::*[#level=1]/SimpleText
Please take a look at here to see correct Xpath samples for your dropdownlist

Resources