OLE-enabled applications must use the OleMainWindow class rather than
CwMainWindow. This is because OLE main windows can negotiate with OLE servers for menu-bar space and window real estate for in-place activation of any OLE object contained in its widget tree. An
OleMainWindow is a subclass of
CwMainWindow and, as such, it is created in the same way. The helper method
createOleMainWindow: in
CwWidget provides typical widget-creation protocol.
Here, the hostName resource is set even though it is often only used by non-in-place-activated OLE servers. In the case of non-in-place activation, the
hostName may be displayed on the label of an OLE server's
Close or
Exit menu items. For example, given the
hostName above, the label of an activated OLE server's normal termination menu item might read
Exit to Container instead of simply
Exit, as it would when the server application is explicitly launched. The menu bar of an
OleMainWindow is partitioned into groups to facilitate the negotiation for menu-bar space during in-place activation. The groups are:
Each group contains one or more pull-down menus (CwCascadeButton widgets). During in-place activation, the container is asked to populate the File, Container, and Window groups with pull-down menus appropriate to those categories of function. After the container populates its groups, the server is asked to fill in the Edit, Object, and Help groups with pull-down menus appropriate for its editing operations.