Updating A Control's Appearance Immediately; Defining Drag-And-Drop For Custom Controls; Control As Sender Of A Drag Event; Receiving A Drop Event - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide

Updating a control's appearance immediately

If you need to draw the appearance of a custom control outside the context of the
can obtain a temporary draw object by calling the control's
to draw the control's new appearance immediately. When the drawing operation is complete, you must
call the control's
valid between these calls.
Only one temporary draw object can exist at any time. You cannot nest calls to the beginDraw method.
That is, each call to the beginDraw method must be matched by a call to the endDraw method before
you can call the beginDraw method again.

Defining drag-and-drop for custom controls

Custom controls are able to handle certain drag-and-drop actions. You can start a drag from a custom
control and drop it on the layout view of your document or onto another control. You can also receive
something dropped on a custom control such as files, HTML code, or an HTML color value.
For an example that implements both a draggable control and a control that can receive a drop, see the
DragNDrop sample that the SDK provides.

Control as Sender of a Drag Event

Any event handler for your custom control can start a drag-and-drop action. Call the control object's
awaitDrag
function to perform the drag operation, optionally displaying a custom cursor image, and check the
Boolean return value to determine if the drag has been received somewhere.
There are three drag-and-drop types, indicated by the
colors .

Receiving a drop event

If you define a custom control to be a drop target, you must define and register a
handler. GoLive passes this handler the
drag-and-drop action. Your handler must set the handle property of the dragDropEvent object to
true if your control can handle the drag-and-drop action, and false if your control cannot handle this
action. The handle property is valid when the event's state value is check .
To improve performance, do any intensive computation the first time state is check , cache the result,
and release it when the state becomes exit or drop .
endDraw
function to terminate the temporary object. The temporary draw object is only
function to detect if a drag action has been started. If it has, call the
Adobe GoLive CS2 SDK
dragDropEvent
dragDropEvent
object that contains information about the
paintEvent
beginDraw
function. Use the returned object
dispatchEvent
flavor value: html , files , or
dragControl
Windows and Controls
77
handler, you
event

Advertisement

Table of Contents
loading

Table of Contents