OWLNext 7.0
Borland's Object Windows Library for the modern age
|
An OLE container places OLE commands on its Edit menu.
The following table describes the standard OLE commands. It's not necessary to use all of them, but every container should support at least Insert Object, to let the user add new objects to the current document, and Edit Object, to let the user activate the currently selected object. The TOleView class has default implementations for all the commands. It invokes standard dialog boxes where necessary and processes the user's response. All you have to do is add the commands to the Edit menu for each view you derive from TOleView.
Menu command | Predefined identifier | Command description |
Paste Special | CM_EDITPASTESPECIAL | Lets the user choose from available formats for pasting an object from the Clipboard. |
Paste Link | CM_EDITPASTELINK | Creates a link in the current document to the object on the Clipboard. |
Insert Object | CM_EDITINSERTOBJECT | Lets the user create a new object by choosing from a list of available types. |
Edit Links | CM_EDITLINKS | Lets the user manually update the list of linked items in the current document. |
Convert | CM_EDITCONVERT | Lets the user convert objects from one type to another. |
Object | CM_EDITOBJECT | Reserves a space on the menu for the server's verbs (actions the server can take with the container's object). |
If your OLE container has a tool bar, assign it the predefined identifier IDW_TOOLBAR. ObjectComponents must be able to find the container's tool bar if a server asks to display its own tool bar in the container's window. If ObjectComponents can identify the old tool bar, it temporarily replaces it with a new one taken from the server. For ObjectComponents to identify the container's tool bar, the container must use the IDW_TOOLBAR as its window ID, as shown here.
The TOleFrame::EvAppBorderSpaceSet method uses the IDW_TOOLBAR for its default implementation. A container can provide its own implementation to handle more complex situations, such as merging with multiple tool bars.