Its so hard to know what parts of this are based on the Actions Demo and what parts are more generic (like from RVActions)
I want to have a button on the toolbar that can be clicked and do a Save As... for the custom file type I've added.
How can I re-order the items in the Filter for that button? Or even in general? What shows up is mostly useless in my case. I don't want to disable the defaults, but they're certainly unimportant. The important one is the CUSTOM one, and it's stuck at the bottom of the list.
Usually you'd simply edit the SaveDialog's Filter property. But it seems to be getting generated dynamically, just going down the list of options in the Filter property for the Save As Action handler. THOSE things cannot be reordered, as they're just true/false properties in a list. And Custom is at the end.
Everything is so obscure here, and I can't see any way to just override parts of things, or extend anything. If you DO override something by inserting an explicit link in an event handler, you lose the ability to access any of the default behaviors as far as I can tell.
Is this accurate? Or am I missing something?
-David
re-order filters in Save As... ? (RVActions or SRV Demo???)
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
RichViewActions do not allow to reorder items in SaveAs dialog, they only allow to exclude some of them. Custom items are always after the standard items.
But you can control the default item (which is selected when the dialog is shown).
For SaveAs dialog, the default item corresponds to the document file type. For opened document, its type is used, you cannot modify it, it is assigned when the document is opened or saved. But you can define type for new documents. Assign properties of TRVAControlPanel, for example:
RVAControlPanel1.DefaultFileFormat := ffeCustom;
RVAControlPanel1.DefaultCustomFilterIndex := 1; // index of your custom format, from 1
Besides, change RVAControlPanel1.DefaultExt and RVAControlPanel1.DefaultFileName.
For Open dialog, assign rvActionOpen.LastFilterIndex.
But you can control the default item (which is selected when the dialog is shown).
For SaveAs dialog, the default item corresponds to the document file type. For opened document, its type is used, you cannot modify it, it is assigned when the document is opened or saved. But you can define type for new documents. Assign properties of TRVAControlPanel, for example:
RVAControlPanel1.DefaultFileFormat := ffeCustom;
RVAControlPanel1.DefaultCustomFilterIndex := 1; // index of your custom format, from 1
Besides, change RVAControlPanel1.DefaultExt and RVAControlPanel1.DefaultFileName.
For Open dialog, assign rvActionOpen.LastFilterIndex.
Well, in my current situation, the user will normally be creating a new document, then using Insert File... to get an existing file. I expect it will commonly be a Word .DOC file.
Regardless, it will normally be Saved As ... my custom file type.
So how can I set it up so that a NEW DOCUMENT action creates an instance of my custom file type? BTW, the "internal" type is an RVF file format. But it's saved along with some other stuff as my own file type.
Regardless, it will normally be Saved As ... my custom file type.
So how can I set it up so that a NEW DOCUMENT action creates an instance of my custom file type? BTW, the "internal" type is an RVF file format. But it's saved along with some other stuff as my own file type.