Droplet

From oWiki

Jump to: navigation, search

Contents


Preference Dialog

File:Droplet_pref.png

Attributes

pref.name

string  ( r )
The scriptable name for this droplet. This name can be set using rename method dynamically.

pref.width

string  ( r, w )
Specifies the width of this droplet.

Value Description
auto Default. The container calculates the actual width
% Defines the width in % of the document's width
length Defines the width in px, cm, etc. 

pref.height

string  ( r, w )
Specifies the height of this droplet.

Value Description
auto Default. The container calculates the actual width
% Defines the width in % of the document's width
length Defines the width in px, cm, etc. 

pref.passthru

bool  ( r, w )
Specifies if the droplet should handle user interface events or pass them to the droplets underneath.

pref.hideonload

bool  ( r, w )
Specifies if the droplet should be hidden on app loads.

parentBoxID

string  ( r )
The name of the parent droplet that this droplet attaches to.

parentBox

object  ( r )
The parent droplet that this droplet attaches to.

childBoxes

array  ( r, w )
The array of child droplets that are currently attached to this droplet.

boxWidth

int  ( r )
This width of this droplet in pixels.

boxHeight

int  ( r )
This height of this droplet in pixels.

pos

object  ( r )
The position of this droplet in relation to the upper-left corner of the document {'x':'100px','y':'100px'};

size

object  ( r )
The size of this droplet {'x':'100px','y':'100px'};

zIndex

int  ( r, w )
Specifies the z-order of this droplet.

molecules

array  ( r )
An array of molecules. Used to access individual molecule by index. (e.g. droplet.molecules[3]).


Methods

rename(n)

n: string

Rename this droplet.

getElementsByTagName(n)

n: string. Tag name
Return: array

Searches and returns an array of elements having the given tag name.

getElementById(n)

n: string. id
Return: element

Searches for element with the given id.

$n(n)

n: string. Tag name
Return: array

Short hand version of getElementsByTagName.

$(n)

n: string. id
Return: element

Short hand version of getElementById.

$$(n)

n: string. css selector
Return: array

Searches and returns an array of elements satisfying the given css selector.

isBoxAtPoint(x, y)

x: int. x coordinate
y: int. y coordinate
Return: bool

Check if this droplet contains the given point.

paint()

Force droplet to repaint its canvas molecule, if any.

refresh()

Force this droplet to redraw with the current set of attributes.

refreshMolecules()

Refresh this droplet's iframe and gmap molecules.

show()

show this droplet.

hide()

hide this droplet.

showAll()

Show this droplet and all its attached child droplets.

hideAll()

Hide this droplet and all its attached child droplets.

showAllChildren()

Show all attached child droplets.

hideAllChildren()

Hide all attached child droplets.

deleteBox(b)

b: true to delete all child droplets. Default is false.

Delete this droplet.

moveTo( x, y )

x: int
y: int

Move this droplet to location (x, y) relative to the upper left corner of the document.

moveBy( x, y )

x: int
y: int

Move this droplet by x and y pixels.

resizeTo( w, h )

w: int
h: int

Resize this droplet to width w and height h.

resizeBy( w, h )

w: int
h: int

Resize this droplet by w and h pixels.

clone(b)

b: bool. Default is false.
Return: a droplet

Create a clone of this droplet. if b is true, any 3D molecule is duplicated and placed in the same 3d scene, otherwise, it is placed in a duplicated scene.

deepClone(b)

b: bool. Default is false.
Return: a droplet

Create a clone of this droplet and all its child droplets. if b is true, any 3D molecule is duplicated and placed in the same 3d scene, otherwise, it is placed in a duplicated scene.

attachToBox(n)

n: string or object

If n is of type object, attach this droplet to the given droplet, or if n is of type string, to the droplet with the given name.

detachFromBox()

Detach from the parent droplet, if any.

bringBoxToTop()

Bring this droplet to the top of z-order.

dispatchEvent( n )

n: string

Dispatch a custom DOM event with the given event name into this droplet.

dispatchEventWithData( n, dn, d )

n: string, event name.
dn: string, data name.
d: object, data object.

Dispatch a custom DOM event with the given event name and a data object with the given name and properties into this droplet.

serialize()

Return: string

Serialize this droplet into its JSON representation.
Personal tools