Resizing A Custom Element Box; Built-In Undo Support; Inspecting A Custom Element - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide

Resizing a custom element box

When the user resizes the box associated with a custom element, GoLive calls the
registered with the box object. Your handler validates the new height and width values as needed by your
extension, and sets the attributes of the custom element accordingly.
For example:
function resizeMyBox(boxEvt) {
var box = boxEvt.target;
if (box.width <= 640)
if (box.height <= 480)
}
//register the handler with the box object
function initializeModule() {
var myBox = boxes[myboxname];
myBox.addEventListener( 'resizeBox', resizeMyBox);
}

Built-in undo support

GoLive provides built-in undo support for dropping and resizing custom boxes. The user can undo or redo
such operations by choosing the
To undo and redo other operations involving your custom element, you must implement supporting code;
see
Supporting the Undo and Redo

Inspecting a Custom Element

The Inspector window is always available in the Window menu. Typically, the Inspector window provides a
user interface for getting and setting the attributes or content of a custom element.
When the user selects any modifiable page element in the GoLive document window, GoLive passes to the
Inspector window a unique value that identifies the kind of element selected. The Inspector window
customizes itself accordingly, displaying the controls appropriate for manipulating that element's
properties or attributes. GoLive provides inspectors for all built-in elements the user can modify. To
initialize the Inspector window appropriately for a custom element, GoLive uses the <jsxinspector> tag
you provide with the same classid value as the custom element. The <jsxinspector> tag specifies
controls that populate the Inspector window when its corresponding custom element is selected.
<jsxinspector name="
classid="
// jsxcontrol tags that provide inspector window controls go here
</jsxinspector>
Because the Inspector window is a palette window, defining a <jsxinspector> element is very similar
to defining a <jsxpalette> element:
Use the name , title , width , and height attributes just as you would use the same-named attributes
of the <jsxpalette> tag. For more information, see
Use <jsxcontrol> tags to define the contents of your inspector dialog just as you would use them to
define the contents of a <jsxpalette> window.
box.element.width = width;
box.element.height = height;
Undo
objectName
yourUniqueID
Adobe GoLive CS2 SDK
or
item from the Edit menu.
Redo
Commands.
nameInWindowMenu
" title="
anInteger
" width="
" height="
"
anInteger
" >
Palette
Windows.
Custom Elements
86
boxEvent
handler

Advertisement

Table of Contents
loading

Table of Contents