<canvas>
The top-most view in a Laszlo application.

JavaScript: LzCanvas
extends <view> » <node> » LzEventable »

The canvas is the container for all views within an application.

The LzCanvas class represents the viewable area of the application. There is one instance of LzCanvas, named canvas. The canvas contains all views within an application.

The <canvas> tag is the document root of an LZX application file. It contains class, resource, and font definitions, library includes, and view and other instances.

See the Guide for a complete discussion of the <canvas> tag.

Attributes

Name Type (tag) Type (js) Default Category
dataloadtimeout numberExpression Number   read/write
  If present, specifies the default timeout in milliseconds of data load requests
datasets   Object   read/write
  Dictionary of all named datasets.
defaultdataprovider       read/write
 

defaultdataprovider is bound to the system default DataProvider.

By default, this will be an instance of LzHTTPDataProvider, which will also be pointed to by the canvas.httpdataprovider.
embedfonts   Boolean   initialize-only
  Whether to embed fonts in the compiled application.
httpdataprovider       read/write
 

httpdataprovider is bound to the system default HTTP DataProvider.

This will be an instance of LzHTTPDataProvider, which implements HTTP request transport. The default value of the canvas.defaultdataprovider is initially set to point to this same object.
lpsbuild   String   initialize-only
  A String specifying the LPS build revision and the build directory: e.g. "4075 /Users/maxcarlson/openlaszlo/legals"
lpsbuilddate   String   initialize-only
  A String specifying the date and time of the LPS build. "2007-03-05T15:33:42-0800"
lpsrelease   String   initialize-only
  release of the LPS that generated this application (for .lzo files, this is the release of the server that generated the optimized file, not the one that served it).
lpsversion   Number   initialize-only
  version number of the LPS that generated this application (for .lzo files, this is the version number of the server that generated the optimized file, not the one that served it).
medialoadtimeout numberExpression Number   read/write
  If present, specifies the default timeout in milliseconds of media load requests
percentcreated   Number   read/write
  A number from 0-1 that represents the percentage of the app that has been instantiated.
proxied booleanLiteral | "inherit" String "inherit" read/write
  If true, requests for data and media are proxied through LPS server. if false, requests are made directly to target URLs. if inherit, inherit from lzproxied query arg.
runtime   String   initialize-only
  A String describing the target runtime. "dhtml" | "swf7" | "swf8" are currently supported. Others are in development.
version string Number "1.1" read/write
  The lpsversion of this lzx application.

Methods

setDefaultContextMenu()
canvas.setDefaultContextMenu(cmenu : LzContextMenu);
Install default menu items for the right-mouse-button
Parameter Name Type Description
cmenu LzContextMenu LzContextMenu to install on this view

Methods inherited from LzEventable

destroy, setAttribute

Class Methods

versionInfoString()
LzCanvas.versionInfoString();
Compute version info as a string

Events

Name Description
onafterinit Sent after oninit
onmousemove Sent whenever the mouse moves
onpercentcreated Sent whenever the number of created nodes changes

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from LzEventable

ondestroy