Web Page API -> AddGadget
This function is used to add a customized button to the toolbar. The customized button will cause a Gadget Window to open (small floating window displaying a web page).
AddGadget(buttonLabel, buttonIcon, buttonTooltip, linkTargetUrl, width, height, defaultTarget, optionsDisplayText, optionsDisplayIcon, uniqueComponentID)
| Parameter |
Description |
Range |
Type |
| buttonLabel |
The text to display on the gadget button |
not null or empty |
string |
| buttonIcon |
The URL of the icon which is displayed on the gadget |
not null or empty |
string |
| buttonTooltip |
The tooltip text that appears when the mouse hovers over the button |
not null or empty |
string |
| linkTargetUrl |
The URL of the web page which is displayed when clicking the on the Gadget button |
not null or empty |
string |
| width |
The width of the gadget in pixels |
>0 |
int |
| height |
The height of the gadget in pixels |
>0 |
int |
| defaultTarget |
A Gadget is an HTML document that may include links. The default target for these links can be one of the following:
1. _self - Displays the link in the same window or frame that contains the Gadget
2. _main - Displays the link in the full browser window, replacing the current page
3. _new - Displays the link in a new browser window
Default: _self. |
Optional. |
string |
| optionsDisplayText |
Optional. The text to display in the toolbar's options dialog. When the parameter is left empty, the button label appears as the text in the toolbar's options dialog |
not null or empty |
string |
| optionsDisplayIcon |
Optional. The icon to display in the toolbar's options dialog. When the parameter is left empty, the button icon is displayed in the toolbar's options dialog |
not null or empty |
string |
| uniqueComponentID |
The Browser Component's (Gadget) unique ID, used to prevent duplicates. If the parameter is left empty, a unique ID is automatically created |
not null or empty |
string |
An object that contains the following fields:
| Field Name |
Description |
Type |
| returnValue |
Indicates whether the operation was successful.
True - The function adds a customized button to the toolbar
False - The button is not added to the toolbar. Check the value of the errorCode to determine the specific reason for the function failure
|
boolean |
| errorCode |
|
int |
This example contains a button that when clicked upon will insert a Gadget item to the Conduit demo toolbar.
| | |