Important: The information in this document is obsolete and should not be used for new development.
Chapter 16 -
This chapter includes recipes and sample code that demonstrate how to
Working With Documents
MacApp's document classes are described in detail in Chapter 7, "Document Handling."
- work with documents (a general outline)
- revert to the previously saved version of a document
- use a designator to save a document's current selection
- save the display state of a document and restore it when the document is opened
Recipes for turning documents into electronic mail can be found in Chapter 29, "Working With PowerTalk Mailers."
For an overview of how to read and write a document with a stream, see Chapter 27, "Working With Streams."
Chapter Contents
- Overview
- Creating and Initializing a Document
- The DoInitialState Method
- The DoMakeViews Method
- The UntitledName and SetTitle Methods
- The DoPostMakeViews Method
- Saving a Document's Print Information
- Recipes--Documents
- Working With Documents--A General Outline
- Recipe--Reverting to a Previous Version of a Document
- Include the Revert Menu Item in Your File Menu
- Override FreeData in Your Document Class
- Override DoInitialState in Your Document Class
- Override RevertDocument in Your Document Class
- Override ShowReverted in Your Document or View Class
- Recipe--Saving the Current Selection With a Designator
- Override SetUserSelection in Your Document Class
- Override RevealSelection in Your Document Class
- Recipe--Saving and Restoring a Document's Display State
- Define a Display State Information Record and a Document Field
- Add a Boolean Field to Specify Reopening
- Write the Display State Record When Writing
- Read the Display State Record When Reading
- Set the Document's Display State From the Record When Reopening