GEOS SDK TechDocs
|
|
1 Document Control Overview
|
1.2 Document Control Interaction
There are three different classes of objects which together constitute the document control. These are
GenDocumentControlClass
,
GenDocumentGroupClass
, and
GenDocumentClass
. A document will need at least one of each to use the document control technology. The relationship between the objects is diagramed below.
An application will have one object of class
GenDocumentControlClass
. This object manages the user interface: It presents some dialog and alert boxes, it manages the File Selector, it creates appropriate entries for the File menu, and it updates the enabled/disabled states of these items (e.g. it disables the
Save
trigger after the file has been saved).
The GenDocumentControl is generally made a child of the file menu, which is itself a child (or descendant) of the GenPrimary. The GenDocumentControl is on the GenPrimary's active list. It has no children, but it does have an optr to the GenDocumentGroup object. By convention, the GenDocumentControl object is in the same data segment as the GenPrimary object. Certain attributes of the GenDocumentControl object will determine the characteristics of the File Selector and other UI gadgets.
GenDocumentControlClass
is a subclass of
GenControlClass
. This means that you can set up toolboxes to perform the "Save," "Open," etc., actions. For more details, see the Controllers chapter.
An application will have one object of class
GenDocumentGroupClass
. This object creates and manages the document objects. Ordinarily, the document objects belong to
GenDocumentClass
. However, if the program wishes to alter the behavior of the document object, it can create a subclass of
GenDocumentClass
. In this case, the GenDocumentGroup object will contain a pointer to the class definition of the document subclass, and will create document objects of this class as needed.
The GenDocumentGroup object is a child of any object. It does not have any children when it is declared; however, it will dynamically give itself document-object children at run-time. It is in its own data segment. Certain of its attributes determine what the attributes of its document children will be.
Each GenDocument object manages a single open file. It keeps track of the volume, path, and filename for the document, the dirty state of the document, and other document-related information. It opens and closes files and presents file-related dialog boxes (e.g., "Save changes before closing?"). Programs often define a subclass of the
GenDocumentClass
which has additional, application-related functionality. In this case, objects of the subclass are used instead of objects of
GenDocumentClass
.
GenDocumentClass
is a subclass of
GenContentClass
. Therefore, document objects can receive the output of GenView objects. GenDocument objects have all the functionality of GenContent objects. GenContent objects are themselves subclassed from
GenClass
. Very few applications will use the GenContent objects directly; for that reason, they are documented in this chapter.
Document objects are not declared in the source code; they are created at run-time by the GenDocumentGroup object. The document currently active is called the target document .
GEOS SDK TechDocs
|
|
1 Document Control Overview
|
1.2 Document Control Interaction