Important: The information in this document is obsolete and should not be used for new development.
Chapter 4 - Creating a Cyberdog Display Part
This chapter outlines the steps you take to create an editor for a Cyberdog display part. A Cyberdog display part is an OpenDoc part that can retrieve and display data from an Internet location specified by a Cyberdog item; for example, the contents of an HTTP or Gopher site. Specifically, a Cyberdog display part class is a subclass ofODPart
that has a Cyberdog part extension.You create a Cyberdog display part editor much as you create an editor for any OpenDoc part; for example, you specify how data is rendered and stored, and you specify its resources. However, creating a Cyberdog display part editor involves a few additional steps, as follows:
This chapter illustrates these steps using a sample Cyberdog display part,
- Implement a Cyberdog part extension subclass to allow Cyberdog to communicate with your part editor.
- Implement the OpenDoc extension protocol in your part editor.
- Use window-position hints when your part is opened.
- Replace OpenDoc's Document menu with Cyberdog's Document menu.
- Access data referenced by a Cyberdog item; for example, by using a Cyberdog stream to download data for display.
- Allow Cyberdog to participate in closing your part's windows.
- Support Cyberdog's service menus, as described in "Displaying Cyberdog Menus" (page 105).
- Modify your part's name-mapping (
'nmap'
) resource to support the Cyberdog part kind of data.
CybTxtViewer
, which downloads and displays text. Cyberdog already provides a real display part for text; your display part would likely display other kinds of data or display text data some other way.
Chapter Contents
- Implementing Your Cyberdog Part Extension
- Associating a Part Extension With a Display Part
- Overriding Cyberdog Part Extension Methods
- Implementing Your Cyberdog Display Part Class
- Modifying Your ODPart Subclass
- Implementing the OpenDoc Extension Protocol
- Releasing the Part Extension
- Creating and Destroying the Display Part Object
- Supporting Cyberdog's Document Menu
- Using Window-Position Hints
- Creating a Stream for Downloading
- Downloading From the Stream
- Locating the Cyberdog Item's Window
- Closing Your Display Part's Window
- Modifying Your Name-Mapping Resource