Name

canvas (LzCanvas) — The top-most view in a Laszlo application.

Synopsis

LZX: canvas
JavaScript: LzCanvas
Type: Class
Access: public
Topic: LFC.Views
Declared in: WEB-INF/lps/lfc/views/LaszloCanvas.lzs

Description

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.

In addition to any events documented in the section below, these events are also available: oninit This event is sent right before a node becomes active -- e.g. before a view displays, or before a layout affects its subviews. In addition to any fields documented in the section below, these fields are also available: String build: build number of the LPS that generated this application (for .lzo files, this is the build of the server that generated the optimized file, not the one that served it). String expires: expiration date of this LPS application (based on expiry of server that generated the application, not the one that served it).

Superclass Chain

node (LzNode) » view (LzView) » canvas (LzCanvas)

Known Subclasses

Details

Static Methods (1)

versionInfoString()
<method name="versionInfoString" />
static public function versionInfoString();
Compute version info as a string

Initial Attributes (2)

Initial Attributes are given as attributes in LZX but are not generally available as properties in JavaScript.

accessible
<attribute name="accessible" type="boolean" />
Specifies if this application is intended to be accessible
debug
<attribute name="debug" type="boolean" />
If true, the application is compiled with debugging enabled. See the Debugging chapter of the Guide for more information about debugging.

Properties (11)

dataloadtimeout
<attribute name="dataloadtimeout" type="numberExpression" />
public var dataloadtimeout : Number = 30000;
If present, specifies the default timeout in milliseconds of data load requests
datasets
<attribute name="datasets" type="object" />
public var datasets : Object;
Dictionary of all named datasets.
initdelay
<attribute name="initdelay" />
public var initdelay = 0.0;
lpsrelease
<attribute name="lpsrelease" type="string" />
public final var lpsrelease : String;
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
<attribute name="lpsversion" type="number" />
public final var lpsversion : Number;
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).
__LZlfcversion
<attribute name="__LZlfcversion" />
private var __LZlfcversion = 0;
medialoadtimeout
<attribute name="medialoadtimeout" type="numberExpression" />
public var medialoadtimeout : Number = 30000;
If present, specifies the default timeout in milliseconds of media load requests
nodeLevel
<attribute name="nodeLevel" />
public var nodeLevel = 0.0;
percentcreated
<attribute name="percentcreated" />
public var percentcreated;
A number from 0-1 that represents the percentage of the app that has been instantiated.
proxied
<attribute name="proxied" type="inheritableBooleanLiteral" value=""inherit"" />
public var proxied : Boolean;
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.
version
<attribute name="version" type="string" value=""1.1"" />
public var version : Number;
The lpsversion of this lzx application.

Methods (22)

compareVersion()
<method name="compareVersion" args="ver, over" />
public function compareVersion(ver, over);
Compares two version strings.
init()
<method name="init" />
private function init();
initDone()
<method name="initDone" />
private function initDone();
initialize()
<method name="initialize" args="args" />
public function initialize(args);
initiatorAddNode()
<method name="initiatorAddNode" args="e, n" />
private function initiatorAddNode(e, n);
isProxied()
<method name="isProxied" />
private function isProxied();
__LZcallInit()
<method name="__LZcallInit" args="an" />
private function __LZcallInit(an);
__LZinstantiationDone()
<method name="__LZinstantiationDone" />
private function __LZinstantiationDone();
__LZmousedown()
<method name="__LZmousedown" />
private function __LZmousedown();
Sends onmousedown event
__LZmousemove()
<method name="__LZmousemove" />
private function __LZmousemove();
Sends onmousemove event
__LZmouseup()
<method name="__LZmouseup" />
private function __LZmouseup();
Sends onmouseup event
__makeSprite()
<method name="__makeSprite" args="args" />
private function __makeSprite(args);
Overridden to pass true for "isroot" to LzSprite constructor
okToInit()
<method name="okToInit" />
private function okToInit();
setDefaultContextMenu()
<method name="setDefaultContextMenu" args="cmenu" />
public function setDefaultContextMenu(cmenu : LzContextMenu);
LzView.setDefaultContextMenu Install default menu items for the right-mouse-button
setHeight()
<method name="setHeight" />
private function setHeight();
setResource()
<method name="setResource" />
private function setResource();
The canvas setResource function is redefined to throw an error when called.
setWidth()
<method name="setWidth" />
private function setWidth();
setX()
<method name="setX" />
private function setX();
setY()
<method name="setY" />
private function setY();
toString()
<method name="toString" />
private function toString();
updatePercentCreated()
<method name="updatePercentCreated" />
private function updatePercentCreated();
__windowResize()
<method name="__windowResize" args="size" />
private function __windowResize(size);
Callback for LzScreenKernel window resize events

