Vidar Hasfjord - 2019-11-25

[SetFileFilter] seems not to be implemented

This is a known bug. See [bugs:#380]. It is fixed on the trunk.

[Regarding no support for multiple filters,] I think it is a bug

I don't think it is a bug. As pointed out earlier in this thread, my understanding is that TDocTemplate does not support what you try to do. It is simply designed for one filter per TDocTemplate instantiation.

what if I want to allow a filter, so only a specific file type is visible?

Think of a TDocTemplate instantiation as a single entry in the file type drop-down list in the file open dialog.

You can create multiple instantiations of the TDocTemplate in your code, with different file types and filters for each instantiation, even for the same document type and view (TDocTemplate derivative). In that case, the file dialog should show all file types available, and you should be able to select between them, and thus filter the visible files on type.

const auto DocTemplateFlags = dtAutoDelete | dtHideReadOnly | dtOverwritePrompt | dtSingleView | dtUpdateDir;
auto ReportTemplate = new reportTemplate("Report (*.rep)", "*.rep", nullptr, "rep", DocTemplateFlags);
auto ResultTemplate = new reportTemplate("Result (*.result)", "*.result", nullptr, "result", DocTemplateFlags);

So, I don't see a need to extend the capabilities of TDocTemplate here.

 

Related

Bugs: #380


Last edit: Vidar Hasfjord 2019-11-25