Name
canvas (LzCanvas) — The top-most view in a Laszlo application.
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).
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()
-
-
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();
-
__LZmousemove()
-
<method name="__LZmousemove" />
private function __LZmousemove();
-
__LZmouseup()
-
<method name="__LZmouseup" />
private function __LZmouseup();
-
__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()
-
-
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" />
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
">
<attribute name="
datasets
" type="
object" />
<attribute name="
proxied
" type="
inheritableBooleanLiteral" value="
"inherit"" />
<attribute name="
version
" type="
string" value="
"1.1"" />
</class>
JavaScript Synopsis
public
LzCanvas extends
LzView
{
prototype private function
init
();
prototype private function
setX
();
prototype private function
setY
();
}