Problem: 1174929

Title: (File) this->KindOfFile()

Received: Jul 17 1994 1:19PM


TApplication.DoMakeDocument() is called with this->KindOfDocument(itsOpenCommand) as a parameter, so developers can identify more than one type of document with more than one cOpen ... cOpenLast command number.

However, all of these given a TFile wich are created by this->DoMakeFile() with the ORIGINAL itsOpenCommand. This does not work if each document has it's own TFile as well (eg differences in resource fork open or not etc.).

Better: Add a KindOfFile() to TApplication and call that from wherever DoMakeFile() is called:

this->DoMakeFile(this->KindOfFile(itsCommandNumber));

Here is a developer question that supports this request:

We have an application that supports the creation and editing of multiple file types. We've overridden the TApplication member functions that control document and file creation. The problem that we are having is in opening an existing file (Document). ChooseDocument creates a file object using the default creator and type. Thus the wrong document and TFile subclass are created.

How do we support multiple documents in MacApp? We have the needed for our application to create and edit 5 different file types.

Do we need to subclass TFile for each of these situations?

One problem that we see is that an open command is always commandNumber 20 and no where to change it after the user selects the file to open. We can't have 5 different open menu items. We do have different command numbers for creating each of the supported types. ie, cnd_NewTextMessage, cmd_NewFileMessage.

We've overriden the following TApplication member functions to create the proper document and file objects.

The file document objects that the application can create are named as follows. These all needed to be written to a file. Each file has a unique type and bundle. We can NOT seem to find any MacApp samples that support the creating of more than one (1) document type and associated file.