Retrieving Existing Toolbar Buttons; Attaching A Button To A Toolbar; Example 7.5 - Adobe ACROBAT SDK 8.1 Manual

Developing plug-ins and applications
Table of Contents

Advertisement

Adobe Acrobat SDK
Developing Plug-ins and Applications
The following code example retrieves the SecureTask button located on the Tasks toolbar and gets its icon.

Example 7.5

//Retrieve the Tasks toolbar
const char * toolbarName= "Tasks" ;
AVToolBar myToolBar = AVAppGetToolBarByName(toolbarName);
//Retrieve the SecureTask button located on the Tasks toolbar
AVToolButton mySecureButton =
AVToolBarGetButtonByName(myToolBar,ASAtomFromString("SecureTask"));
if (mySecureButton == NULL)
{
AVAlertNote ("The button was not successfully retrieved");
return;
}
//Get the icon located on the button
//Pass the AVToolButton object
AVIcon mySecureIcon = AVToolButtonGetIcon(mySecureButton);

Attaching a button to a toolbar

After you create a new button, you must attach it to a toolbar. A button must be attached to a toolbar
before it is visible within Adobe Reader or Acrobat. To attach a button to a toolbar, invoke the
AVToolBarAddButton
An
AVToolBar
An
AVToolButton
An
ASBool
attached before the button specified by the
after the button specified by the
, the button is attached at the beginning of the toolbar. If
true
false
An
AVToolButton
with the
Before a button has functionality, you must create a callback function. For information, see
toolbar button callback functions" on page
The following code example attaches a newly created button to the File toolbar.

Retrieving existing toolbar buttons

method and pass the following arguments:
object that represents the toolbar to which the button is attached.
object that represents the button that is attached.
object that specifies the location of where the button is attached. If
, the button is attached at the end of the toolbar.
object (the name of this argument is
object that specifies the location of where the
ASBool
otherButton
argument. If
otherButton
105.
Creating Toolbars and Buttons
Attaching a button to a toolbar
true
argument. If
, the button is attached
false
is NULL and this value is
otherButton
is NULL and this value is
otherButton
) that is used in conjunction
otherButton
AVToolButton
103
, the button is
object is attached.
"Creating

Advertisement

Table of Contents
loading

Table of Contents