The following will guide you on how to works with parts. To start, the look of Document icons on the desktop look the same as today, even though some of them, like the Text Part icon, represent OpenDoc documents. Figure 15 shows some of the templates and document icons of the OpenDoc parts.
Figure 15. OpenDoc Templates and OpenDoc Document IconsFrom the user's point of view, there is no apparent distinction between an OpenDoc document and a regular application document. The menus are those of the text part editor (because the root part, a text part, is active). The menu names are those you would expect when editing text, except that the File menu is named Document, and the Application System icon (top left hand corner) is a document icon rather than an application icon. Notice the Templates folder (see Figure 15). This contains the template icons that the user drags to the document to create documents or parts.
An OpenDoc component can have the following different states:
° Inactive but alive ° Active ° Selected
This state is indicated by the appearance (or absence) of a frame border.
An active part receives the focus for mouse and keyboard events. It can update the menu bar for example to add some part specific help and to customize the edit menu items. Only one part can have the focus at one time. The data of this part can then be changed or updated by the user.
Now suppose the user wants to edit the content of this document's embedded graphics part. The user would click inside the graphics part's frame. The graphics part becomes active. (A border appears around its frame, its menus replace those of the text editor, and its tool palette appears.) The text part is now inactive. To select the circle, the user simply clicks on the circle button on the tool palette. As shown in Figure 16, a number of things happen: The graphics part editor highlights the selected graphics object by displaying handles.
Figure 16. An Active OpenDoc Graphics PartNote: OpenDoc supports the in-out model of editing. That means, you can directly edit a nested object, although it may be embedded in another part that is already embedded. In OLE a part can only be activated in an outside in order, which means to activate an embedded part the containing part must be activated first.
Just as the content of a part may be activated for editing, an embedded part (which is content of its containing part) may itself be selected for certain operations. To move or reseize a component, the component must be selected. To select an embedded component, the user drags across it or, if the part is active, clicks its border. The changed status is indicated by a different pattern of the boarder. Figure 17 shows what happens when the user clicks the active frame border in Figure 16. The graphics part is selected and its border changes to show handles and the part that contains it, the text part, becomes active again. It becomes active because, if the graphic part is moved, the text flow of the containing text part may have to change also. The menus are replaced by the text menus and the graphics palette goes away. (The same thing happens to the menus and palette when the user selects text in the text part or clicks there to get an insertion point, and in all cases, content that resides in the text part has been selected.)
Part
Figure 17. Resize a Selected PartParts viewed in frames can be active, inactive, or selected. Parts viewed as icons can be only inactive or selected. The following describes the three static (plural for status) of frames:
° A part is active when it contains the current selection or the insertion location (which could be a visible insertion point, as in text, or an unmarked default location, as when the background in a graphics part is clicked). The selection may be within the part's intrinsic content or it may be a part embedded in the active part. When an embedded part becomes active, OpenDoc displays the active frame border, a hashed line, around the part.
° A part is inactive when the user is working in some other part. When viewed in a frame, an inactive part has no visible frame border around it.
In OpenDoc several parts can be inactive but alive at the same time. A clock showing the time and a moving ticker tape may update their views concurrently.
° A part is selected. The user selects a part in a frame view by dragging across it, or by clicking its border if it's the active part. The containing part is responsible for the visual appearance of a selected part's frame; typically, the frame shows handles, to allow resizing. To select a part viewed as an icon, the user simply clicks the icon.
In general, as soon as the user clicks inside a part's frame, that part becomes active. The editor for the previously active part removes its menus, palettes, and other user interface elements, and the new active part's editor displays its user interface elements. The active part receives commands and keyboard events. Only one part at a time may be active within a document because, as in today's documents, there can be only one selection at a time.