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

JavaScript: lz.canvas
extends <view> » <node> » lz.Eventable »

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

The lz.canvas class represents the viewable area of the application. There is one instance of lz.canvas, 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 (CSS property) Type (tag) Type (js) Default Category
allowfullscreen   Boolean   initialize-only
  Whether fullscreen display state is supported for the SWFx runtimes.
appbuilddate   String   readonly
  A String specifying the date and time of the application build. "2008-09-12T14:15:12Z"
dataloadtimeout numberExpression Number   read/write
  If present, specifies the default timeout in milliseconds for data load requests
datasets   Object   read/write
  Dictionary of all named datasets.
defaultdataprovider   lz.DataProvider   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.
framerate number Number "30" initialize-only
  The framerate that should be used for this application
fullscreen   Boolean   read/write
  Used to switch into fullscreen display mode or back to normal display.
httpdataprovider   lz.DataProvider   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   readonly
  A String specifying the LPS build revision and the build directory: e.g. "4075 /Users/maxcarlson/openlaszlo/legals"
lpsbuilddate   String   readonly
  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   String   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).
mediaerrortimeout numberExpression Number   read/write
  If present, specifies the default timeout in milliseconds for media errors. An error occurs when no bytes have been received. This is used in Flash to detect media loads that have failed due to the security policy.
medialoadtimeout numberExpression Number   read/write
  If present, specifies the default timeout in milliseconds for 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   readonly
  A String describing the target runtime. "dhtml" | "swf8" | "swf9" | "swf10" are currently supported. Others are in development.
screenorientation   Boolean   read/write
  Used to tell what the screen orientation is, 'portrait' or 'landscape'
scriptlimits css Object   initialize-only
  A CSS declaration of property: value pairs used to advise the underlying runtime of desired recursion and timeout limits. Not all runtimes respect this advice. The default value is runtime dependent, but typically recursion is at least 100 and timeout at least 10 (seconds). Example: scriptlimits="recursion: 256, timeout: 15"

Methods

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

Methods inherited from lz.Eventable

destroy, setAttribute

Class Methods

versionInfoString()
lz.canvas.versionInfoString();
Compute version info as a string

Events

Name Description
onafterinit Sent after oninit
onframerate Sent whenever the framerate changes
onfullscreen Sent whenever the application switches to full screen mode.
onmouseenter Sent whenever the mouse is moved over the canvas
onmouseleave Sent whenever the mouse is moved off the canvas
onmousemove Sent whenever the mouse moves
onpercentcreated Sent whenever the number of created nodes changes
onscreenorientation Sent whenever the screen orientation changes

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy