[Laszlo-checkins] r8005 - in openlaszlo/branches/devildog: WEB-INF/lps/lfc/core WEB-INF/lps/lfc/helpers WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/lfc/views WEB-INF/lps/server/src/org/openlaszlo/compiler WEB-INF/lps/server/src/org/openlaszlo/sc demos/lzpix demos/lzpix/classes demos/lzpix/tests demos/lzpix/views test/swf9
hqm@openlaszlo.org
hqm at openlaszlo.org
Tue Feb 12 02:28:29 PST 2008
Author: hqm
Date: 2008-02-12 02:28:17 -0800 (Tue, 12 Feb 2008)
New Revision: 8005
Added:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.js
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
openlaszlo/branches/devildog/demos/lzpix/app.lzx
openlaszlo/branches/devildog/demos/lzpix/classes.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/clipboard.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/clipboardinterior.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/dataman.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/favorites.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/linkbutton.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/notes.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/photo.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/pivotlayout.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/search.lzx
openlaszlo/branches/devildog/demos/lzpix/classes/spinner.lzx
openlaszlo/branches/devildog/demos/lzpix/test-button.lzx
openlaszlo/branches/devildog/demos/lzpix/test-url.lzx
openlaszlo/branches/devildog/demos/lzpix/tests/pivoylayout-test.lzx
openlaszlo/branches/devildog/demos/lzpix/tests/test-auth.lzx
openlaszlo/branches/devildog/demos/lzpix/views/details.lzx
openlaszlo/branches/devildog/demos/lzpix/views/error.lzx
openlaszlo/branches/devildog/demos/lzpix/views/tools.lzx
openlaszlo/branches/devildog/test/swf9/hello.lzx
Log:
Change 20080212-hqm-v by hqm at badtzmaru.local on 2008-02-12 05:14:42 EST
in /Users/hqm/openlaszlo/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: misc progress, see details
New Features:
Bugs Fixed:
Technical Reviewer: max
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ porting of lzstate for swf9
+ improvements to debugger eval for swf9
+ make lzscript work for swf9
+ implement view.destroy for swf9
+ use defaultTextFormat for LzTextSprite formatting in swf9
+ remove handler warnings in lzpix
Tests:
swf8,dhtml smokecheck and test/lfc/data/alldata.lzx
lzpix
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-02-12 10:28:17 UTC (rev 8005)
@@ -31,17 +31,17 @@
* defaultplacement in lexical parent). See the
* <method>LzNode.determinePlacement</method> method. Defaults to false.
*/
-class LFCNode {
+public class LFCNode {
- var __LZdeferDelegates:Boolean = false;
- var _instanceAttrs:* = null;
- var _instanceChildren:* = null;
- var __LZisnew:* = null;
- var __LZstyleConstraints:* = null;
- var syncNew:* = null;
- var __LZdeferredcarr:* = null;
- var _events:* = null;
- var data:* = null;
+ var __LZdeferDelegates:Boolean = false;
+ var _instanceAttrs:* = null;
+ var _instanceChildren:* = null;
+ var __LZisnew:* = null;
+ var __LZstyleConstraints:* = null;
+ var syncNew:* = null;
+ var __LZdeferredcarr:* = null;
+ var _events:* = null;
+ var data:* = null;
//////////////////
@@ -303,55 +303,55 @@
* e.g. before a view displays, or before a layout affects its subviews.
* @lzxtype event
*/
-var oninit = LzDeclaredEvent;
+ var oninit = LzDeclaredEvent;
/** This is the first event a node sends, right
* at the end of the instantiation process, but before any subnodes
* have been created or references resolved
* @lzxtype event
*/
-var onconstruct = LzDeclaredEvent;
+ var onconstruct = LzDeclaredEvent;
/** The ondata script is executed when the data selected by a view's datapath
* changes.
* @lzxtype event
*/
-var ondata = LzDeclaredEvent;
+ var ondata = LzDeclaredEvent;
/**
* If replicated, the index of this clone
* @lzxtype event
* @access private
*/
-var clonenumber = null;
+ var clonenumber = null;
/**
* @access private
* @lzxtype event
*/
-var onclonenumber = LzDeclaredEvent;
+ var onclonenumber = LzDeclaredEvent;
/**
* @lzxtype event
* @access private
*/
-var ondestroy = LzDeclaredEvent;
+ var ondestroy = LzDeclaredEvent;
/** @access private */
-var __LZlateinit = null;
+ var __LZlateinit = null;
/** @access private */
-var __LZpreventSubInit = null;
+ var __LZpreventSubInit = null;
/** @access private */
-var __LZresolveDict = null;
+ var __LZresolveDict = null;
/** @access private */
-var __LZsourceLocation = null;
+ var __LZsourceLocation = null;
/** @access private */
-var __LZUID = null;
+ var __LZUID = null;
/** @access private */
-var __LZdelegates = null;
+ var __LZdelegates = null;
/** @access private */
static var defaultattrs:* = new LzInheritedHash({ $hasdefaultattrs : true });
-var defaultattrs;
+ var defaultattrs;
-var $hasdefaultattrs:*;
+ var $hasdefaultattrs:*;
/**
* Indicates that a <varname>node</varname>'s <method>init</method> method has been
@@ -364,7 +364,7 @@
* @see oninit
* @access private
*/
-var isinited = false;
+ var isinited = false;
/** An array of all of the LzNodes which consider
* this LzNode their parent. This list is similar to the subviews list,
@@ -374,7 +374,7 @@
* @type Array
* @keywords readonly
*/
-var subnodes = null;
+ var subnodes = null;
/** Specifies the data source for this node and its children.
* If the value begins with an identifier followed by a colon, the
@@ -388,7 +388,7 @@
* @lzxtype string
* @keywords readonly
*/
-var datapath = null;
+ var datapath = null;
/** The execution of a <class>node</class>'s <method>init</method> method and
* sending of the <event>oninit</event> event is under the control
@@ -415,11 +415,11 @@
* @lzxdefault "normal"
* @keywords final
*/
-var initstage = null;
+ var initstage = null;
/** @access private */
-var $isstate = false;
+ var $isstate = false;
/** @access private */
-var doneClassRoot = false;
+ var doneClassRoot = false;
/** Reference to the node that was passed as this
* node's ancestor in the constructor. If this node was created
@@ -429,17 +429,17 @@
* See also, immediateparent.
* @keywords readonly
*/
-var parent;
+ var parent;
/** @access private */
-var children = null;
+ var children = null;
/** If this node is replicated due to data
* replication, the LzReplicationManager which controls this node.
* @type LzNode
* @keywords readonly
*/
-var cloneManager = null;
+ var cloneManager = null;
/** The name for this subnode. If given, then this node's
* parent and immediate parent will store a pointer to this node as the
@@ -448,7 +448,7 @@
* @keywords final
* @lzxtype token
*/
-var name = null;
+ var name = null;
/** A unique identifier for this element. Can be used as a global
* variable name in JavaScript code.
@@ -458,7 +458,7 @@
* @keywords final
* @lzxtype token
*/
-var id = null;
+ var id = null;
/** An attribute used in container classes. If
* set to a non-null value, this forces this node to run its determinePlacement
@@ -475,7 +475,7 @@
* @lzxtype token
* @keywords final
*/
-var defaultplacement = null;
+ var defaultplacement = null;
/** Instructions to this element's container about where it should go
* within its container's internal hierarchy. See
@@ -484,13 +484,13 @@
* @lzxtype string
* @keywords final
*/
-var placement = null;
+ var placement = null;
// Initial values
/** @access private */
-var $cfn = 0;
+ var $cfn = 0;
/** @access private */
-var __LZdeleted = false;
+ var __LZdeleted = false;
/** Reference to this nodes's parent
* in the node hierarchy. This will be different from "parent"
@@ -501,10 +501,10 @@
* @type LzNode
* @keywords readonly
*/
-var immediateparent:LFCNode = null;
+ var immediateparent:LFCNode = null;
/** @access private */
-var dependencies = null;
+ var dependencies = null;
/** A reference to the node that is an instance
* of the <code><class></code> where this node is defined.
@@ -518,19 +518,19 @@
* @type LzNode
* @keywords readonly
*/
-var classroot;
+ var classroot;
/** The depth of this node in the overall node hierarchy
* @type Number
* @keywords readonly
*/
-var nodeLevel;
+ var nodeLevel;
if ($debug) {
/** The source locator table maps source locations to nodes
* @access private
*/
- var sourceLocatorTable = {};
+ var sourceLocatorTable = {};
/**
* Translate a source locator to the corresponding node
@@ -680,7 +680,7 @@
static var nodecount = 0;
function construct ( parent , args ){
- trace("LFCNode.construct", nodecount++, parent, lzutils.objAsString(args));
+ //trace("LFCNode.construct", nodecount++, parent, lzutils.objAsString(args));
if (parent == null) {
//trace("LFCNode construct parent == null, args=", lzutils.objAsString(args));
}
@@ -1142,7 +1142,7 @@
// TODO [hqm 2008-01] enable this warning unconditionally for now for swf9 debugging
// if ($debug) {
if ((! x) || (! (x is Class))) {
- trace('Class for tag ', e.name, ' has not been defined yet', x);
+ Debug.error('Class for tag ', e.name, ' has not been defined yet', x);
}
//}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.js 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.js 2008-02-12 10:28:17 UTC (rev 8005)
@@ -81,9 +81,9 @@
static var __LZdelayedSetters:* = new LzInheritedHash(LzNode.__LZdelayedSetters);
static var earlySetters:* = new LzInheritedHash(LzNode.earlySetters);
- var __LZpool = [];
- var __LZstatedelegates;
- var collectArgs:Boolean = true;
+ var __LZpool = [];
+ var __LZstatedelegates;
+ var collectArgs:Boolean = true;
public function LzState ( parent:* , attrs:* , children:* = null, instcall:* = null) {
super(parent,attrs,children,instcall);
@@ -99,12 +99,12 @@
/** Sent when the state is applied.
* @lzxtype event
*/
-var onapply = LzDeclaredEvent;
+ var onapply = LzDeclaredEvent;
/** Sent when the state is removed
* @lzxtype event
*/
-var onremove = LzDeclaredEvent;
+ var onremove = LzDeclaredEvent;
/** <code>setAttribute('apply', true)</code> will
* apply the state. <code>setAttribute('apply', false)</code> will
@@ -124,12 +124,12 @@
*/
setters.apply = "setApply";
setters.$setters = null;
-static var staterefs = { apply : true };
-static var stateevents = { onremove : true , onapply : true };
+ static var staterefs = { apply : true };
+ static var stateevents = { onremove : true , onapply : true };
prototype.$isstate = true; // Defined in LzNode
-var asyncnew = false;
-var subh = null;
-var pooling = false;
+ var asyncnew = false;
+ var subh = null;
+ var pooling = false;
setters.asyncnew = "__LZsetProperty";
/** If true, the state will merely hide any views it has created
@@ -204,8 +204,6 @@
* has no effect
*/
function apply ( ){
- trace ('calling apply', this);
- return;
//@field Boolean isapplied: true if the state is currently applied
if ( this.isapplied ){
return;
@@ -217,7 +215,6 @@
var od = this.parent.__LZdelegates;
this.parent.__LZdelegates = null;
- trace ('...parent.__LZapplyArgs', lzutils.objAsString(this.heldArgs));
this.parent.__LZapplyArgs( this.heldArgs );
if (this.subh) var shl = this.subh.length;
@@ -248,7 +245,6 @@
* were changed by the state
*/
function remove () {
- trace('calling remove', this);
if ( !this.isapplied ){
return;
}
@@ -256,7 +252,6 @@
if (this.onremove.ready) this.onremove.sendEvent( this );
this.isapplied = false;
- trace('....calling remove unregistering delegates', lzutils.objAsString(this.__LZstatedelegates));
if (this.__LZstatedelegates) {
for ( var i = 0; i < this.__LZstatedelegates.length; i++ ){
this.__LZstatedelegates[ i ].unregisterAll();
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/DebugExec.as 2008-02-12 10:28:17 UTC (rev 8005)
@@ -13,6 +13,14 @@
#passthrough (toplevel:true) {
import flash.display.*;
+ import flash.events.*;
+ import flash.utils.*;
+ import flash.text.*;
+ import flash.system.*;
+ import flash.net.*;
+ import flash.ui.*;
+ import flash.text.Font;
+ import flash.display.*;
}#
public function DebugExec () {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as 2008-02-12 10:28:17 UTC (rev 8005)
@@ -22,6 +22,7 @@
import flash.system.*;
import flash.net.*;
import flash.ui.*;
+ import flash.text.Font;
}#
@@ -63,7 +64,7 @@
tfield.wordWrap = true;
tfield.multiline = true;
tfield.width = 800;
- tfield.height = 100;
+ tfield.height = 160;
tfield.border = true;
consoletext = tfield;
@@ -72,7 +73,7 @@
ci.background = true;
ci.backgroundColor = 0xffcccc;
ci.x = 0;
- ci.y = 500;
+ ci.y = 560;
ci.wordWrap = false;
ci.multiline = false;
ci.width = 800;
@@ -81,14 +82,22 @@
ci.type = TextFieldType.INPUT;
ci.addEventListener(KeyboardEvent.KEY_DOWN, consoleInputHandler);
+
+ /* var allFonts:Array = Font.enumerateFonts(true);
+ allFonts.sortOn("fontName", Array.CASEINSENSITIVE);
+
+ var embeddedFonts:Array = Font.enumerateFonts(false);
+ embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
+
+ */
+
+
var newFormat:TextFormat = new TextFormat();
- newFormat.size = 14;
- newFormat.font = "sans-serif";
- ci.setTextFormat(newFormat);
- consoletext.setTextFormat(newFormat);
+ newFormat.size = 11;
+ newFormat.font = "Verdana";
+ ci.defaultTextFormat = newFormat;
+ consoletext.defaultTextFormat = newFormat;
-
-
////////////////////////////////////////////////////////////////
@@ -102,11 +111,12 @@
// Debugger loader completion handler
function debugEvalListener (e:Event):void {
- trace("init dbg loader loaded, executing doit()");
debugloader.unload();
//DebugExec(e.target.content).doit();
}
+ static var DEBUG_LPS_SERVER_PATH:String = "http://127.0.0.1:8080/devildog/";
+
function consoleInputHandler (event:KeyboardEvent ){
if (event.charCode == Keyboard.ENTER) {
var expr = consoleinputtext.text;
@@ -117,8 +127,9 @@
debugloader.contentLoaderInfo.addEventListener(Event.INIT, debugEvalListener);
// Send EVAL request to LPS server
- var url = "hello.lzx?lzr=swf9&lz_load=false&lzt=eval&lz_script=" + encodeURIComponent(expr)+"&lzbc=" +(new Date()).getTime();
- trace('requesting from '+url);
+ // It doesn't matter what path/filename we use, as long as it has ".lzx" suffix, so it is
+ // handled by the LPS. The lzt=eval causes the request to be served by the EVAL Responder.
+ var url = DEBUG_LPS_SERVER_PATH + "hello.lzx?lzr=swf9&lz_load=false&lzt=eval&lz_script=" + encodeURIComponent(expr)+"&lzbc=" +(new Date()).getTime();
debugloader.load(new URLRequest(url),
new LoaderContext(false,
new ApplicationDomain(ApplicationDomain.currentDomain)));
@@ -132,7 +143,7 @@
public var consoleinputtext:TextField;
public function write (...args) {
- consoletext.appendText( "\n" + args.join(","));
+ consoletext.appendText( "\n" + args.join(" "));
consoletext.scrollV = consoletext.maxScrollV;
}
////////////////////////////////////////////////////////////////
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as 2008-02-12 10:28:17 UTC (rev 8005)
@@ -95,6 +95,11 @@
//trace('addChildSprite ', sprite, 'added to ' ,this.owner);
}
+
+ public function predestroy(){
+ this.bringToFront();
+ }
+
public function draw():void {
if (this.bgColor != null){
this.graphics.clear();
@@ -190,14 +195,9 @@
this.resourceURL = url;
imgLoader = new Loader();
this.addChildAt(imgLoader, IMGDEPTH);
- var cl:LoaderInfo = imgLoader.contentLoaderInfo;
- cl.addEventListener(HTTPStatusEvent.HTTP_STATUS, loaderEventHandler);
- cl.addEventListener(IOErrorEvent.IO_ERROR, loaderEventHandler);
- cl.addEventListener(Event.COMPLETE, loaderEventHandler);
- cl.addEventListener(Event.INIT, loaderInitHandler);
-
- // These can only be listened for after init?
-
+ var info:LoaderInfo = imgLoader.contentLoaderInfo;
+ info.addEventListener(Event.INIT, loaderInitHandler);
+ info.addEventListener(IOErrorEvent.IO_ERROR, loaderEventHandler);
imgLoader.load(new URLRequest(url));
}
@@ -205,11 +205,15 @@
public function loaderInitHandler(event:Event):void {
// These progress event listeners can only be installed after the init event
// has been received. You get an error if you try to add them before this.
- var loader:Loader = Loader(event.target.loader);
- var info:LoaderInfo = LoaderInfo(loader.contentLoaderInfo);
- info.addEventListener(flash.events.ProgressEvent.PROGRESS, loaderEventHandler);
- info.addEventListener(Event.OPEN, loaderEventHandler);
- info.addEventListener(Event.UNLOAD, loaderEventHandler);
+ var loader:Loader = Loader(event.target.loader);
+ var info:LoaderInfo = LoaderInfo(loader.contentLoaderInfo);
+ info.addEventListener(ProgressEvent.PROGRESS, loaderEventHandler);
+ info.addEventListener(Event.OPEN, loaderEventHandler);
+ info.addEventListener(Event.UNLOAD, loaderEventHandler);
+ info.addEventListener(Event.COMPLETE, loaderEventHandler);
+ info.addEventListener(HTTPStatusEvent.HTTP_STATUS, loaderEventHandler);
+
+
// trace(event);
}
@@ -446,6 +450,7 @@
o Sets the opacity of the sprite
*/
public function setOpacity( o:Number ):void {
+ // TODO [hqm 2008-02] Do we need to do something special for opacity zero?
this.opacity = this.alpha = o;
}
@@ -548,8 +553,8 @@
o Causes the sprite to destroy itself
o if recursive is true, the sprite destroys all its children as well
*/
- public function destroy( recursive:Boolean ):void {
- // parent.removeChild(this);
+ public function destroy( ):void {
+ parent.removeChild(this);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as 2008-02-12 10:28:17 UTC (rev 8005)
@@ -42,7 +42,6 @@
public var multiline:Boolean = false;
public var underline:Boolean = false;
public var closeformat:String;
- public var format:String;
public var sizeToHeight:Boolean = false;
public var password:Boolean = false;
@@ -240,15 +239,14 @@
*/
public function setText ( t:String ):void {
//this.textfield.cacheAsBitmap = false;
- if (typeof(t) == 'undefined' || t == 'null') {
+ if (t == null || typeof(t) == 'undefined' || t == 'null') {
t = "";
} else if (typeof(t) != "string") {
t = t.toString();
}
this.text = t;// this.format + t + this.closeformat if proper measurement were working
- this.textfield.htmlText = this.format + t + this.closeformat;
- //trace('setting textfield.htmlText', this.textfield.htmlText);
+ this.textfield.htmlText = t;
if (this.resize && (this.multiline == false)) {
// single line resizable fields adjust their width to match the text
@@ -283,11 +281,10 @@
// trace("__setFormat this.font=", this.font, 'this.fontname = ',this.fontname,
//'cfontname=', cfontname);
- // TODO [make this work when font manager is implemented]
- this.format ="<FONT FACE=\"" + (this.font == null ? cfontname : this.font.name) +
- "\" SIZE=\"" + this.fontsize + "\" " +
- "COLOR=\"" + this.colorstring + "\" >";
- this.closeformat = "</FONT>";
+ var tf:TextFormat = new TextFormat();
+ tf.size = this.fontsize;
+ tf.font = (this.font == null ? cfontname : this.font.name);
+ tf.color = this.colorstring;
// If there is no font found, assume a device font
if (this.font == null) {
@@ -296,20 +293,19 @@
this.textfield.embedFonts = true;
}
-
if (this.fontstyle == "bold" || this.fontstyle =="bolditalic"){
- this.format += "<B>";
- this.closeformat = "</B>" + this.closeformat;
+ tf.bold = true;
}
if (this.fontstyle == "italic" || this.fontstyle =="bolditalic"){
- this.format += "<I>";
- this.closeformat = "</I>" + this.closeformat;
+ tf.italic = true;
}
if (this.underline){
- this.format += "<U>";
- this.closeformat = "</U>" + this.closeformat;
+ tf.underline = true;
}
+
+ this.textfield.defaultTextFormat = tf;
+
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js 2008-02-12 10:28:17 UTC (rev 8005)
@@ -11,7 +11,7 @@
*/
-class LFCView extends LFCNode {
+public class LFCView extends LFCNode {
static var getters = new LzInheritedHash(LFCNode.getters);
static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
@@ -28,50 +28,50 @@
super(parent,attrs,children,instcall);
}
- var animators:*;
- var _height;
- var _width;
- var _y;
- var _x;
- var _resource;
- var __LZhaser;
+ var animators:*;
+ var _height;
+ var _width;
+ var _y;
+ var _x;
+ var _resource;
+ var __LZhaser;
-var onaddsubview = LzDeclaredEvent;
+ var onaddsubview = LzDeclaredEvent;
/** @access private */
-var onbgcolor = LzDeclaredEvent;
+ var onbgcolor = LzDeclaredEvent;
/** The onblur script is executed when an element loses focus either
* by the pointing device or by tabbing navigation.
* @lzxtype event
*/
-var onblur = LzDeclaredEvent;
+ var onblur = LzDeclaredEvent;
/** The onclick script is executed when the pointing device button is
* clicked over an element.
* @lzxtype event
*/
-var onclick = LzDeclaredEvent;
+ var onclick = LzDeclaredEvent;
/** @access private */
-var onclickable = LzDeclaredEvent;
+ var onclickable = LzDeclaredEvent;
/** The onfocus script is executed when an element receives focus
* either by the pointing device or by tabbing navigation.
* @lzxtype event
*/
-var onfocus = LzDeclaredEvent; // From LzFocus
+ var onfocus = LzDeclaredEvent; // From LzFocus
/** @lzxtype event */
-var onframe = LzDeclaredEvent;
+ var onframe = LzDeclaredEvent;
/** Event for changes to view's <attribute>height</attribute> property
* @lzxtype event
*/
-var onheight = LzDeclaredEvent;
+ var onheight = LzDeclaredEvent;
/** @lzxtype event */
-var onimload = LzDeclaredEvent;
+ var onimload = LzDeclaredEvent;
/** The onkeyup script is executed when this view has the focus and a
* key is released. This event is sent with the keycode for the key that
* went up.
* @lzxtype event
*/
-var onkeyup = LzDeclaredEvent; // From LzFocus
+ var onkeyup = LzDeclaredEvent; // From LzFocus
/** The onkeydown script is executed when this view has the focus and
* a key is pressed down. Multiple key down events are sent for a
@@ -80,142 +80,142 @@
* down.
* @lzxtype event
*/
-var onkeydown = LzDeclaredEvent; // From LzFocus
+ var onkeydown = LzDeclaredEvent; // From LzFocus
/** @lzxtype event */
-var onlastframe = LzDeclaredEvent;
+ var onlastframe = LzDeclaredEvent;
/** @lzxtype event */
-var onload = LzDeclaredEvent;
+ var onload = LzDeclaredEvent;
/** @lzxtype event */
-var onloadperc = LzDeclaredEvent;
+ var onloadperc = LzDeclaredEvent;
/** <event>onerror</event>: Sent when there is an error loading the view's resource.
* The argument sent with the event is the error string sent by the server.
* @access private
* @lzxtype event
*/
-var onerror = LzDeclaredEvent;
+ var onerror = LzDeclaredEvent;
/**
* <event>ontimeout</event>: Sent when the request to load media for the view times
* out
* @lzxtype event
*/
-var ontimeout = LzDeclaredEvent;
+ var ontimeout = LzDeclaredEvent;
/** The onmousedown script is executed when the pointing device button is
* pressed over an element.
* @lzxtype event
*/
-var onmousedown = LzDeclaredEvent;
+ var onmousedown = LzDeclaredEvent;
-var onmousemove = LzDeclaredEvent;
+ var onmousemove = LzDeclaredEvent;
/** The onmouseout script is executed when the point device is moved
* so that is is no longer over an element.
* @lzxtype event
*/
-var onmouseout = LzDeclaredEvent;
+ var onmouseout = LzDeclaredEvent;
/** The onmouseover script is executed when the pointing device is
* moved onto an element.
* @lzxtype event
*/
-var onmouseover = LzDeclaredEvent;
+ var onmouseover = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onmousetrackover = LzDeclaredEvent;
+ var onmousetrackover = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onmousetrackup = LzDeclaredEvent;
+ var onmousetrackup = LzDeclaredEvent;
/** The onmouseup script is executed when the pointing device button is
* released over an element.
* @lzxtype event
*/
-var onmouseup = LzDeclaredEvent;
+ var onmouseup = LzDeclaredEvent;
/**
* Sent when a view changes its opacity
* @lzxtype event
*/
-var onopacity = LzDeclaredEvent;
+ var onopacity = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onplay = LzDeclaredEvent;
+ var onplay = LzDeclaredEvent;
/**
* Event called when this view removes a subview
* @lzxtype event
*/
-var onremovesubview = LzDeclaredEvent;
+ var onremovesubview = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onresource = LzDeclaredEvent;
+ var onresource = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onresourceheight = LzDeclaredEvent;
+ var onresourceheight = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onresourcewidth = LzDeclaredEvent;
+ var onresourcewidth = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onrotation = LzDeclaredEvent;
+ var onrotation = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onstop = LzDeclaredEvent;
+ var onstop = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var ontotalframes = LzDeclaredEvent;
+ var ontotalframes = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onunstretchedheight = LzDeclaredEvent;
+ var onunstretchedheight = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onunstretchedwidth = LzDeclaredEvent;
+ var onunstretchedwidth = LzDeclaredEvent;
/** @lzxtype event */
-var onvisible = LzDeclaredEvent;
+ var onvisible = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onvisibility = LzDeclaredEvent;
+ var onvisibility = LzDeclaredEvent;
/** event for changes to view's <attribute>width</attribute> property
* @lzxtype event
*/
-var onwidth = LzDeclaredEvent;
+ var onwidth = LzDeclaredEvent;
/** event for changes to view's <attribute>x</attribute> property
* @lzxtype event
*/
-var onx = LzDeclaredEvent;
+ var onx = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onxoffset = LzDeclaredEvent;
+ var onxoffset = LzDeclaredEvent;
/** event for changes to view's <attribute>y</attribute> property
* @lzxtype event
*/
-var ony = LzDeclaredEvent;
+ var ony = LzDeclaredEvent;
/** @access private
* @lzxtype event
*/
-var onyoffset = LzDeclaredEvent;
+ var onyoffset = LzDeclaredEvent;
/**
* The ondblclick script is executed when the pointing device button
@@ -229,12 +229,12 @@
* DOUBLE_CLICK_TIME attribute
* @lzxtype event
*/
-var ondblclick = LzDeclaredEvent;
+ var ondblclick = LzDeclaredEvent;
/** @access private */
-var DOUBLE_CLICK_TIME = 500;
+ var DOUBLE_CLICK_TIME = 500;
/** @access private */
-var capabilities = LzSprite.capabilities;
+ var capabilities = LzSprite.capabilities;
/**
@@ -374,7 +374,7 @@
* @type LzView
* @keywords readonly
*/
-var mask;
+ var mask;
/** If true, this view will receive focus events.
* See focus manager (LzFocus) for more details.
@@ -382,20 +382,20 @@
* @lzxtype boolean
* @keywords readonly
*/
-public var focusable = false;
+ var focusable = false;
/** If true, this view "traps" the focus, for example in a window or dialog.
* See focus manager (LzFocus) for more details.
* @lzxtype boolean
*/
-var focustrap;
+ var focustrap;
/** Clip the view's contents to its size.
* @lzxtype boolean
* @lzxdefault "false"
* @keywords final
*/
-var clip = false;
+ var clip = false;
LFCView.setters.rotation= "setRotation";
@@ -411,7 +411,7 @@
* @lzxdefault "left"
* @keywords final
*/
-var align = "left"
+ var align = "left"
LFCView.setters.align = "setAlign"
/**
@@ -421,7 +421,7 @@
* @lzxtype "top" | "middle" | "bottom" | constraint
* @lzxdefault "top"
*/
-var valign = "top"
+ var valign = "top"
LFCView.setters.valign = "setValign"
/** The URL from which to load the resource for this
@@ -431,7 +431,7 @@
* @lzxtype expression
* @access private
*/
-var source;
+ var source;
/**
* As a setter, this is private. It's not really a setter, because
* it talks to a private attribute, "source".
@@ -464,7 +464,7 @@
* @access public
* @lzxtype string
*/
-var clickregion;
+ var clickregion;
LFCView.setters.clickregion = "__LZsetClickRegion";
/** The cursor to display when the mouse is over this view. Any
* resource can be used as a cursor. This attribute can be set for
@@ -472,14 +472,14 @@
* clickable to true.
* @lzxtype token
*/
-var cursor;
+ var cursor;
LFCView.setters.cursor = "setCursor";
/** A color to use to render object that appears inside this view,
* which includes any vector or bitmap art in the view's resource
* and any contained views.
* @lzxtype color
*/
-var fgcolor;
+ var fgcolor;
LFCView.setters.fgcolor = "setColor";
/** The font to use for any @c{<text>} or @c{<inputtext>} elements that
* appear inside this view. Like all the font properties
@@ -490,20 +490,20 @@
* for any of its subviews.
* @lzxtype string
*/
-var font;
+ var font;
LFCView.setters.font = "setFontName" ;
/** The style to use to render text fields that appear inside of
* this view. One of "plain", "bold" , "italic" or "bolditalic".
* @lzxtype string
*/
-var fontstyle;
+ var fontstyle;
/** Pixel size to use to render text which appears inside this
* view. The default is 8.
* @lzxtype size
*/
-var fontsize;
+ var fontsize;
/**
* Setting <code>stretches</code> causes a view to change its
@@ -514,7 +514,7 @@
* @lzxtype "width" | "height" | "both"
* @lzxdefault "none"
*/
-var stretches = "none";
+ var stretches = "none";
LFCView.setters.stretches = "stretchResource";
/** If true, the resource attached to this view begins playing when
* the view is instantiated.
@@ -524,38 +524,38 @@
/** Show or hide the handcursor for this view, if clickable */
LFCView.setters.showhandcursor = "setShowHandCursor";
-var layout;
+ var layout;
LFCView.setters.layout = "setLayout";
/** Activate/inactivate children for accessibility
* @type Boolean
* @lzxtype boolean
*/
-var aaactive;
+ var aaactive;
LFCView.setters.aaactive = "setAAActive";
/** Set accessibility name
* @type String
* @lzxtype string
*/
-var aaname;
+ var aaname;
LFCView.setters.aaname = "setAAName";
/** Set accessibility description
* @type String
* @lzxtype string
*/
-var aadescription;
+ var aadescription;
LFCView.setters.aadescription = "setAADescription";
/** Set accessibility tab order
* @type Number
* @lzxtype number
*/
-var aatabindex;
+ var aatabindex;
LFCView.setters.aatabindex = "setAATabIndex";
/** Set accessibility silencing/unsilencing
* @type Boolean
* @lzxtype boolean
*/
-var aasilent;
+ var aasilent;
LFCView.setters.aasilent = "setAASilent";
LFCView.__LZdelayedSetters.layout = "setLayout";
@@ -581,7 +581,7 @@
LFCView.setters.yoffset = "setYOffset";
/** @access private */
-var sprite:LzSprite = null;
+ var sprite:LzSprite = null;
/** A value of true means that this view is shown. A
* value of false means that this view is hidden.
@@ -591,7 +591,7 @@
* @lzxtype boolean
* @lzxdefault "true"
*/
-var visible = true;
+ var visible = true;
/** A value of "visible" means that this view is shown. A
* value of "hidden" means that this view is hidden. Setting this attribute to "collapse"
@@ -604,14 +604,14 @@
* @lzxdefault "collapse"
* @access private
*/
-var visibility = "collapse";
+ var visibility = "collapse";
/** @access private */
-var __LZvizO = true;
+ var __LZvizO = true;
/** @access private */
-var __LZvizDat = true;
+ var __LZvizDat = true;
/** @access private */
-var __LZvizLoad= true;
+ var __LZvizLoad= true;
/**
* The opacity of the view's contents. @c{1.0} is opaque; @c{0.0} is
@@ -619,33 +619,33 @@
* @lzxtype opacity
* @lzxdefault "1.0"
*/
-var opacity = 1;
+ var opacity = 1;
/** The color of background of this view. Null if there is
* no bgcolor. A number from 0 - 0xFFFFFF.
* @lzxtype color
*/
-var bgcolor = null;
+ var bgcolor = null;
/** The horizontal offset of this view's upper left corner from the
* upper left corner of its container.
* @type Number
* @lzxtype numberExpression
* @lzxdefault "0"
*/
-var x = 0;
+ var x = 0;
/** The vertical offset of this view's upper left corner from the
* upper left corner of its container
* @type Number
* @lzxtype numberExpression
* @lzxdefault "0"
*/
-var y = 0;
+ var y = 0;
/** The rotation value for the view (in degrees).
* Value may be less than zero or greater than 360.
* @type Number
* @lzxtype numberExpression
* @lzxdefault "0"
*/
-var rotation:Number = 0;
+ var rotation:Number = 0;
/**
* The width of the view
@@ -653,7 +653,7 @@
* @type Number
* @lzxtype sizeExpression
*/
-var width:Number = 0;
+ var width:Number = 0;
LFCView.setters.width = "setWidth";
/**
@@ -662,7 +662,7 @@
* @type Number
* @lzxtype sizeExpression
*/
-var height:Number = 0;
+ var height:Number = 0;
LFCView.setters.height = "setHeight";
/** If stretches is not set to none, the width
@@ -672,7 +672,7 @@
* @type Number
* @keywords readonly
*/
-var unstretchedwidth = 0;
+ var unstretchedwidth = 0;
/** If stretches is not set to none, the height
* that this view would be if it weren't stretched. This attribute can be used
* to scale a view by a percentage of its original size, or to determine the
@@ -680,14 +680,14 @@
* @type Number
* @keywords readonly
*/
-var unstretchedheight = 0;
+ var unstretchedheight = 0;
/** An array of the subviews that are children of this
* view. This is initialized to an empty array for views that have no subviews.
* @keywords readonly
*/
-var subviews = [];
+ var subviews = [];
/** @access private */
-var __LZclickregion = "LzMouseEvents";
+ var __LZclickregion = "LzMouseEvents";
/**
* Specifies a translation point for drawing of this view. If the xoffset
@@ -696,7 +696,7 @@
* @lzxtype numberExpression
* @lzxdefault "0"
*/
-var xoffset = 0;
+ var xoffset = 0;
/**
* Specifies a translation point for drawing of this view. If the yoffset
* is set, then rotation and y position will be calculated by first adding
@@ -704,24 +704,24 @@
* @lzxtype numberExpression
* @lzxdefault "0"
*/
-var yoffset = 0;
+ var yoffset = 0;
/** @access private */
-var __LZrsin = 0;
+ var __LZrsin = 0;
/** @access private */
-var __LZrcos = 1;
+ var __LZrcos = 1;
/** @access private */
-var __LZcaloffset = false;
+ var __LZcaloffset = false;
/** @access private */
-var _xscale = 1;
+ var _xscale = 1;
/** @access private */
-var _yscale = 1;
+ var _yscale = 1;
/** The total number of frames for this view's resource.
* @type Number
* @keywords readonly
*/
-var totalframes = 0;
+ var totalframes = 0;
/** If this view has a multi-frame resource, this allows setting which
* resource frame is displayed. Defaults to the first frame (1).
* @lzxtype numberExpression
@@ -735,45 +735,45 @@
* can save CPU usage in cases where the application doesn't need to
* know what frame the resource is showing while it is playing.
*/
-var frame = 0;
+ var frame = 0;
LFCView.setters.frame = "setResourceNumber";
/** @keywords deprecated
* @access private
*/
-var loadperc = 0;
+ var loadperc = 0;
/** For views whose resource is loaded at runtime,
* the ratio of the loaded frames to the total frames. This is a number between
* zero and 1.
* @type Number
* @keywords readonly
*/
-var framesloadratio = 0;
+ var framesloadratio = 0;
/** For views whose resource is loaded at runtime,
* ratio of the loaded bytes to the total bytes. This is a number between
* zero and 1.
* @type Number
* @keywords readonly
*/
-var loadratio = 0;
+ var loadratio = 0;
/** If true, then setWidth() has been called on this
* view, and the view will not be sized to its contents.
* @type Boolean
* @keywords readonly
*/
-var hassetheight = false;
+ var hassetheight = false;
/** If true, then setHeight() has been called on this
* view, and the view will not be sized to its contents.
* @type Boolean
* @keywords readonly
*/
-var hassetwidth = false;
+ var hassetwidth = false;
/** need quick check for viewness
* @access private
*/
-var __LZisView = true;
+ var __LZisView = true;
//
// field selected: Setting this attribute calls the abstract method
@@ -783,11 +783,11 @@
//
//============================================================================
/** @access private */
-var addedToParent = null;
+ var addedToParent = null;
/** @access private */
-var checkPlayStatusDel = null;
+ var checkPlayStatusDel = null;
/** @access private */
-var masked = false;
+ var masked = false;
/**
* The view system supports sub-pixel positioning to enable smooth
@@ -796,18 +796,18 @@
* @lzxtype booleanLiteral
* @modifiers final
*/
-var pixellock = null;
+ var pixellock = null;
/** @access private */
-var setButtonSize = null;
+ var setButtonSize = null;
-var clickable = false;
+ var clickable = false;
/** Show or hide the hand cursor for this view, if clickable
* @lzxtype boolean
*/
-var showhandcursor = null;
+ var showhandcursor = null;
/** @access private */
-var updatePlayDel = null;
+ var updatePlayDel = null;
/**
* A resource that is presented in the background of this view. The
* value can be either the name of a resource defined with the
@@ -817,29 +817,22 @@
* application, and attached to this view.
* @lzxtype string
*/
-var resource = null;
+ var resource = null;
/**
* @keywords readonly
*/
-var resourcewidth = null;
+ var resourcewidth = null;
/**
* @keywords readonly
*/
-var resourceheight = null;
+ var resourceheight = null;
-/** @access private */ var __LZbgColorO = null;
-/** @access private */ var __LZbgRef = null;
-/** @access private */ var __LZbuttonRef = null;
-/** @access private */ var __LZcheckwidth = true;
-/** @access private */ var __LZcheckheight = true;
-/** @access private */ var __LZhasoffset = null;
-/** @access private */ var __LZisBackgrounded = null;
-/** @access private */ var __LZmaskClip = null;
-/** @access private */ var __LZmovieClipRef = null;
-/** @access private */ var __LZoutlieheight = null;
-/** @access private */ var __LZoutliewidth = null;
-/** @access private */ var __LZsubUniqueNum = null;
+ /** @access private */ var __LZcheckwidth = true;
+ /** @access private */ var __LZcheckheight = true;
+ /** @access private */ var __LZhasoffset = null;
+ /** @access private */ var __LZoutlieheight = null;
+ /** @access private */ var __LZoutliewidth = null;
/**
* this creates a specific child layout for this view. When called a second time
@@ -872,7 +865,7 @@
* @type Boolean
* @access private
*/
-var _setrescwidth = false;
+ var _setrescwidth = false;
/** If true, the view does not set its
* resource to the height given in a call to
* <method>setAttribute</method>. By default, views do not scale their
@@ -880,7 +873,7 @@
* @type Boolean
* @access private
*/
-var _setrescheight = false;
+ var _setrescheight = false;
/**
* Search all subviews for a named property. For now, returns when it finds the
@@ -907,7 +900,7 @@
* @type Object
* @lzxtype css
*/
-var layouts = null;
+ var layouts = null;
/**
@@ -955,25 +948,80 @@
* Called by sprites when the resource has been loaded to send the
* appropriate events
*/
- function resourceload(i) { }
+function resourceload(i) {
+ if ('resource' in i) {
+ this.resource = i.resource;
+ if (this.onresource.ready) this.onresource.sendEvent(i.resource);
+ }
+ if (this.resourcewidth != i.width) {
+ if ('width' in i) {
+ this.resourcewidth = i.width;
+ if (this.onresourcewidth.ready) this.onresourcewidth.sendEvent(i.width);
+ }
+
+ //if no setwidth, then the view is sized to the resource
+ if ( (!this.hassetwidth && this.resourcewidth != this.width ) ||
+ (this._setrescwidth && this.unstretchedwidth !=
+ this.resourcewidth)){
+ this.updateWidth( this.resourcewidth );
+ }
+ }
+
+ if (this.resourceheight != i.height) {
+ if ('height' in i) {
+ this.resourceheight = i.height;
+ if (this.onresourceheight.ready) this.onresourceheight.sendEvent(i.height);
+ }
+
+ if ( (!this.hassetheight && this.resourceheight != this.height ) ||
+ (this._setrescheight && this.unstretchedheight != this.resourceheight)){
+ this.updateHeight( this.resourceheight );
+ }
+ }
+
+ if (i.skiponload != true) {
+ if (this.onload.ready) this.onload.sendEvent(this);
+ }
+}
+
+
+
/**
* @access private
* Called by the sprite when the resource load error occurs
*/
- function resourceloaderror() { }
+function resourceloaderror() {
+ this.resourcewidth = 0;
+ this.resourceheight = 0;
+ if (this.onresourcewidth.ready) this.onresourcewidth.sendEvent(0);
+ if (this.onresourceheight.ready) this.onresourceheight.sendEvent(0);
+ this.reevaluateSize();
+ if (this.onerror.ready) this.onerror.sendEvent();
+}
/**
* @access private
* Called by the sprite when the resource load timeout occurs
*/
- function resourceloadtimeout() { }
+function resourceloadtimeout() {
+ this.resourcewidth = 0;
+ this.resourceheight = 0;
+ if (this.onresourcewidth.ready) this.onresourcewidth.sendEvent(0);
+ if (this.onresourceheight.ready) this.onresourceheight.sendEvent(0);
+ this.reevaluateSize();
+ if (this.ontimeout.ready) this.ontimeout.sendEvent();
+}
/**
* @access private
* Called by the sprite when the resource playback events occur
*/
- function resourceevent(name, value, eventonly) { }
+function resourceevent(name, value, eventonly) {
+ if (eventonly != true) this[name] = value;
+ var ev = this['on'+ name];
+ if (ev.ready) ev.sendEvent(value);
+}
/**
* This method is called to set the number of total frames in the resource.
@@ -989,14 +1037,60 @@
* @access private
*
*/
- override function destroy( recursiveCall = null ) { }
+override function destroy( recursiveCall = null){
+ if ( this.__LZdeleted ) return;
+
+ if (this.sprite) this.sprite.predestroy();
+ if ( this.addedToParent ){
+ var svs = LFCView(this.immediateparent).subviews;
+ if (svs != null) {
+ for( var i = svs.length - 1; i >= 0; i-- ){
+ if ( svs[ i ] == this ){
+ svs.splice( i , 1 );
+ break;
+ }
+ }
+ }
+ }
+
+ super.destroy.apply(this, arguments);
+
+ if (this.sprite) { this.sprite.destroy() }
+
+ if ( recursiveCall == true ) { return; }
+
+ //this.__LZFinishDestroyOnIdle();
+
+ this.setVisible ( false );
+
+ if ( this.addedToParent ){
+ if ( ('__LZoutliewidth' in LFCView(this.immediateparent)) && (LFCView(this.immediateparent).__LZoutliewidth == this) ) {
+ LFCView(this.immediateparent).__LZoutliewidth=null;
+ }
+
+ if ( ('__LZoutlieheight' in LFCView(this.immediateparent)) && (LFCView(this.immediateparent).__LZoutlieheight == this) ) {
+ LFCView(this.immediateparent).__LZoutlieheight=null;
+ }
+
+ if ('onremovesubview' in LFCView(this.immediateparent))
+ if (LFCView(this.immediateparent).onremovesubview.ready) LFCView(this.immediateparent).onremovesubview.sendEvent( this );
+ }
+}
+
/** @access private */
+/** @access private */
function deleteView( recursiveCall ){
+ if ( $debug ){
+ Debug.deprecated(this, arguments.callee, this.destroy);
+ }
+ this.destroy();
}
+
+
/**
* This method sets the <attribute>visible</attribute> attribute of the view
* and also disables or re-enables any click region associated with the view.
@@ -1022,12 +1116,34 @@
*/
function setVisibility( amVisible , ignore = null ) { }
-/**
- * TODO: max : should be made private, api call from replication should be cleaner
- * @access private
- */
- function __LZupdateShown( ) { }
+ /**
+ * TODO: max : should be made private, api call from replication should be cleaner
+ * @access private
+ */
+ function __LZupdateShown( ) {
+ if ( this.visibility == "collapse" ){
+ var shown = this.__LZvizO && this.__LZvizDat && this.__LZvizLoad;
+ } else {
+ var shown = (this.visibility == "visible");
+ }
+ if ( shown != this.visible ){
+ this.visible = shown;
+
+ // FIXME: [hqm 2006-09] How do we end up with a null sprite? Some destroy ordering thing?
+ if (this.sprite ) {
+ this.sprite.setVisible(shown);
+ }
+
+ var ip = this.immediateparent;
+ if (ip && ip.__LZcheckwidth)
+ ip.__LZcheckwidthFunction( this );
+ if (ip && ip.__LZcheckheight)
+ ip.__LZcheckheightFunction( this );
+
+ if (this.onvisible.ready) this.onvisible.sendEvent( shown );
+ }
+ }
/**
* Sets the opacity for the view. The opacity is a number between 0.0
* (transparent) and 1.0 (opaque).
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs 2008-02-12 10:28:17 UTC (rev 8005)
@@ -38,4 +38,8 @@
Debug.error('views/Library.lzs unsupported runtime %s', $runtime)
}
-#include "views/LzScript.lzs"
+if ($swf9) {
+ #include "views/LzScript.js"
+} else {
+ #include "views/LzScript.lzs"
+}
Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.js
Property changes on: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js 2008-02-12 10:28:17 UTC (rev 8005)
@@ -260,7 +260,7 @@
args.fontsize = this.fontsize;
args.fontstyle = this.fontstyle;
this.tsprite.__initTextProperties(args);
- trace("__initTextProperties", lzutils.objAsString(args));
+ //trace("__initTextProperties", lzutils.objAsString(args));
args.font = LFCNode._ignoreAttribute;
args.fontsize = LFCNode._ignoreAttribute;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java 2008-02-12 10:28:17 UTC (rev 8005)
@@ -104,10 +104,6 @@
/** Keep a list of assigned global id's, so we can warn when one
* is redefined */
- // TODO: [07-18-03 hqm] We will compare all id's case
- // insensitively (using ComparisonMap), because actionscript is
- // not case sensitive. But in the future, we should preserve
- // case.
private final Map idTable = new ComparisonMap();
/** Holds a set of unresolved references to resources, so we can
@@ -356,6 +352,10 @@
return (Element) idTable.get(name);
}
+ public Map getIds () {
+ return idTable;
+ }
+
public void addResourceReference(String name, Element elt) {
resourceReferences.put(name, elt);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java 2008-02-12 10:28:17 UTC (rev 8005)
@@ -567,20 +567,21 @@
props.put("compileTimeConstants", compileTimeConstants);
props.setProperty(CompilationEnvironment.DEBUG_EVAL_PROPERTY, "true");
byte[] objcode;
- String prog;
+ String prog = "";
// Try compiling as an expression first. If that fails,
// compile as sequence of statements. If that fails too,
// report the parse error.
try {
- prog = "(function () {lzconsole.write("+script +")})();";
+ prog += "(function () { with(global) { lzconsole.write("+script +")} })();";
objcode = ScriptCompiler.compileToByteArray(prog, props);
} catch (org.openlaszlo.sc.parser.ParseException e) {
try {
- prog = "var mycode = (function () {\n"+script +"\n});\n"+"mycode();\n";
+ prog += "var mycode = (function () {\n"+
+ "with (global) { " + script +" }\n});\n"+"mycode();\n";
objcode = ScriptCompiler.compileToByteArray(prog, props);
- } catch (org.openlaszlo.sc.parser.ParseException e2) {
+ } catch (Exception e2) {
mLogger.info("error compiling/writing script: " + e2.getMessage());
objcode = ScriptCompiler.compileToByteArray(
"lzconsole.write(" + ScriptCompiler.quote("Parse error: "+ e2.getMessage()) + ")",
Modified: openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java 2008-02-12 10:28:17 UTC (rev 8005)
@@ -382,17 +382,30 @@
public String preProcess(String source) {
+ String imports = " #passthrough (toplevel:true) { \n" +
+ "import flash.display.*;\n" +
+ "import flash.events.*;\n" +
+ "import flash.utils.*;\n" +
+ "import flash.text.*;\n" +
+ "import flash.system.*;\n" +
+ "import flash.net.*;\n" +
+ "import flash.ui.*;\n" +
+ "import flash.text.Font;\n" +
+ "}#\n";
+
+
// TODO: [2007-1-14 dda] maybe tag compiler should emit app main class?
// We need a 'main' application class to inherit from Sprite and do some
// initialization, and currently there is no default one.
// We'll add one here, doing it later adds too many special cases.
if (!options.getBoolean(Compiler.BUILD_SHARED_LIBRARY)) {
if (options.getBoolean(Compiler.DEBUG_EVAL)) {
+
source += "public class " + SWF9Generator.DEBUG_EVAL_CLASSNAME +
- " extends " + SWF9Generator.DEBUG_EVAL_SUPERCLASS + " {}\n";
+ " extends " + SWF9Generator.DEBUG_EVAL_SUPERCLASS + " {\n " + imports + "}\n";
} else {
source += "public class " + SWF9Generator.MAIN_APP_CLASSNAME +
- " extends " + SWF9Generator.MAIN_LIB_CLASSNAME + " {}\n";
+ " extends " + SWF9Generator.MAIN_LIB_CLASSNAME + " {\n " + imports + "}\n";
}
}
return source;
Modified: openlaszlo/branches/devildog/demos/lzpix/app.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/app.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/app.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<canvas width="800" height="600" bgcolor="0xcfcfcf" proxied="true" title="LZPIX"> <!-- bgcolor="0xc0c0c0" -->
@@ -130,12 +130,12 @@
<!-- When the transition is done, load in the medium image to the
details view. -->
- <method event="onstop" reference="transitiontolinear_anm" >
+ <handler name="onstop" reference="transitiontolinear_anm" >
this.animate('dimmer',1,500);
//canvas.details.ph.posme.doStart();
//canvas.details.loadMediumImage();
this.updateOnIdle( false );
- </method>
+ </handler>
@@ -195,7 +195,7 @@
this.lyt.transitiontogrid_anm.doStart();
</method>
- <method event="onstop" reference="this.lyt.transitiontogrid_anm" >
+ <handler name="onstop" reference="this.lyt.transitiontogrid_anm" >
//Debug.write("TOOLS back onclick", photoscontainer.detailphoto);
canvas.interior.details_bkgnd.setHeight(0);
canvas.interior.details_bkgnd.setVisible( false );
@@ -204,7 +204,7 @@
this.lyt.setAttribute('textvisible',true); this.lyt.update();
this.showPhotoDetails( false );
tls.enableZoom();
- </method>
+ </handler>
<method name="showPhotoDetails" args="show,ph_arg" ><![CDATA[
if ( show ) {
@@ -225,10 +225,10 @@
<!-- end of animation back to photo grid -->
<!--
- <method event="onstop" reference="anm_closephotodetails" >
+ <handler name="onstop" reference="anm_closephotodetails" >
photoscontainer.lyt.setAttribute('textvisible',true);
photoscontainer.lyt.setAttribute('isgrid',true);
- </method>
+ </handler>
-->
@@ -237,7 +237,7 @@
value="$once{ new LzDelegate( this, 'initialReplicationDone' ) }"/>
<!-- once that data has loaded set the datapath on the photo -->
- <method event="ondata" reference="photods" >
+ <handler name="ondata" reference="photods" >
//Debug.write('ondata');
//Debug.write(this.pagecounter_dp);
this.initialReplicationDone();
@@ -255,7 +255,7 @@
gResultsCountLabel.setText( this.buildResultsString(c) );
this.watchforlast();
photoscontainer.lyt.calcpageparams = true;
- </method>
+ </handler>
<method name="watchforlast" >
//info('watchforlast');
@@ -332,7 +332,7 @@
<datapath xpath="photods:/rsp/photos/photo[1-18]" />
<!-- this is what should trigger photo editing -->
- <method event="onplainclick">
+ <handler name="onplainclick">
if ( parent.selman.isMultiSelect() ){
// Debug.write( this , " other click." );
parent.selman.select( this );
@@ -362,7 +362,7 @@
}
photoscontainer.detailphoto = this;
}
- </method>
+ </handler>
<attribute name="selected" value="false"/>
@@ -442,12 +442,12 @@
</view>
<attribute name="showhandcursor" value="false"/>
- <method event="onmousedown">
+ <handler name="onmousedown">
if ( lyt.isgrid ) rubberband.start();
- </method>
- <method event="onmouseup">
+ </handler>
+ <handler name="onmouseup">
rubberband.stop();
- </method>
+ </handler>
</view> <!-- end photos -->
@@ -503,10 +503,10 @@
<view bgcolor="0xffffff" width="${parent.width}" height="1" y="${parent.height - 1}" />
- <method event="onstop" reference="this.anm" >
+ <handler name="onstop" reference="this.anm" >
this.parent.large_cam.setVisible( false );
this.parent.little_cam.setVisible( true );
- </method>
+ </handler>
</view>
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/clipboard.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/clipboard.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/clipboard.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,10 +1,10 @@
<library>
<class name="clipboardlayout" extends="layout" >
- <method event="oninit" >
+ <handler name="oninit" >
this.updateDelegate.register( parent, "onheight" );
this.updateDelegate.register( parent, "onwidth" );
- </method>
+ </handler>
<method name="update" >
if ( this.locked ) return;
@@ -17,13 +17,13 @@
<include href="photocollection.lzx" />
<class name="clipboardphoto" extends="photo" border="1"
width="30" height="30" clipfactor="1">
- <method event="oninit">
+ <handler name="oninit">
shadow.setVisible( false );
- </method>
+ </handler>
<!-- Clicking on a photo in the clipboard brings that photo into
details view. The animation is a bit odd, because the photo thumbnail
is probably not visible in the album layout. -->
- <method event="onclick">
+ <handler name="onclick">
canvas.details.setImage( this.getImageURL('t'), this.getImageURL('') );
if (photoscontainer.lyt.isgrid) {
photoscontainer.transitionToDetails(this);
@@ -31,7 +31,7 @@
photoscontainer.showPhotoDetails( true, this );
}
photoscontainer.detailphoto = this;
- </method>
+ </handler>
</class>
<class name="clipboard" oninit="this.update()" >
@@ -121,14 +121,14 @@
this.setAttribute('isopen', !this.isopen);
</method>
- <method event="onstop" reference="anm_close" >
+ <handler name="onstop" reference="anm_close" >
scrn.setVisible(false);
- </method>
+ </handler>
</class>
</library>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/clipboardinterior.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/clipboardinterior.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/clipboardinterior.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,17 +1,17 @@
<photocollection name="interior" bgcolor="0xf0f0f0" clip="true"
photoclass="clipboardphoto" clickable="true">
- <method event="oninit">
+ <handler name="oninit">
LzTrack.register( this , 'photos' );
- </method>
+ </handler>
<attribute name="amtrackedover" value="false"/>
- <method event="onmousetrackover">
+ <handler name="onmousetrackover">
this.setAttribute( "amtrackedover", true );
- </method>
- <method event="onmousetrackout">
+ </handler>
+ <handler name="onmousetrackout">
this.setAttribute( "amtrackedover", false );
- </method>
+ </handler>
<wrappinglayout axis="x" yinset="3" xinset="3" spacing="3"/>
@@ -28,6 +28,6 @@
</photocollection>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/dataman.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/dataman.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/dataman.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -15,7 +15,7 @@
DATA MANAGER
-->
<node name="gDataMan">
- <method event="oninit">
+ <handler name="oninit">
this.errdel = new LzDelegate( this, "dsError" );
errdel.register( photods , "onerror" );
errdel.register( infods , "onerror" );
@@ -37,7 +37,7 @@
// Default is YES, we do connect
var noFlickr = LzBrowser.getInitArg("noconnect");
if (noFlickr == 'true') gGlobals.setAttribute("SHOULDCONNECT", false);
- </method>
+ </handler>
<method name="dsError">
gError.show();
@@ -226,6 +226,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/favorites.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/favorites.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/favorites.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -23,9 +23,9 @@
<attribute name="mymask" when="once"/>
- <method event="oninit">
+ <handler name="oninit">
this.updateDelegate.register( parent, "onx" );
- </method>
+ </handler>
<!--- @keywords private -->
<method name="setAxis" args="a" >
@@ -104,7 +104,7 @@
</method>
<!--- @keywords private -->
- <method event="onmousedown">
+ <handler name="onmousedown">
var now = new Date();
this._lasttime = now.getTime();
this.isMouseDown = true;
@@ -112,12 +112,12 @@
this.stillDownDelegate = new LzDelegate( this, "stillDownEventGenerator");
}
LzTimer.addTimer( this.stillDownDelegate, 500 );
- </method>
+ </handler>
<!--- @keywords private -->
- <method event= "onmouseup">
+ <handler name= "onmouseup">
this.isMouseDown=false;
LzTimer.removeTimer( this.stillDownDelegate );
- </method>
+ </handler>
</class>
?>
@@ -141,23 +141,23 @@
<?ignore // Take out buttons to scroll favorites. Should be temporary. [ben 3.2.2006]
<buttonrepeater name="scrollright" resource="../assets/favorites/arrow-left.png"
x="${-width-5}" y="${Math.round((parent.photos.height - this.height)/2) + parent.photos.y}">
- <method event="onmousestilldown" >
+ <handler name="onmousestilldown" >
parent.photos.interior.animate( 'x', Math.min(parent.photos.interior.x + 30,0), 300 )
- </method>
- <method event="onmouseup" >
+ </handler>
+ <handler name="onmouseup" >
parent.photos.interior.animate( 'x', Math.min(parent.photos.interior.x + 30,0), 100 )
- </method>
+ </handler>
</buttonrepeater>
<buttonrepeater name="scrollleft" resource="../assets/favorites/arrow-right.png"
x="${parent.width + 5}" y="${Math.round((parent.photos.height - this.height)/2) + parent.photos.y}" >
- <method event="onmousestilldown" >
+ <handler name="onmousestilldown" >
parent.photos.interior.animate( 'x', parent.photos.interior.x - 30 , 300 )
- </method>
- <method event="onmouseup" >
+ </handler>
+ <handler name="onmouseup" >
parent.photos.interior.animate( 'x', parent.photos.interior.x - 30 , 100 )
- </method>
+ </handler>
</buttonrepeater>
?>
@@ -170,12 +170,12 @@
<favoriteslayout name="lyt" spacing="15" inset="0"
mymask="parent.parent"/>
<photo datapath="favoritesds:/rsp/photos/photo" visible="true">
- <method event="onclick">
+ <handler name="onclick">
photoscontainer.lyt.setAttribute('currentpage', 1);
var id = datapath.p.getAttr("id");
var tag = datapath.p.getAttr("favoritetag");
classroot.loadSet( tag );
- </method>
+ </handler>
</photo>
</view>
</view>
@@ -187,6 +187,6 @@
</library>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/linkbutton.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/linkbutton.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/linkbutton.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -11,15 +11,15 @@
<mybutton
resource="transparent_rsc"
width="${parent.width}" height="${parent.height}" >
- <method event="onclick">
+ <handler name="onclick">
LzBrowser.loadURL( parent.url, parent.targetframe, parent.windowopts);
- </method>
+ </handler>
</mybutton>
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/notes.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/notes.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/notes.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<library>
@@ -77,15 +77,15 @@
<!-- Sets the note's view position and dimensions to match the flickr note.
Scale these to match the scale of the image -->
- <method event="ondata" args="d" > <![CDATA[
+ <handler name="ondata" args="d" > <![CDATA[
if ( !d ) return;
updateDimensions();
- ]]></method>
+ ]]></handler>
<datapointer name="size_dp" />
- <method event="ondata" reference="sizeds" args="d"><![CDATA[
+ <handler name="ondata" reference="sizeds" args="d"><![CDATA[
var dpw = size_dp.setXPath("sizeds:/rsp/sizes/size[1]");
var nname = size_dp.getNodeAttribute("label");
// Debug.write("got size info: ", d);
@@ -104,12 +104,12 @@
this.updateDimensions();
}
- ]]></method>
+ ]]></handler>
- <method event="onheight" reference="gPhV">
+ <handler name="onheight" reference="gPhV">
// Debug.write("onheight");
updateDimensions();
- </method>
+ </handler>
<method name="updateDimensions"><![CDATA[
if ( originalwidth <= 0 ) return;
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/photo.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/photo.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/photo.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,4 +1,4 @@
-<!-- Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. -->
+<!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. -->
<library>
<class name="photo" width="77" height="77" visible="${!tls.waitforload}">
@@ -24,7 +24,7 @@
<attribute name="border" value="2"/>
- <method event="ondata" args="d" > <![CDATA[
+ <handler name="ondata" args="d" > <![CDATA[
if ( !d ) return;
var dp = this.datapath;
// var txt = dp.xpathQuery('@title');
@@ -32,7 +32,7 @@
//this.setAttribute('text',txt);
this.setImage(this.getImageURL('t'));
- ]]></method>
+ ]]></handler>
<method name="getImageURL" args="suffix" >
<![CDATA[
@@ -65,7 +65,8 @@
</method>
<attribute name="_lastw" value="null"/>
- <method name="updateX" args="force" event="onwidth">
+ <handler name="onwidth" method="updateX"/>
+ <method name="updateX" args="force">
<![CDATA[
if ( !this.isinited ) return;
if ( height != width ) this.setHeight( width );
@@ -91,7 +92,8 @@
</method>
<attribute name="_lasth" value="null"/>
- <method name="updateY" args="force" event="onheight">
+ <handler name="onheight" method="updateY"/>
+ <method name="updateY" args="force">
<![CDATA[
if ( !this.isinited ) return;
if ( width != height ) this.setWidth( height );
@@ -117,7 +119,7 @@
]]>
</method>
- <method event="onload" reference="intparent.interior">
+ <handler name="onload" reference="intparent.interior">
var irw = intparent.interior.resourcewidth;
var irh = intparent.interior.resourceheight;
if ( irw > irh ){
@@ -141,7 +143,7 @@
this.intparent.setVisible(true);
}
intparent.interior.animate('opacity', 1, 200);
- </method>
+ </handler>
<!-- use this event to figure out if the view just got clicked
@@ -159,38 +161,38 @@
y="$once{ classroot.border }">
<view name="interior" bgcolor="0xd9d9d9" stretches="both">
<state apply="${classroot.doesdrag}">
- <method event="onmousedown">
+ <handler name="onmousedown">
classroot.onmousedown.sendEvent();
- </method>
- <method event="onmouseup">
+ </handler>
+ <handler name="onmouseup">
classroot.onmouseup.sendEvent();
- </method>
+ </handler>
</state>
</view>
</view>
- <method event="onmousedown">
+ <handler name="onmousedown">
if ( this.doesdrag ) this.startDragCheck();
- </method>
- <method event="onmouseup">
+ </handler>
+ <handler name="onmouseup">
if ( this.draginitiator ){
this.stopDrag();
} else {
this.ddcdel.unregisterAll();
if ( this.onplainclick ) this.onplainclick.sendEvent( this );
}
- </method>
+ </handler>
<!-- title -->
<text text="" width="100" fgcolor="0x1b1191" fontsize="10"
name="txt" visible="false"><!-- Setting this initially to false
seems to fix a visual issue where these would cluster on the
upper left of the page in DHTML. -->
- <method event="ontext">
+ <handler name="ontext">
this.adjustDimensions();
- </method>
- <method event="onvisible" >
+ </handler>
+ <handler name="onvisible" >
this.adjustDimensions();
- </method>
+ </handler>
<method name="adjustDimensions" >
this.setWidth(classroot.width + 20);
var tw = Math.min(this.getTextWidth(),width);
@@ -205,11 +207,11 @@
<attribute name="doesdrag" value="false"/>
- <method event="onwidth" >
+ <handler name="onwidth" >
if ( this['txt'] ) {
if ( this.txt.visible ) this.txt.adjustDimensions();
}
- </method>
+ </handler>
<method name="startDragCheck">
//info('startDragCheck');
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/pivotlayout.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/pivotlayout.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/pivotlayout.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<library>
@@ -88,9 +88,9 @@
</method>
<!--- @keywords private -->
- <method event="oninit">
+ <handler name="oninit">
this.regUpdateDelegate();
- </method>
+ </handler>
<method name="regUpdateDelegate">
//declare the attributes that will cause this layout to auto-update when they change
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/search.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/search.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/search.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -26,11 +26,11 @@
<mybutton
resource="transparent_rsc"
width="${parent.width}" height="${parent.height}" >
- <method event="onclick">
+ <handler name="onclick">
photoscontainer.lyt.setAttribute('currentpage', 1);
tls.resetOnLoad();
classroot.doSearch();
- </method>
+ </handler>
</mybutton>
@@ -44,13 +44,13 @@
<view resource="../assets/search/content-right.gif" x="${parent.width - width}" />
<inputtext name="txt" width="${parent.width}" height="${parent.height}" y="3">
- <method event="onkeyup" args="k" >
+ <handler name="onkeyup" args="k" >
if ( k == 13 ) { //return key
photoscontainer.lyt.setAttribute('currentpage', 1);
tls.resetOnLoad();
classroot.doSearch();
}
- </method>
+ </handler>
</inputtext>
</view>
@@ -111,6 +111,6 @@
</library>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/classes/spinner.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes/spinner.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes/spinner.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<library>
@@ -8,13 +8,13 @@
<class name="spinner" resource="spinner_rsc" onclick="this.play()" visible="false" >
<attribute name="counter" value="1" />
- <method event="onidle" reference="LzIdle" >
+ <handler name="onidle" reference="LzIdle" >
if (! this.visible ) return;
this.setAttribute('counter', ( this.counter + 1)%6);
if ( this.counter == 0 ) {
var f = (this.frame + 1)%6;
this.setAttribute('frame', f == 0 ? 6 : f);
}
- </method>
+ </handler>
</class>
</library>
Modified: openlaszlo/branches/devildog/demos/lzpix/classes.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/classes.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/classes.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,4 +1,4 @@
-<!-- Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. -->
+<!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. -->
<library>
<class name="verticalindent" >
@@ -31,7 +31,7 @@
</method>
<!--- @keywords private -->
- <method event="onmousedown">
+ <handler name="onmousedown">
var now = new Date();
this._lasttime = now.getTime();
this.isMouseDown = true;
@@ -39,12 +39,12 @@
this.stillDownDelegate = new LzDelegate( this, "stillDownEventGenerator");
}
LzTimer.addTimer( this.stillDownDelegate, 500 );
- </method>
+ </handler>
<!--- @keywords private -->
- <method event= "onmouseup">
+ <handler name="onmouseup">
this.isMouseDown=false;
LzTimer.removeTimer( this.stillDownDelegate );
- </method>
+ </handler>
</class>
Modified: openlaszlo/branches/devildog/demos/lzpix/test-button.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/test-button.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/test-button.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<canvas title="test-button.lzx">
@@ -8,16 +8,16 @@
<include href="views/mybutton.lzx" />
<mybutton width="50" height="50" stretches="both">
- <method event="onclick">
+ <handler name="onclick">
Debug.write("mybutton onclick");
- </method>
+ </handler>
</mybutton>
<mybutton y="75" width="50" height="50" >
<text>click me</text>
- <method event="onclick">
+ <handler name="onclick">
Debug.write("mybutton with text onclick");
- </method>
+ </handler>
</mybutton>
</canvas>
Modified: openlaszlo/branches/devildog/demos/lzpix/test-url.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/test-url.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/test-url.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<canvas title="test-urldisplay">
@@ -14,11 +14,11 @@
<mybutton datapath="infods:/rsp/photo" resource="assets/transparent.png"
width="100" height="20" bgcolor="0x999900">
<text x="8" y="10" valign="middle">open flickr page in new window</text>
- <method event="onclick">
+ <handler name="onclick">
var s = this.datapath.xpathQuery("urls/url/text()");
Debug.write("how about ", s );
LzBrowser.loadURL( s, "_blank", "toolbar=yes");
- </method>
+ </handler>
</mybutton>
Modified: openlaszlo/branches/devildog/demos/lzpix/tests/pivoylayout-test.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/tests/pivoylayout-test.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/tests/pivoylayout-test.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,3 +1,4 @@
+<!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. -->
<canvas height="450" >
<include href="../classes/pivotlayout.lzx" />
<dataset name="tester" >
@@ -71,15 +72,15 @@
<animator name="yspacing_anm" attribute="yspacing" to="10" duration="500" start="false" />
<animator name="skew_anm" attribute="skew" from="1" to="0" duration="500" start="false" />
- <method event="onstop" reference="this.transitiontogrid" >
+ <handler name="onstop" reference="this.transitiontogrid" >
this.animate("pivot_y", this.pivotview.gridy, 500 );
this.animate("pivot_x", this.pivotview.gridx, 500 );
this.yspacing_anm.doStart();
- </method>
+ </handler>
- <method event="onstop" reference="this.yspacing_anm" >
+ <handler name="onstop" reference="this.yspacing_anm" >
this.skew_anm.doStart();
- </method>
+ </handler>
<method name="myreset" >
this.photodimension=50 ;
@@ -128,4 +129,4 @@
<button text="animate skew" onclick="canvas.vw.lyt.animate('skew',1,300)" />
<button text="animate pivot_y" onclick="canvas.vw.lyt.animate('pivot_y',100,300)" />
</view>
-</canvas>
\ No newline at end of file
+</canvas>
Modified: openlaszlo/branches/devildog/demos/lzpix/tests/test-auth.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/tests/test-auth.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/tests/test-auth.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,3 +1,4 @@
+<!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. -->
<canvas title="test-auth.lzx">
<include href="../classes/dataman.lzx"/>
@@ -7,7 +8,7 @@
<edittext name="idtext">153387</edittext>
<edittext name="tagtext">lzpixtest4</edittext>
<button>tag it
- <method event="onclick">
+ <handler name="onclick">
var argobj = [
{argname:"method",
argvalue:"flickr.photos.addTags"},
@@ -17,7 +18,7 @@
argvalue: tagtext.getText()}
];
gDataMan.doAuthFlickrRequest(canvas.infods, argobj);
- </method>
+ </handler>
</button>
<text datapath="infods:/rsp/@stat">
Modified: openlaszlo/branches/devildog/demos/lzpix/views/details.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/views/details.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/views/details.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<library>
@@ -8,21 +8,21 @@
<class name="taglink" width="100" clickable="true" >
<view resource="../assets/details/taglink_icon.gif" />
<text name="txt" x="15" y="-4" text="tag title" width="100" fgcolor="0x5c5c5c" fontsize="10"/>
- <method event="ondata" args="t" >
+ <handler name="ondata" args="t" >
if ( t == null || t == undefined ) t = "";
this.txt.setText(t);
- </method>
+ </handler>
</class>
<class name="buddyicon" width="24" height="24" stretches="both" >
- <method event="ondata" args="d">
+ <handler name="ondata" args="d">
if (!d) return;
var dp = this.datapath;
var iconserver = dp.xpathQuery('@iconserver');
var userid = dp.xpathQuery('@id');
this.setSource(this.getBuddyIconUrl(userid, iconserver));
- </method>
+ </handler>
<!-- Get buddy icon from http://static.flickr.com/{icon-server}/buddyicons/{nsid}.jpg
ie http://static.flickr.com/27/buddyicons/49503086499@N01.jpg -->
@@ -47,11 +47,11 @@
height="${this.parent.height - 2}"
stretches="both"/>
- <method event="onload" reference="interior">
+ <handler name="onload" reference="interior">
this.setDimensions();
this.setVisible( true );
this.anm_opacity.doStart();
- </method>
+ </handler>
<method name="setDimensions" ><![CDATA[
//Debug.write(this.name, "setDimensions");
@@ -165,10 +165,10 @@
</animatorgroup>
<naturalimgview name="intparent" id="gPhV">
- <method event="onstart" reference="anm_opacity" >
+ <handler name="onstart" reference="anm_opacity" >
var m = classroot.photosource_m;
if (m) this.parent.intparent2.interior.setSource(m);
- </method>
+ </handler>
</naturalimgview>
<naturalimgview name="intparent2" fadein="250"/>
@@ -200,13 +200,13 @@
<view bgcolor="0x5b5b5b" width="26" height="26" /> <!-- buddyicon background -->
<buddyicon id="gBud" x="1" y="1" datapath="userds:/rsp/person"/>
- <method event="ondata" args="d" >
+ <handler name="ondata" args="d" >
// change text to reflect the correct formatting of the date and time
if ( !d ) return;
var str = classroot.toDateString( datapath.xpathQuery( "dates/@posted" ) );
inner.formattedDate.setText(str);
inner.userlabel.setText( datapath.xpathQuery( "owner/@username" ) );
- </method>
+ </handler>
<view name="inner" x="30" y="-3" visible="true">
<text fgcolor="0x5c5c5c">Updated on </text>
@@ -233,10 +233,10 @@
<view height="4" />
<view datapath="infods:/rsp/photo">
- <method event="onclick">
+ <handler name="onclick">
var s = this.datapath.xpathQuery("urls/url/text()");
LzBrowser.loadURL( s, "_blank", "toolbar=yes");
- </method>
+ </handler>
<text fgcolor="#324FDB">view on flickr</text>
</view>
@@ -244,17 +244,17 @@
<text fgcolor="0x5c5c5c" fontstyle="bold" fontsize="12" height="23" >Tags</text>
<view x="5" width="${parent.width}">
- <method event="ondata" reference="infods">
+ <handler name="ondata" reference="infods">
this.tl.setDatapath('infods:/rsp/photo/tags/tag[1-19]/text()');
- </method>
+ </handler>
<wrappinglayout spacing="3" />
<!-- Only display first 20 tags -->
<taglink name="tl" clickable="true" >
- <method event="onclick" >
+ <handler name="onclick" >
var t = this.txt.getText();
canvas.srch.setText( t );
canvas.srch.sendsearch();
- </method>
+ </handler>
</taglink>
</view>
</view>
Modified: openlaszlo/branches/devildog/demos/lzpix/views/error.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/views/error.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/views/error.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -13,9 +13,9 @@
<mybutton x="260" y="32">
<text x="8" y="10" valign="middle">ok</text>
- <method event="onclick">
+ <handler name="onclick">
LzBrowser.loadURL( "javascript:window.location.href=window.location.href" );
- </method>
+ </handler>
</mybutton>
<method name="show" args="etext">
@@ -24,6 +24,6 @@
</view>
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
Modified: openlaszlo/branches/devildog/demos/lzpix/views/tools.lzx
===================================================================
--- openlaszlo/branches/devildog/demos/lzpix/views/tools.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/demos/lzpix/views/tools.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,6 +1,6 @@
<!--
* X_LZ_COPYRIGHT_BEGIN ****************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<view id="tls" name="tools"
@@ -133,7 +133,7 @@
]]>
</method>
- <method event="onstop" reference="photoscontainer.lyt.pageNext" >
+ <handler name="onstop" reference="photoscontainer.lyt.pageNext" >
//photoscontainer.lyt.dim( true );
//this.setAttribute('pageindex',Math.min( this.pageindex + 1, this.pagemax));
this.displayPage();
@@ -143,7 +143,7 @@
photoscontainer.lyt.setAttribute('pivot_x',10);
photoscontainer.lyt.setAttribute('pivotindex',0);
}
- </method>
+ </handler>
<method name="displayPrevPage" >
<![CDATA[
@@ -168,7 +168,7 @@
]]>
</method>
- <method event="onstop" reference="photoscontainer.lyt.pagePrev" >
+ <handler name="onstop" reference="photoscontainer.lyt.pagePrev" >
this.displayPage();
photoscontainer.lyt.calcpageparams = true;
if ( photoscontainer.lyt.isgrid ) photoscontainer.lyt.setAttribute('pivot_x',50)
@@ -176,7 +176,7 @@
photoscontainer.lyt.setAttribute('pivot_x',10);
photoscontainer.lyt.setAttribute('pivotindex',0);
}
- </method>
+ </handler>
<method name="displayPage" >
var bufferamount = 23;
@@ -190,12 +190,12 @@
</method>
<!-- if photos are zoomed then page end will change -->
- <method event="onpageend" reference="photoscontainer.lyt" >
+ <handler name="onpageend" reference="photoscontainer.lyt" >
//Debug.write("onpageend: this.startindex, this.endindex",this.startindex, this.endindex);
this.endindex = this.startindex + photoscontainer.lyt.pagesize -1;
this.displayRange( this.startindex, this.endindex );
- </method>
+ </handler>
<method name="displayRange" args="s,e" >
this.firstphotoindex.setText( s + (photoscontainer.lyt.perpage * (photoscontainer.lyt.currentpage - 1)));
@@ -209,9 +209,9 @@
this.ondataflag = true;
</method>
- <method event="ondata" reference="photods" >
+ <handler name="ondata" reference="photods" >
this.setAttribute('waitforload', false);
photoscontainer.lyt.calcparams = true;
- </method>
+ </handler>
</view>
Modified: openlaszlo/branches/devildog/test/swf9/hello.lzx
===================================================================
--- openlaszlo/branches/devildog/test/swf9/hello.lzx 2008-02-12 10:26:27 UTC (rev 8004)
+++ openlaszlo/branches/devildog/test/swf9/hello.lzx 2008-02-12 10:28:17 UTC (rev 8005)
@@ -1,4 +1,4 @@
-<canvas width="1000" height="800">
+<canvas width="1000" height="600" bgcolor="#eeeeff">
<!-- <text bgcolor="#ccffcc">Hello OpenLaszlo!</text> -->
<text oninit="this.setText('runtime='+canvas.runtime)"/>
@@ -16,7 +16,7 @@
<view x="200" y="10" resource="testmedia/cherry.png"
onclick="this.animate('rotation', 45, 1000, true)">
<handler name="oninit">
- trace('embed view oninit handler!');
+ Debug.write('embed view oninit handler!');
</handler>
</view>
@@ -30,6 +30,13 @@
<view x="200" y="150" resource="http://www.beartronics.com/swf9/logo.swf"
onclick="this.animate('rotation', 45, 1000, true)">
+ <handler name="onerror" args="arg">
+ Debug.write("resource onerror event", arg);
+ </handler>
+ <handler name="ontimeout" args="arg">
+ lzconsole.write("resource ontimeout event", arg);
+ </handler>
+
<handler name="onclick">
canvas.showText("You clicked me!");
</handler>
@@ -74,6 +81,18 @@
<text fontsize="11">aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo ppp qqq</text>
</view>
+ <view id="mystate" x="650" y="80" onclick="this.mystate.apply()" >
+ <state name="mystate">
+ <view width="50" height="50" x="50" y="40" bgcolor="#ccccff"
+ onclick="parent.mystate.remove()">
+ <text>xxx Click me to remove state</text>
+ </view>
+ </state>
+ <view width="50" height="50" bgcolor="#ffcccc"/>
+ <text name="t1">Click me to apply state</text>
+ </view>
+
+
<text fontsize="11" x="500" y="200" bgcolor="#cccccc">aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo ppp qqq</text>
<text fontsize="11" x="500" y="240" selectable="true"
More information about the Laszlo-checkins
mailing list