Consider a Cocoa NSDocument
that supports two document types (e.g. BMP and JPEG). While one type has no save options (e.g. BMP), the other does (e.g. compression level for JPEG).
How do you implement this?
I understand that you should override prepareSavePanel:
and set the accessory view of the given NSSavePanel
. However, doing this replaces the default accessory view with the document type pop-up.
Is it necessary to recreate the document type pop-up if when using a custom accessory view?
If yes, how can pass the selected document type and the additional save options to the NSDocument
write methods?
If no, how can I show the additional save options (e.g. compression level) only if the corresponding document (e.g. JPEG) type has been selected? Is there a delegate method for document type changes in the NSSavePanel
?