FolderFilters: IMetabaseDialogFilters;
The FolderFilters property returns the collection of filters that are used to determine folder objects in the dialog box.
Filters of this collection can be used to determine, which objects are considered to be folders. The open dialog box can be used to view contents of folder object and to select child objects.
By default, a filter of folder objects is not set, and contents of all band objects can be viewed in a dialog box, as well as of the objects that are parent folders for other objects (for example, contents of assemblies).
Folders contents is filtered according to the Filters collection.
Executing the example requires a form with the Button1 button and the MetabaseOpenDialog component named MetabaseOpenDialog1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Filters, FolderFilters: IMetabaseDialogFilters;
Filter: IMetabaseDialogFilter;
Begin
Filters := MetabaseOpenDialog1.Filters;
FolderFilters := MetabaseOpenDialog1.FolderFilters;
//Create a new filter to determine objects available in dialog box
//Filter includes platform forms, units and assemblies
Filter := New MetabaseDialogMetaclassFilter.Create;
(Filter As IMetabaseDialogMetaclassFilter).ObjectMetaclass := MetabaseObjectMetaclass.FORE_CLASS;
Filters.AddFilter(Filter);
//Create a new filter to determine objects, which contents can be viewed
//Filter includes only platform folders
Filter := New MetabaseDialogClassFilter.Create;
(Filter As IMetabaseDialogClassFilter).ObjectClass := MetabaseObjectClass.KE_CLASS_FOLDER;
FolderFilters.AddFilter(Filter);
MetabaseOpenDialogNet1.Execute(Self);
End Sub;
Clicking the button determines two filters for the MetabaseOpenDialog1 dialog box:
Filter of objects that are available in a dialog box.
A filter of objects that are folder objects.
Repository units, forms and assemblies are included in the first filter. Only platform folders are included in the second filter. Therefore, when initiating a dialog box, one can select a repository unit, form, or assembly in this dialog box. Selecting of units and forms that are stored inside of assemblies is disabled.
See also: