Open
The Open method should create or activate a window in which a frame of this part is the root frame.
ODID Open (in ODFrame frame);
frame
- A reference to a frame that is being opened into a window, or
kODNULL if the frame does not exist.
- return value
- The ID associated with the window.
DISCUSSION
Your part is always responsible for creating windows in which it is the root part, even when OpenDoc is opening a saved draft. Your part's Open method is called in these circumstances:
- When this part is initially created from stationery--meaning that it has no previously stored frame or window information--OpenDoc calls this method and passes
kODNULL for the frame parameter.
- When this part is an embedded part whose frame is selected, and the user chooses the Open Selection command from the Document menu, this part's containing part calls this part's
Open method and passes a reference to the selected frame in the frame parameter.
- When this part is the root part of a document being opened, OpenDoc calls this method and passes a reference to the root frame in the
frame parameter. The root frame is annotated with a storage unit containing window information; if the root frame has no window information, this part should instead open a default window.
OVERRIDING
When you subclass ODPart, you must override this method. Your override method must not call its inherited method; that is, your override method must implement this method's functionality completely.
EXCEPTIONS
kODErrInvalidFrame
- The specified frame is not a display frame of this part.
SEE ALSO
The ODID type (page 899).
The ODWindowState::Internalize method (page 862).
For more information on opening windows, see the chapter on windows and menus in the OpenDoc Programmer's Guide for the MacOS.
"The Open Method" on page 47 in OpenDoc Cookbook.
Table 2-1 on page 89 in OpenDoc Programmer's Guide.
"The Open Method of Your Part Editor" on page 228 in OpenDoc Programmer's Guide.
"Open Selection" on page 246 in OpenDoc Programmer's Guide.
"Installing a Patch" on page 455 in OpenDoc Programmer's Guide.