ChemDraw Menu Extensions Interface: Functions to Implement
|For each Menu Extension DLL,
ChemDraw creates a new menu. If only one Menu
Extension DLL is present, its menu will be placed in the menu bar
immediately preceding the Window menu. If more than one Menu
Extension DLL is present, an Extensions menu will appear in the
menu bar immediately preceding the Window menu, and the menus of
each Menu Extension DLL will be a popup menu in the Extensions
ChemDraw queries the DLL for the menu name using the GetTopLevelMenuName function. The number of submenu items will then be requested from the DLL through a call to GetSubmenuItemCount. The menus will then be built by calling GetSubmenuItemName for each submenu entry.
The call to GetSubmenuItemName includes a "documentToken". This identifier is unique to a particular ChemDraw document in the current ChemDraw process, but does not persist across sessions. If multiple instances of ChemDraw are running on a machine, the documentToken is not unique to that machine, but only to the particular ChemDraw process.
The documentToken is used to provide a context for queries to ChemDraw. See Access Functions for a listing of possible actions that may be requested of ChemDraw.
The submenu item names may be changed depending on the contents of a related document, but the number of submenu items must not change.
The appearance of each submenu item can be controlled by the GetSubmenuItemState function. ChemDraw will request the state of each menu item and set the apearance accordingly. Menu items can be enabled/disabled and checked/unchecked. A document token is provided to allow the DLL to evaluate the related document.
When the ChemDraw user makes a selection from the DLL menu, the DLL is called with a DoSubmenuChoice call. DoSubmenuChoice is provided with a documentToken, and a submenu item number. This is the point where the DLL will dispatch the menu selection.
If the DLL encounters an error while executing one of these calls, the library call should return a non-zero error value. This error code is used as an argument to GetErrorString which requests a string from the DLL with a description of the error.
©2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel 800 315-7300 / 617 588-9300 Fax 617 588-9390 Email firstname.lastname@example.org
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA