The view
is the most basic viewable element in an
OpenLaszlo application. Anything that is displayed on the canvas is a view
or extends the view class. A view is a rectangle, which can be visible or invisible, and which can contain other views or
display "resources" such as images,
.swf files, or other supported media. One view controls one
displayable resource. The view system is strictly hierarchical; that is, each view
has
a single parent but can have multiple children.
The following code shows one view nested inside another:
<canvas height="50" width="500"> <view width="50" height="50" bgcolor="red"> <view width="30" height="30" bgcolor="blue"/> </view> </canvas>
LzView
extends LzNode
,
which is the fundamental abstract class of LZX.
For more a gentle introduction to views please see the Laszlo tutorials, particularly Laszlo Basics and Understanding Views. For a more rigorous explanation of views see theDeveloper's Guide, particularly the views chapter.
Static Methods (3)
Initial Attributes (3)
Initial Attributes are given as attributes in LZX but are not generally available as properties in JavaScript.
onmouseupoutside
: Sent when the mouse button comes up outside a
view This event is only sent by views which are clickable
after it went down over the view. This event is only sent by views which
are clickable
onmousedragin
: Sent when the mouse button went down over the view
and the button is still down when mouse rolls back inside the view.
This event is only sent by views which are clickable
onmousedragout
: Sent when the mouse button went down over the view
and the button is still down when mouse rolls outside the view.
This event is only sent by views which are clickable
Properties (65)
simplelayout
is used. If the value of this attribute is a single
id, it is used as the axis attribute of a simplelayout.
Examples: axis: x
, class: constantlayout
;
axis: y
; axis: x; spacing: 5
.
resource
tag, a URL, or a pathname. If the value is a URL,
the resource is requested when the view is displayed. If it's a
pathname, the file named by the pathname is compiled into the
application, and attached to this view.
visible="a && b"
, if
a
is null, the value returned by the constraint expression will
be null -- not false.
Setters (31)
Setters for virtual properties, to be used with setAttribute. A setter may or may not have a corresponding getter method; consult the Methods list in this section.
fontstyle
and fontsize
too) these
properties cascade down the view hierarchy until a new value is
specified. When the font attributes are modified at runtime,
using JavaScript, the font is changed for the view itself, not
for any of its subviews.
Methods (96)
checkWidth
and checkHeight
functions handle changes in this view's
subviews. The children call these functions on their immediateparents when
they change x, y, width, height, or visibility. A view which doesn't care
about changes in the size of its contents (because it has a set size and it's
not stretching) puts null in this slot, so that it doesn't process calls from
its subviews.
N.B.: these internal methods do not obey the traditional camel-casing
because their names are often constructed on the fly. Cf.,
updateSize
o
. The dictionary has
the following possible keys:
o.ra: percentage alpha for red component (-100 to 100);
o.rb: offset for red component (-255 to 255);
o.ga: percentage alpha for green component (-100 to 100);
o.gb: offset for green component (-255 to 255);
o.ba: percentage alpha for blue component (-100 to 100);
o.bb: offset for blue component (-255 to 255);
o.aa: percentage overall alpha (-100 to 100);
o.ab: overall offset (-255 to 255);
Events (41)
Copyright © 2002-2007 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.