PERGOLA LOGO

pergola.Dragarea

System events: YES.

User events and functions: YES (callback function defined in the activation object).

System component. The pergola.dragarea object is created at runtime by the system and ready for use. The drag area can be resized ad hoc to cover a particular region.

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

class

None

prototype

PROPERTIES

parent

pergola.systemComponents. Can't be overridden.

width

"100%" – string or number (user space units).

height

"100%" – string or number (user space units).

fill

"none" – string.

updateCoordinates

true – boolean.

cursor

"default" – string.

METHODS

activate(object)

this inherits the properties in object, where the callback function and handle object properties are required. If this updateCoordinates is overridden the x and y properties of the handle object will not be updated; If this cursor is overridden the specified cursor applies. object defines any other properties that need to be processed in the callback function. Returns this.

Note: it's important to remember that the callback function is invoked as a method of this (even where callback is a prototype or instance method of this handle), and that in its scope this handle refers to the object that required the activation of the drag area.

Two contextual examples of the activation object:

pergola.dragarea.activate({
  callback : this.rotate,
  handle : this,
  cx : this.getCX(),
  cy : this.getCY(),
  radius : this.radius(),
  theta : 0,
  offset : offset,
  updateCoordinates : false
});
pergola.dragarea.resize(this.absoluteX(this.container), this.absoluteY(this.container), this.visibleW, this.visibleH)
.activate({
  callback : pergola.rubberBox.update,
  handle : pergola.rubberBox,
  offset : this.getOffset(),
  updateCoordinates : false
});

release(evt)

Invoked on mouseup event. Deletes the properties inherited upon activation; invokes this reset; if this handle has a release method, invokes this.handle.release(). You don't normally need to invoke this method explicitly.

resize(x, y, w, h)

Sets this rect to specified x, y number coordinates and w, h number dimensions. Returns this.

reset()

Resets coordinates and dimensions to initial values. You don't normally need to invoke this method explicitly.

handleEvent(evt)

Invokes this callback on mousemove event; invokes this release on mouseup and mouseout events.

build(object)

this inherits the properties specified in object. Prototype properties specified in object are overridden. Creates elements. Returns this.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML(). This rect ID.

rect

<rect> element.

handle

Must be specified in the activation object. The object requiring the use of the drag area.

callback

Must be specified in the activation object. Function.

Note: the callback function is invoked as a method of this (even where the callback is a prototype or instance method of this handle), and that in its scope this handle refers to the object that required the activation of the drag area.