Events (4)

onmousedown
<attribute name="onmousedown" />
public event onmousedown;
Sent whenever the mouse button goes down
onmousemove
<attribute name="onmousemove" />
public event onmousemove;
Sent whenever the mouse moves
onmouseup
<attribute name="onmouseup" />
public event onmouseup;
Sent whenever the mouse button goes up
onpercentcreated
<attribute name="onpercentcreated" />
public event onpercentcreated;
Sent whenever the number of created nodes changes

Prototype Properties (4)

hassetheight
<attribute name="hassetheight" />
private var hassetheight = true;
hassetwidth
<attribute name="hassetwidth" />
private var hassetwidth = true;
__LZcheckheight
<attribute name="__LZcheckheight" />
private var __LZcheckheight = null;
__LZcheckwidth
<attribute name="__LZcheckwidth" />
private var __LZcheckwidth = null;

LZX Synopsis

<class name="LzCanvas" extends=" LzView ">
  <method name=" versionInfoString " />
  <attribute name=" dataloadtimeout " type="numberExpression" />
  <attribute name=" datasets " type="object" />
  <attribute name=" initdelay " />
  <attribute name=" lpsrelease " type="string" />
  <attribute name=" lpsversion " type="number" />
  <attribute name=" __LZlfcversion " />
  <attribute name=" medialoadtimeout " type="numberExpression" />
  <attribute name=" nodeLevel " />
  <attribute name=" percentcreated " />
  <attribute name=" proxied " type="inheritableBooleanLiteral" value=""inherit"" />
  <attribute name=" version " type="string" value=""1.1"" />
  <method name=" compareVersion " args="ver, over" />
  <method name=" init " />
  <method name=" initDone " />
  <method name=" initialize " args="args" />
  <method name=" initiatorAddNode " args="e, n" />
  <method name=" isProxied " />
  <method name=" __LZcallInit " args="an" />
  <method name=" __LZinstantiationDone " />
  <method name=" __LZmousedown " />
  <method name=" __LZmousemove " />
  <method name=" __LZmouseup " />
  <method name=" __makeSprite " args="args" />
  <method name=" okToInit " />
  <event name=" onmousedown " />
  <event name=" onmousemove " />
  <event name=" onmouseup " />
  <event name=" onpercentcreated " />
  <method name=" setDefaultContextMenu " args="cmenu" />
  <method name=" setHeight " />
  <method name=" setResource " />
  <method name=" setWidth " />
  <method name=" setX " />
  <method name=" setY " />
  <method name=" toString " />
  <method name=" updatePercentCreated " />
  <method name=" __windowResize " args="size" />
</class>

JavaScript Synopsis

public LzCanvas extends  LzView  {
  static public function versionInfoString ();
  public var dataloadtimeout  : Number = 30000;
  public var datasets  : Object;
  public var initdelay  = 0.0;
  public final var lpsrelease  : String;
  public final var lpsversion  : Number;
  private var __LZlfcversion  = 0;
  public var medialoadtimeout  : Number = 30000;
  public var nodeLevel  = 0.0;
  public var percentcreated ;
  public var proxied  : Boolean;
  public var version  : Number;
  prototype public function compareVersion (ver, over);
  prototype private var hassetheight  = true;
  prototype private var hassetwidth  = true;
  prototype private function init ();
  prototype private function initDone ();
  prototype public function initialize (args);
  prototype private function initiatorAddNode (e, n);
  prototype private function isProxied ();
  prototype private function __LZcallInit (an);
  prototype private var __LZcheckheight  = null;
  prototype private var __LZcheckwidth  = null;
  prototype private function __LZinstantiationDone ();
  prototype private function __LZmousedown ();
  prototype private function __LZmousemove ();
  prototype private function __LZmouseup ();
  prototype private function __makeSprite (args);
  prototype private function okToInit ();
  prototype public event onmousedown ;
  prototype public event onmousemove ;
  prototype public event onmouseup ;
  prototype public event onpercentcreated ;
  prototype public function setDefaultContextMenu (cmenu : LzContextMenu);
  prototype private function setHeight ();
  prototype private function setResource ();
  prototype private function setWidth ();
  prototype private function setX ();
  prototype private function setY ();
  prototype private function toString ();
  prototype private function updatePercentCreated ();
  prototype private function __windowResize (size);
}