Adobe acrobat 7.0.5 sdk 用户手册

下载
页码 122
59
6
Modifying the User Interface
This section describes how to change the Acrobat or Adobe Reader user interface using the 
Acrobat SDK.
This chapter consists of the following sections:
Adding or Removing Menus and Menu Items
You can use the Acrobat SDK to manipulate menu items, menus and menu bars. For 
complete information on what functionality is available with each SDK technology, see the 
Acrobat and PDF Library API Reference. the Acrobat JavaScript Scripting Reference, or the 
Acrobat Interapplication Communication Reference.
Adding Menu Items
You can use a plug-in or Acrobat JavaScript to add or remove menu items or submenus to 
an existing menu. From JavaScript, use the 
app
 object’s 
AddMenuItem
HideMenuItem
and 
AddSubMenu
 methods. Plug-ins can access the methods of the 
AVMenu
 and 
AVMenuItem
 objects. 
With IAC OLE automation, you can remove a menu item using the 
App.MenuItemRemove
 method. However, you cannot use IAC to add a menu item. 
Menu items added by plug-ins can have shortcuts (keyboard accelerators). Acrobat and 
Adobe Reader do not ensure that plug-ins add unique shortcuts, but it is possible for a 
plug-in to check which shortcuts are already in use before adding its own. Note that the 
only way to ensure there are no shortcut conflicts is for all plug-ins to check for conflicts 
before adding their own shortcuts.
You are encouraged to have your plug-in add its menu items to the Tools menu. When it is 
launched, Acrobat or Adobe Reader automatically adds this menu, as well as the About 
Plug-ins
 and Plug-in Help menus (see 
). After Acrobat or Adobe Reader loads all plug-ins, it checks these three menus and 
removes any that are empty.