Author: hqm
Date: 2008-01-17 14:05:43 -0800 (Thu, 17 Jan 2008)
New Revision: 7849
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
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/Main.java
openlaszlo/branches/devildog/test/swf9/hello.lzx
Log:
Change 20080117-hqm-2 by [EMAIL PROTECTED] on 2008-01-17 17:02:53 EST
in /cygdrive/c/users/hqm/openlaszlo/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: created 'static' classes for core LFC classes
New Features:
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Created LFCNode, LFCView, as static core classes for the LFC, and
made LzView and LzNode be dynamic subclasses, suitable for
subclassing by user classes.
The hope is that this will allow the flex compiler to make core LFC method
calls inside the LFC
more efficient.
Tests:
test/swf9/hello*
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -31,7 +31,7 @@
* @shortdesc Changes the value of another object's attribute over time.
* @see animatorgroup
*/
-dynamic class LzAnimator extends LzAnimatorGroup {
+class LzAnimator extends LzAnimatorGroup {
/** @access private
* @modifiers override
@@ -46,15 +46,6 @@
static var __LZdelayedSetters:* = new
LzInheritedHash(LzAnimatorGroup.__LZdelayedSetters);
static var earlySetters:* = new
LzInheritedHash(LzAnimatorGroup.earlySetters);
- override function installSetters () {
- this.setters = LzAnimator.setters;
- this.getters = LzAnimator.getters;
- this.defaultattrs = LzAnimator.defaultattrs;
- this.options = LzAnimator.options;
- this.__LZdelayedSetters = LzAnimator.__LZdelayedSetters;
- this.earlySetters = LzAnimator.earlySetters;
- }
-
function LzAnimator ( parent:* , attrs:* , children:* = null, instcall:*
= null) {
super(parent,attrs,children,instcall);
this.calcMethod = this.calcNextValue;
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -59,7 +59,7 @@
* @lzxname layout
*/
-dynamic class LzLayout extends LzNode {
+dynamic class LzLayout extends LFCNode {
/** @access private
* @modifiers override
@@ -67,36 +67,26 @@
static var tagname = 'layout';
ConstructorMap[tagname] = LzLayout;
- static var getters = new LzInheritedHash(LzNode.getters);
- static var defaultattrs = new LzInheritedHash(LzNode.defaultattrs);
- static var options = new LzInheritedHash(LzNode.options);
- static var setters = new LzInheritedHash(LzNode.setters);
- static var __LZdelayedSetters:* = new
LzInheritedHash(LzNode.__LZdelayedSetters);
- static var earlySetters:* = new LzInheritedHash(LzNode.earlySetters);
+ static var getters = new LzInheritedHash(LFCNode.getters);
+ static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
+ static var options = new LzInheritedHash(LFCNode.options);
+ static var setters = new LzInheritedHash(LFCNode.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCNode.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCNode.earlySetters);
- override function installSetters () {
- this.setters = LzLayout.setters;
- this.getters = LzLayout.getters;
- this.defaultattrs = LzLayout.defaultattrs;
- this.options = LzLayout.options;
- this.__LZdelayedSetters = LzLayout.__LZdelayedSetters;
- this.earlySetters = LzLayout.earlySetters;
- }
-
function LzLayout ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
super(parent,attrs,children,instcall);
}
var initDelegate;
-
-
/**
* Set to true if layout is locked from updates.
* @type Boolean
*/
//locked is set to 2 in the prototype of the layout. This is a special
signal that the layout is locked temporarily until it resolves its references
var locked = 2;
+
LzLayout.setters.locked = "__LZsetLocked";
/** Array holding the views under this layout's control.
@@ -131,10 +121,10 @@
// view.layouts: If it doesn't already exist, layouts create an array
//in the view that it attaches to that hold the list of layouts attached
//to the view.
- if ( this.immediateparent.layouts == null ){
- this.immediateparent.layouts = [ this ];
+ if ( (LFCView(this.immediateparent)).layouts == null ){
+ (LFCView(this.immediateparent)).layouts = [ this ];
} else {
- this.immediateparent.layouts.push( this );
+ (LFCView(this.immediateparent)).layouts.push( this );
}
this.updateDelegate = new LzDelegate( this , "update" );
@@ -162,10 +152,10 @@
this.delegates.push( new LzDelegate ( this, "removeSubview",
this.immediateparent, "onremovesubview" ));
- var vsl = this.immediateparent.subviews.length;
+ var vsl = (LFCView(this.immediateparent)).subviews.length;
for (var i = 0; i < vsl; i++){
- this.gotNewSubview( this.immediateparent.subviews[i] );
+ this.gotNewSubview( (LFCView(this.immediateparent)).subviews[i] );
}
}
@@ -203,7 +193,7 @@
* not set.
*
* @access protected
- * @param LzView sd: The subview to add.
+ * @param LFCView sd: The subview to add.
*/
function addSubview( sd ) {
if ( sd.getOption( 'layoutAfter' ) ){
@@ -231,7 +221,7 @@
* Called when a subview is removed. This is not well tested.
*
* @access protected
- * @param LzView sd: The subview to be removed.
+ * @param LFCView sd: The subview to be removed.
*/
function removeSubview( sd ) {
for ( var i = this.subviews.length-1; i >= 0; i-- ){
@@ -249,7 +239,7 @@
* layouts include all the subviews of a given view.
*
* @access protected
- * @param LzView s: The subview to ignore.
+ * @param LFCView s: The subview to ignore.
*/
function ignore( s ) {
//default behavior on addSubview is to reset
@@ -320,10 +310,10 @@
this.delegates[ i ] .unregisterAll();
}
}
- if (this.immediateparent && this.immediateparent.layouts) {
- for ( var i = this.immediateparent.layouts.length -1 ; i >= 0 ; i-- ){
- if ( this.immediateparent.layouts[ i ] == this ){
- this.immediateparent.layouts.splice( i , 1 );
+ if (this.immediateparent && (LFCView(this.immediateparent)).layouts) {
+ for ( var i = (LFCView(this.immediateparent)).layouts.length -1 ; i >=
0 ; i-- ){
+ if ( (LFCView(this.immediateparent)).layouts[ i ] == this ){
+ (LFCView(this.immediateparent)).layouts.splice( i , 1 );
}
}
}
@@ -336,9 +326,9 @@
*
* @access public
*
- * @param LzView sub1: The reference subview which the second subview should
+ * @param LFCView sub1: The reference subview which the second subview should
* follow in the layout order. Alternatively, can be "first" or "last"
- * @param LzView sub2: The subview to be moved after the reference subview.
+ * @param LFCView sub2: The subview to be moved after the reference subview.
*/
function setLayoutOrder ( sub1 , sub2 ){
//this will cause problems if sub1 or sub2 are not subviews
@@ -369,9 +359,9 @@
* Swap the positions of the two subviews within the layout
* @access public
*
- * @param LzView sub1: The reference subview which the second subview should
+ * @param LFCView sub1: The reference subview which the second subview should
* follow in the layout order.
- * @param LzView sub2: The subview to be moved after the reference subview.
+ * @param LFCView sub2: The subview to be moved after the reference subview.
*/
function swapSubviewOrder ( sub1 , sub2 ){
//this will cause problems if sub1 or sub2 are not subviews
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -41,7 +41,7 @@
* @see LzAnimator
*
*/
-dynamic class LzAnimatorGroup extends LzNode {
+class LzAnimatorGroup extends LFCNode {
/** @access private
* @modifiers override
@@ -49,23 +49,13 @@
static var tagname = 'animatorgroup';
ConstructorMap[tagname] = LzAnimatorGroup;
- static var getters = new LzInheritedHash(LzNode.getters);
- static var defaultattrs = new LzInheritedHash(LzNode.defaultattrs);
- static var options = new LzInheritedHash(LzNode.options);
- static var setters = new LzInheritedHash(LzNode.setters);
- static var __LZdelayedSetters:* = new
LzInheritedHash(LzNode.__LZdelayedSetters);
- static var earlySetters:* = new
LzInheritedHash(LzAnimatorGroup.earlySetters);
+ static var getters = new LzInheritedHash(LFCNode.getters);
+ static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
+ static var options = new LzInheritedHash(LFCNode.options);
+ static var setters = new LzInheritedHash(LFCNode.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCNode.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCNode.earlySetters);
- override function installSetters () {
- this.setters = LzAnimatorGroup.setters;
- this.getters = LzAnimatorGroup.getters;
- this.defaultattrs = LzAnimatorGroup.defaultattrs;
- this.options = LzAnimatorGroup.options;
- this.__LZdelayedSetters = LzAnimatorGroup.__LZdelayedSetters;
- this.earlySetters = LzAnimatorGroup.earlySetters;
- }
-
-
/** The name of the attribute whose value is animated. This
* attribute is required on an animator, unless the animator is
* inside an animatorgroup that specifies an attribute.
@@ -82,6 +72,7 @@
var __LZpauseTime;
var actAnim;
+
function LzAnimatorGroup ( parent:* , attrs:* , children:* = null,
instcall:* = null) {
super(parent,attrs,children,instcall);
}
@@ -95,8 +86,8 @@
* @lzxdefault "true"
*/
var start = true;
- LzAnimatorGroup.setters.start = "setStart";
- LzAnimatorGroup.defaultattrs.start = true;
+ LzAnimatorGroup.setters.start = "setStart";
+ LzAnimatorGroup.defaultattrs.start = true;
/** The start value for the animation. Defaults to the
* targeted attribute's current value.
@@ -118,6 +109,7 @@
* @lzxtype xsd:float {minInclusive="0"} | constraint
*/
var duration;
+
LzAnimatorGroup.setters.duration = "setDuration";
/**
@@ -201,8 +193,10 @@
* @type boolean
*/
+
LzAnimatorGroup.setters.paused = "pause";
+
//LzAnimatorGroup.setters.view = "defaultSet";
/** The active-state of the animator. If true, the animator is currently
processing its animation.
@@ -269,12 +263,12 @@
args[ k ] = this.immediateparent[ k ] ;
}
}
- if ( this.immediateparent.animators == null ){
- this.immediateparent.animators = [ this ];
+ if ( (LFCView(this.immediateparent)).animators == null ){
+ (LFCView(this.immediateparent)).animators = [ this ];
} else {
- this.immediateparent.animators.push( this );
+ (LFCView(this.immediateparent)).animators.push( this );
}
- args.start = LzNode._ignoreAttribute;
+ args.start = LFCNode._ignoreAttribute;
} else {
// initialize target to immediateparent, may be set later by attribute
this.target = this.immediateparent;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-17
20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-17
22:05:43 UTC (rev 7849)
@@ -31,7 +31,7 @@
* defaultplacement in lexical parent). See the
* <method>LzNode.determinePlacement</method> method. Defaults to false.
*/
-dynamic class LzNode {
+class LFCNode {
var __LZdeferDelegates:Boolean = false;
var _instanceAttrs:* = null;
@@ -43,30 +43,16 @@
var _events:* = null;
var data:* = null;
+ //////////////////
+
+
///////////////////////////////////////////////////////////////////
- // TODO [hqm 2008-01] Do we need to do anything more complex
- // to deal with methods that reference superclass methods?
+ // TODO [hqm 2008-01] This won't work for adding methods that
+ // call super(). Need to make those real compile time methods (and
setters).
function addProperty(key:*,val:*):void {
this[key] = val;
}
- //////////////////
-
-/** @access private
- * @modifiers override
- */
- static var tagname = 'node';
- ConstructorMap[tagname] = LzNode;
-
- function installSetters () {
- this.setters = LzNode.setters;
- this.getters = LzNode.getters;
- this.defaultattrs = LzNode.defaultattrs;
- this.options = LzNode.options;
- this.__LZdelayedSetters = LzNode.__LZdelayedSetters;
- this.earlySetters = LzNode.earlySetters;
- }
-
/**
* @param LzNode parent: a node above this one in the hierarchy -- not
* necessarily the immediate parent -- that will decide where this node goes
@@ -76,12 +62,15 @@
* @param Boolean instcall
* @access private
*/
- function LzNode ( parent:* , attrs:* , children:* = null, instcall:* =
null){
- installSetters();
+ function LFCNode ( parent:* , attrs:* , children:* = null, instcall:* =
null){
+ this.setters = this['constructor'].setters;
+ this.getters = this['constructor'].getters;
+ this.defaultattrs = this['constructor'].defaultattrs;
+ this.options = this['constructor'].options;
+ this.__LZdelayedSetters = this['constructor'].__LZdelayedSetters;
+ this.earlySetters = this['constructor'].earlySetters;
- //trace('devildog2 LzNode construct this.setters = ',
lzutils.objAsString(this.setters));
-
- this.__LZUID = "__U" + ++LzNode.__UIDs;
+ this.__LZUID = "__U" + ++LFCNode.__UIDs;
this.__LZdeferDelegates = true;
var qpos = LzDelegate.__LZdelegatesQueue.length;
// super.apply(this.arguments)
@@ -91,9 +80,9 @@
var nm = null;
// Have to extract name from attrs
if (attrs) {
- if (attrs['id'] && (attrs.id != LzNode._ignoreAttribute)) {
+ if (attrs['id'] && (attrs.id != LFCNode._ignoreAttribute)) {
nm = '#' + attrs.id;
- } else if (attrs['name'] && (attrs.name !=
LzNode._ignoreAttribute)) {
+ } else if (attrs['name'] && (attrs.name !=
LFCNode._ignoreAttribute)) {
nm = ((parent === canvas)?'#':'.') + attrs.name;
} else if (attrs['_profile_name']) {
nm = attrs._profile_name;
@@ -134,11 +123,11 @@
var dattrk = dattrs[ k ];
if ( dattrk is Object ) {
if ( attrk is Array ) {
-// Debug.debug("%w: LzNode.initialize: merging Array %s",
this, k);
+// Debug.debug("%w: LFCNode.initialize: merging Array %s",
this, k);
iargs[ k ] = attrk.concat( dattrk );
continue;
} else if (typeof attrk == 'object') {
-// Debug.debug("%w: LzNode.initialize: merging Object %s",
this, k);
+// Debug.debug("%w: LFCNode.initialize: merging Object
%s", this, k);
var tmp = new LzInheritedHash(dattrk);
for (var j in attrk) {
tmp[j] = attrk[j];
@@ -161,7 +150,7 @@
//we know the defaultattrs has $refs, so attach it
iargs.$refs = new LzInheritedHash(dattr$refs);
}
- var ia = LzNode._ignoreAttribute;
+ var ia = LFCNode._ignoreAttribute;
for (var k in cleanup) {
iargs.$refs[ k ] = ia;
}
@@ -179,7 +168,8 @@
//Flag if this was newed by the instantiator
this.__LZisnew = !instcall;
- var c = ('classChildren' in this.constructor.prototype) ?
this.constructor.prototype.classChildren : null;
+ var c = null;
+ c = this['constructor'].classChildren;
if ( c && c.length ){
// classroot will not be defined for members of a state
// class, this is hard because the classroot is not a
@@ -249,7 +239,7 @@
// Set _profile_instantiator_name to constructor._dbg_name for
// annotation in LzInstantiator.makeSomeViews
else {
- this._profile_instantiator_name = this.constructor._dbg_name;
+ this._profile_instantiator_name =
this['constructor']._dbg_name;
}
}
}
@@ -359,7 +349,7 @@
/** @access private */
static var defaultattrs:* = new LzInheritedHash({ $hasdefaultattrs : true });
-var defaultattrs:*;
+var defaultattrs;
var $hasdefaultattrs:*;
@@ -511,7 +501,7 @@
* @type LzNode
* @keywords readonly
*/
-var immediateparent:LzNode = null;
+var immediateparent:LFCNode = null;
/** @access private */
var dependencies = null;
@@ -687,9 +677,12 @@
* written in the class definition.
*
*/
+
+ static var nodecount = 0;
function construct ( parent , args ){
+ trace("LFCNode.construct", nodecount++, parent, lzutils.objAsString(args));
if (parent == null) {
- //trace("LzNode construct parent == null, args=",
lzutils.objAsString(args));
+ //trace("LFCNode construct parent == null, args=",
lzutils.objAsString(args));
}
var lp = parent; // lp == lexical parent
@@ -707,9 +700,9 @@
this.placement = thisplacement;
}
while (thisplacement != null) {
- if (ip.determinePlacement == LzNode.prototype.determinePlacement) {
+ if (ip.determinePlacement == LFCNode.prototype.determinePlacement)
{
// this is the fast path -- basically inline the relevant part
- // of LzNode.prototype.determinePlacement, below
+ // of LFCNode.prototype.determinePlacement, below
var pp = ip.searchSubnodes("name", thisplacement);
if (pp == null) pp = ip;
} else {
@@ -782,7 +775,7 @@
*/
function __LZclearPreventInit ( ){
var lzp = this.__LZpreventSubInit;
- delete this.__LZpreventSubInit;
+ this.__LZpreventSubInit = null;
var l = lzp.length;
for ( var i = 0; i < l; i++ ){
lzp[ i ].__LZcallInit();
@@ -829,7 +822,7 @@
// Register in the source locator table, if debugging
if ($debug) {
if (this.__LZsourceLocation) {
- LzNode.sourceLocatorTable[this.__LZsourceLocation] = this;
+ LFCNode.sourceLocatorTable[this.__LZsourceLocation] = this;
}
}
@@ -906,7 +899,7 @@
for ( var a in args ){
//handle flash bug where objects slots are enumerated multiple times
- if ( oset[a] || args[a] === LzNode._ignoreAttribute ) continue;
+ if ( oset[a] || args[a] === LFCNode._ignoreAttribute ) continue;
oset[ a ] = true;
if (setrs && setrs[ a ] == null ){
@@ -1221,8 +1214,8 @@
*/
function __LZaddSetter ( key , val ) {
// Ensure you have your own private setters dictionary
- if (this.setters == this.constructor.setters) {
- this.setters = new LzInheritedHash(this.constructor.setters);
+ if (this.setters == this['constructor'].setters) {
+ this.setters = new LzInheritedHash(this['constructor'].setters);
}
this.setters[key] = val;
}
@@ -1591,7 +1584,7 @@
* @param String dp: The string to use as the datapath.
*/
function setDatapath ( dp , ignore = null) {
- if (null != this.datapath && dp != LzNode._ignoreAttribute) {
+ if (null != this.datapath && dp != LFCNode._ignoreAttribute) {
this.datapath.setXPath(dp);
} else {
// LzDatapath will set datapath of its immediateparent
@@ -1664,8 +1657,8 @@
// Ensure you have your own private options dictionary, not the one
// inherited from your class, nor the default empty one inherited
// from LzNode!
- if (this.options == this.constructor.options) {
- this.options = new LzInheritedHash(this.constructor.options);
+ if (this.options == this['constructor'].options) {
+ this.options = new LzInheritedHash(this['constructor'].options);
}
for (var key in hash) {
this.options[ key ] = hash[key];
@@ -1727,7 +1720,7 @@
function determinePlacement ( aSub , placement,
args) {
// Note that if you modify this function, please check that
- // LzNode.prototype.construct (in this file) is in sync -- it
+ // LFCNode.prototype.construct (in this file) is in sync -- it
// basically inlines this code as an optimization.
if ( placement == null ){
@@ -1874,10 +1867,10 @@
//remove name
if ( this.name != null ){
if ( this.parent[ this.name ] == this ){
- delete this.parent[ this.name ];
+ this.parent[ this.name ] = null;
}
if ( this.immediateparent[ this.name ] == this ){
- delete this.immediateparent[ this.name ];
+ this.immediateparent[ this.name ] = null;
}
if ( this.parent === canvas && global[ this.name ] === this ){
// FIXME [2006-10-05 pbr] (LPP-1871) Revert to deleting from
global when modules are implemented.
@@ -1919,7 +1912,7 @@
this.__LZdelegates[ i ].unregisterAll();
}
}
- delete this.__LZdelegates;
+ this.__LZdelegates = null;
//remove events
if (('_events' in this) && (this._events != null)) {
@@ -1927,7 +1920,7 @@
this._events[i].clearDelegates();
}
}
- delete this._events;
+ this._events = null;
if (this.immediateparent && this.immediateparent.subnodes) {
for( var i = this.immediateparent.subnodes.length - 1; i >= 0; i-- ){
@@ -1938,7 +1931,7 @@
}
}
- delete this.data;
+ this.data = null;
if ($profile) {
var nm = this['_profile_name'];
@@ -2005,7 +1998,7 @@
* @access private
*/
function toString (){
- return this.constructor.classname + " " + this.getDebugIdentification();
+ return this['constructor'].classname + " " +
this.getDebugIdentification();
}
/**
@@ -2030,8 +2023,8 @@
(this.parent[this.name] === this)) {
return '.' + this.name;
} else {
- // Don't use LzNode.toString, which is lame
- if (this.toString !== LzNode.prototype.toString) {
+ // Don't use LFCNode.toString, which is lame
+ if (this.toString !== LFCNode.prototype.toString) {
return String(this);
} else {
// Return empty string so __String does not call toString
@@ -2114,3 +2107,19 @@
+dynamic class LzNode extends LFCNode {
+
+/** @access private
+ * @modifiers override
+ */
+ static var tagname = 'node';
+ ConstructorMap[tagname] = LzNode;
+
+
+ function LzNode ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
+ super(parent,attrs,children,instcall);
+ }
+
+}
+
+
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
2008-01-17 22:05:43 UTC (rev 7849)
@@ -18,6 +18,7 @@
import flash.display.*;
import flash.events.*;
import flash.utils.*;
+ import flash.text.*;
}#
@@ -40,12 +41,31 @@
LzIdleKernel.addCallback( this, '__idleupdate' );
+ //var idleTimerPeriod = 16; // msecs
var idleTimerPeriod = 31; // msecs
+
trace('idle timer period = ', idleTimerPeriod , 'msecs');
LzIdleKernel.startTimer( idleTimerPeriod );
+
+ ////////////////////////////////////////////////////////////////
+ // cheapo debug console
+ lzconsole = this;
+ var tfield:TextField = new TextField();
+ tfield.x = 0;
+ tfield.y = 580;
+ tfield.width = 1000;
+ tfield.height = 20;
+ tfield.border = true;
+ consoletext = tfield;
+ ////////////////////////////////////////////////////////////////
+
}
+ public var consoletext:TextField;
+ public function write (msg:*) {
+ consoletext.text = msg;
+ }
/**
* __idleupdate is a callback function from LzIdleKernel.
* Treat it as a static function (ie. Don't reference 'this')
@@ -65,7 +85,7 @@
// contains {ptype, class, frames, width, height}
// ptype is one of "ar" (app relative) or "sr" (system relative)
var LzResourceLibrary = {};
+var lzconsole;
-
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -8,8 +8,13 @@
*/
-dynamic class LzCanvas extends LzView {
+dynamic class LzCanvas extends LFCView {
+ #passthrough (toplevel:true) {
+ import flash.utils.*;
+ }#
+
+
/**
* @access private
* @modifiers override
@@ -17,28 +22,26 @@
static var tagname = 'canvas';
ConstructorMap[tagname] = LzCanvas;
- static var getters = new LzInheritedHash(LzView.getters);
- static var defaultattrs = new LzInheritedHash(LzView.defaultattrs);
- static var options = new LzInheritedHash(LzView.options);
- static var setters = new LzInheritedHash(LzView.setters);
- static var __LZdelayedSetters:* = new
LzInheritedHash(LzView.__LZdelayedSetters);
- static var earlySetters:* = new LzInheritedHash(LzView.earlySetters);
+ static var getters = new LzInheritedHash(LFCView.getters);
+ static var defaultattrs = new LzInheritedHash(LFCView.defaultattrs);
+ static var options = new LzInheritedHash(LFCView.options);
+ static var setters = new LzInheritedHash(LFCView.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCView.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCView.earlySetters);
- override function installSetters () {
- this.setters = LzCanvas.setters;
- this.getters = LzCanvas.getters;
- this.defaultattrs = LzCanvas.defaultattrs;
- this.options = LzCanvas.options;
- this.__LZdelayedSetters = LzCanvas.__LZdelayedSetters;
- this.earlySetters = LzCanvas.earlySetters;
- }
-
var resourcetable:*;
var _lzinitialsubviews:*;
var totalnodes:*;
var framerate:*;
var creatednodes:*;
+ /* These are passed in by the compiler as attributes */
+ var __LZproxied;
+ var embedfonts;
+ var lpsbuild;
+ var lpsbuilddate;
+ var runtime;
+
var __LZmouseupDel:LzDelegate;
var __LZmousedownDel:LzDelegate;
var __LZmousemoveDel:LzDelegate;
@@ -272,8 +275,8 @@
//this.isinited = false;
//Debug.write('LzCanvas.initDone');
- //LzInstantiator.requestInstantiation( this, sva );
- LzInstantiator.createImmediate( this, sva );
+ LzInstantiator.requestInstantiation( this, sva );
+ // LzInstantiator.createImmediate( this, sva );
}
@@ -286,6 +289,11 @@
*/
override function init (){
trace("LzCanvas.init called");
+
+ // cheapo debugger printing
+ var tf = lzconsole.consoletext;
+ sprite.addChild(tf);
+ lzconsole.write("elapsed time "+getTimer()+" msec");
}
/**
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
2008-01-17 22:05:43 UTC (rev 7849)
@@ -426,6 +426,7 @@
*/
function init (){
Debug.write("LzCanvas.init called");
+ new LzText(canvas, {x: 0, y:0, text: 'elapsed time '+getTimer()+' msec'});
}
/**
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -11,38 +11,31 @@
*/
-dynamic class LzView extends LzNode {
+class LFCView extends LFCNode {
- static var tagname = 'view';
- ConstructorMap[tagname] = LzView;
+ static var getters = new LzInheritedHash(LFCNode.getters);
+ static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
+ static var options = new LzInheritedHash(LFCNode.options);
+ static var setters = new LzInheritedHash(LFCNode.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCNode.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCNode.earlySetters);
- static var getters = new LzInheritedHash(LzNode.getters);
- static var defaultattrs = new LzInheritedHash(LzNode.defaultattrs);
- static var options = new LzInheritedHash(LzNode.options);
- static var setters = new LzInheritedHash(LzNode.setters);
- static var __LZdelayedSetters:* = new
LzInheritedHash(LzNode.__LZdelayedSetters);
- static var earlySetters:* = new LzInheritedHash(LzNode.earlySetters);
+ LFCView.setters.clip = -1;
+ LFCView.setters.x ="setX";
+ LFCView.setters.y = "setY";
- LzView.setters.clip = -1;
- LzView.setters.x ="setX";
- LzView.setters.y = "setY";
-
- override function installSetters () {
- this.setters = LzView.setters;
- this.getters = LzView.getters;
- this.defaultattrs = LzView.defaultattrs;
- this.options = LzView.options;
- this.__LZdelayedSetters = LzView.__LZdelayedSetters;
- this.earlySetters = LzView.earlySetters;
- }
-
- function LzView ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
+ function LFCView ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
super(parent,attrs,children,instcall);
}
-
+ var animators:*;
+ var _height;
+ var _width;
+ var _y;
+ var _x;
+ var _resource;
+ var __LZhaser;
-
var onaddsubview = LzDeclaredEvent;
/** @access private */
var onbgcolor = LzDeclaredEvent;
@@ -246,7 +239,7 @@
/**
* Base level constructor for views. See <method
- * classname="LzNode">construct</method> for more on this.
+ * classname="LFCNode">construct</method> for more on this.
*
* @access protected
*/
@@ -257,7 +250,7 @@
var ip = this.immediateparent;
if (ip == null) {
- //trace("LzView.construct immediateparent == null", this.id);
+ //trace("LFCView.construct immediateparent == null", this.id);
}
if (ip) {
@@ -281,7 +274,7 @@
var r =null;
if ('resource' in args && args['resource'] != null ){
r = args.resource;
- args.resource = LzNode._ignoreAttribute;
+ args.resource = LFCNode._ignoreAttribute;
}
if ('clip' in args && args['clip']){
if (this.sprite) this.makeMasked();
@@ -315,12 +308,11 @@
*/
function __makeSprite(args) {
this.sprite = new LzSprite(this, false, args);
- //trace("LzView.__makeSprite", sprite, args);
}
/**
* Called right before the view is shown. See <method
- * classname="LzNode">init</method> for more.
+ * classname="LFCNode">init</method> for more.
*
* @access protected
*/
@@ -336,15 +328,12 @@
* @param LzView s: The new subview
*/
function addSubview ( s ){
- //trace('entering addSubview ', this.sprite, s, s.sprite);
if (this.sprite) {
- //trace('adding subview ', this.sprite, s, s.sprite);
this.sprite.addChildSprite(s.sprite);
}
if ( s.addedToParent ) return;
- // trace(' .... adding to subviews list');
// Don't use the prototype's default subviews array, it is a
// sentinel which lives on the prototype and is shared by all
// instances, make a new one if you want to push a view.
@@ -371,7 +360,7 @@
*/
override function __LZinstantiationDone (){
if (this.immediateparent) {
- this.immediateparent.addSubview( this );
+ (LFCView(this.immediateparent)).addSubview( this );
} else {
// trace("LaszloView.__LZinstantiationDone immediateparent =
null");
}
@@ -409,13 +398,13 @@
var clip = false;
-LzView.setters.rotation= "setRotation";
-LzView.setters.opacity = "setOpacity";
+LFCView.setters.rotation= "setRotation";
+LFCView.setters.opacity = "setOpacity";
/** @access private */
-LzView.setters.alpha = "setOpacity";
-LzView.setters.visible = "setVisible"
+LFCView.setters.alpha = "setOpacity";
+LFCView.setters.visible = "setVisible"
/** @access private */
-LzView.setters.visibility = "setVisibility"
+LFCView.setters.visibility = "setVisibility"
/**
* @lzxtype "left" | "center" | "right" | constraint
@@ -423,7 +412,7 @@
* @keywords final
*/
var align = "left"
-LzView.setters.align = "setAlign"
+LFCView.setters.align = "setAlign"
/**
* Creates a constraint on the view's y position which is a function
@@ -433,7 +422,7 @@
* @lzxdefault "top"
*/
var valign = "top"
-LzView.setters.valign = "setValign"
+LFCView.setters.valign = "setValign"
/** The URL from which to load the resource for this
* view. If this attribute is set, the media for the view is loaded
@@ -450,11 +439,11 @@
* a setter. [bshine 2007.11.07]
* @access private
*/
-LzView.setters.source = "setSource";
+LFCView.setters.source = "setSource";
/** The background color of the canvas.
* @lzxtype token
*/
-LzView.setters.bgcolor = "setBGColor";
+LFCView.setters.bgcolor = "setBGColor";
/** Sets the name of this views resource, or the URL from which it should
* be loaded.
@@ -463,20 +452,20 @@
/// TODO HQM 01 2008 remove this dupe declaration of 'resource' from the
source when merging
//var resource;
-LzView.setters.resource = "setResource";
+LFCView.setters.resource = "setResource";
/** If true, this view intercepts click events; otherwise they are passed
* to its container. This defaults to true if the view defines a mouse
* event handler or a cursor.
* @lzxtype boolean
*/
-LzView.setters.clickable = "setClickable";
+LFCView.setters.clickable = "setClickable";
/** Setting clickRegion to a vector-based SWF turns the SWF shape into a
clickable hotspot.
* @access public
* @lzxtype string
*/
var clickregion;
-LzView.setters.clickregion = "__LZsetClickRegion";
+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
* any view with clickable=true, or any view whose class defaults
@@ -484,14 +473,14 @@
* @lzxtype token
*/
var cursor;
-LzView.setters.cursor = "setCursor";
+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;
-LzView.setters.fgcolor = "setColor";
+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
* (<code>fontstyle</code> and <code>fontsize</code> too) these
@@ -502,7 +491,7 @@
* @lzxtype string
*/
var font;
-LzView.setters.font = "setFontName" ;
+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".
@@ -526,54 +515,54 @@
* @lzxdefault "none"
*/
var stretches = "none";
-LzView.setters.stretches = "stretchResource";
+LFCView.setters.stretches = "stretchResource";
/** If true, the resource attached to this view begins playing when
* the view is instantiated.
* @lzxtype boolean
*/
-LzView.setters.play = "setPlay";
+LFCView.setters.play = "setPlay";
/** Show or hide the handcursor for this view, if clickable */
-LzView.setters.showhandcursor = "setShowHandCursor";
+LFCView.setters.showhandcursor = "setShowHandCursor";
var layout;
-LzView.setters.layout = "setLayout";
+LFCView.setters.layout = "setLayout";
/** Activate/inactivate children for accessibility
* @type Boolean
* @lzxtype boolean
*/
var aaactive;
-LzView.setters.aaactive = "setAAActive";
+LFCView.setters.aaactive = "setAAActive";
/** Set accessibility name
* @type String
* @lzxtype string
*/
var aaname;
-LzView.setters.aaname = "setAAName";
+LFCView.setters.aaname = "setAAName";
/** Set accessibility description
* @type String
* @lzxtype string
*/
var aadescription;
-LzView.setters.aadescription = "setAADescription";
+LFCView.setters.aadescription = "setAADescription";
/** Set accessibility tab order
* @type Number
* @lzxtype number
*/
var aatabindex;
-LzView.setters.aatabindex = "setAATabIndex";
+LFCView.setters.aatabindex = "setAATabIndex";
/** Set accessibility silencing/unsilencing
* @type Boolean
* @lzxtype boolean
*/
var aasilent;
-LzView.setters.aasilent = "setAASilent";
+LFCView.setters.aasilent = "setAASilent";
-LzView.__LZdelayedSetters.layout = "setLayout";
+LFCView.__LZdelayedSetters.layout = "setLayout";
-LzView.earlySetters.clickregion = 7;
-LzView.earlySetters.stretches = 8;
+LFCView.earlySetters.clickregion = 7;
+LFCView.earlySetters.stretches = 8;
/** A value to be added to the
* <attribute>x</attribute> position of this view before drawing
@@ -582,14 +571,14 @@
* internal coordinate system.
* @type Number
*/
-LzView.setters.xoffset = "setXOffset";
+LFCView.setters.xoffset = "setXOffset";
/** A value to be added to the <attribute>y</attribute> position of this view
* before drawing it. This affects the apparent rotation point of the view, as
* well as its apparent <attribute>y</attribute> position. It does not affect
the view's width or its
* internal coordinate system.
* @type Number
*/
-LzView.setters.yoffset = "setYOffset";
+LFCView.setters.yoffset = "setYOffset";
/** @access private */
var sprite:LzSprite = null;
@@ -665,7 +654,7 @@
* @lzxtype sizeExpression
*/
var width:Number = 0;
-LzView.setters.width = "setWidth";
+LFCView.setters.width = "setWidth";
/**
* The height of the view
@@ -674,7 +663,7 @@
* @lzxtype sizeExpression
*/
var height:Number = 0;
-LzView.setters.height = "setHeight";
+LFCView.setters.height = "setHeight";
/** If stretches is not set to none, the width
* that this view would be if it weren't stretched. This attribute can be used
@@ -747,7 +736,7 @@
* know what frame the resource is showing while it is playing.
*/
var frame = 0;
-LzView.setters.frame = "setResourceNumber";
+LFCView.setters.frame = "setResourceNumber";
/** @keywords deprecated
* @access private
@@ -1142,8 +1131,8 @@
this.sprite.setWidth(newsize);
if (this.onwidth.ready) this.onwidth.sendEvent( newsize );
- if (this.immediateparent && this.immediateparent.__LZcheckwidth)
- this.immediateparent.__LZcheckwidthFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckwidth)
+ (LFCView(this.immediateparent)).__LZcheckwidthFunction( this );
}
}
@@ -1167,8 +1156,8 @@
this.sprite.setHeight(newsize);
if (this.onheight.ready) this.onheight.sendEvent( newsize );
- if (this.immediateparent && this.immediateparent.__LZcheckheight)
- this.immediateparent.__LZcheckheightFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckheight)
+ (LFCView(this.immediateparent)).__LZcheckheightFunction( this );
}
}
@@ -1424,8 +1413,8 @@
if ( this.pixellock ) v = Math.floor( v );
this.sprite.setX(v)
- if (this.immediateparent && this.immediateparent.__LZcheckwidth)
- this.immediateparent.__LZcheckwidthFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckwidth)
+ (LFCView(this.immediateparent)).__LZcheckwidthFunction( this );
if (this.onx.ready) this.onx.sendEvent( this.x );
}
}
@@ -1451,8 +1440,8 @@
if ( this.pixellock ) v = Math.floor( v );
this.sprite.setY(v)
- if (this.immediateparent && this.immediateparent.__LZcheckheight)
- this.immediateparent.__LZcheckheightFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckheight)
+ (LFCView(this.immediateparent)).__LZcheckheightFunction( this
);
if (this.ony.ready) this.ony.sendEvent( this.y );
}
}
@@ -1474,16 +1463,16 @@
this.setY( this.y, true );
}
- if (this.immediateparent && this.immediateparent.__LZcheckwidth)
- this.immediateparent.__LZcheckwidthFunction( this );
- if (this.immediateparent && this.immediateparent.__LZcheckheight)
- this.immediateparent.__LZcheckheightFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckwidth)
+ (LFCView(this.immediateparent)).__LZcheckwidthFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckheight)
+ (LFCView(this.immediateparent)).__LZcheckheightFunction( this );
}
function setWidth ( v , ignore = null){
if (this._width != v) {
this._width = v;
- //Debug.write('LzView.setWidth', this, v, this.sprite);
+ //Debug.write('LFCView.setWidth', this, v, this.sprite);
this.sprite.setWidth(v);
if ( v == null ){
@@ -1514,8 +1503,8 @@
//this.__LZbgRef._xscale = v;
- if (this.immediateparent && this.immediateparent.__LZcheckwidth)
- this.immediateparent.__LZcheckwidthFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckwidth)
+ (LFCView(this.immediateparent)).__LZcheckwidthFunction( this );
if (this.onwidth.ready) this.onwidth.sendEvent( v );
@@ -1561,8 +1550,8 @@
}
this.hassetheight = true;
- if (this.immediateparent && this.immediateparent.__LZcheckheight)
- this.immediateparent.__LZcheckheightFunction( this );
+ if (this.immediateparent &&
(LFCView(this.immediateparent)).__LZcheckheight)
+ (LFCView(this.immediateparent)).__LZcheckheightFunction( this );
if (this.onheight.ready) this.onheight.sendEvent( v );
@@ -1573,4 +1562,20 @@
}
+dynamic class LzView extends LFCView {
+ static var getters = new LzInheritedHash(LFCView.getters);
+ static var defaultattrs = new LzInheritedHash(LFCView.defaultattrs);
+ static var options = new LzInheritedHash(LFCView.options);
+ static var setters = new LzInheritedHash(LFCView.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCView.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCView.earlySetters);
+
+
+ static var tagname = 'view';
+ ConstructorMap[tagname] = LzView;
+ function LzView ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
+ super(parent,attrs,children,instcall);
+ }
+
+}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
2008-01-17 22:05:43 UTC (rev 7849)
@@ -34,6 +34,8 @@
#include "views/platform/LzPlatform.lzs"
} else if ($svg) {
#include "views/platform/svg/LzPlatform.js"
+} else if ($swf9) {
+
} else {
Debug.error('views/Library.lzs unsupported runtime %s', $runtime)
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
2008-01-17 20:07:13 UTC (rev 7848)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
2008-01-17 22:05:43 UTC (rev 7849)
@@ -72,30 +72,19 @@
* the initial text value.
*/
// TODO [hqm 2008-01] removed "with LzFormatter" until we get mixins working
-dynamic class LzText extends LzView {
+class LFCText extends LFCView {
- static var tagname = 'text';
- ConstructorMap[tagname] = LzText;
-
var tsprite:LzTextSprite;
- static var getters = new LzInheritedHash(LzView.getters);
- static var defaultattrs = new LzInheritedHash(LzView.defaultattrs);
- static var options = new LzInheritedHash(LzView.options);
- static var setters = new LzInheritedHash(LzView.setters);
- static var __LZdelayedSetters:* = new
LzInheritedHash(LzView.__LZdelayedSetters);
- static var earlySetters:* = new LzInheritedHash(LzView.earlySetters);
+ static var getters = new LzInheritedHash(LFCView.getters);
+ static var defaultattrs = new LzInheritedHash(LFCView.defaultattrs);
+ static var options = new LzInheritedHash(LFCView.options);
+ static var setters = new LzInheritedHash(LFCView.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCView.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCView.earlySetters);
- override function installSetters () {
- this.setters = LzText.setters;
- this.getters = LzText.getters;
- this.defaultattrs = LzText.defaultattrs;
- this.options = LzText.options;
- this.__LZdelayedSetters = LzText.__LZdelayedSetters;
- this.earlySetters = LzText.earlySetters;
- }
- function LzText ( parent:* , attrs:* = null , children:* = null,
instcall:* = null) {
+ function LFCText ( parent:* , attrs:* = null , children:* = null,
instcall:* = null) {
super(parent,attrs,children,instcall);
// TODO [hqm 2008-01] How can we make this a static block
@@ -103,22 +92,34 @@
/*
if (LzSprite.capabilities.advancedfonts) {
- LzText.setters.antiAliasType = "setAntiAliasType";
- LzText.defaultattrs.antiAliasType = "normal";
+ LFCText.setters.antiAliasType = "setAntiAliasType";
+ LFCText.defaultattrs.antiAliasType = "normal";
+ LFCText.setters.antiAliasType = "setAntiAliasType";
+ LFCText.defaultattrs.antiAliasType = "normal";
- LzText.setters.gridFit = "setGridFit";
- LzText.defaultattrs.gridfit = "subpixel";
+ LFCText.setters.gridFit = "setGridFit";
+ LFCText.defaultattrs.gridfit = "subpixel";
- LzText.setters.sharpness = "setSharpness";
- LzText.defaultattrs.sharpness = 0;
+ LFCText.setters.sharpness = "setSharpness";
+ LFCText.defaultattrs.sharpness = 0;
- LzText.setters.thickness = "setThickness";
- LzText.defaultattrs.thickness = 0;
+ LFCText.setters.thickness = "setThickness";
+ LFCText.defaultattrs.thickness = 0;
+
}
*/
}
+ var maxlines = 1;
+ var selectable = false;
+ var antiAliasType = "normal";
+ var gridFit = "subpixel";
+ var sharpness = 0;
+ var thickness = 0;
+
+
+
var password;
var sizeToHeight;
@@ -179,7 +180,7 @@
return 0;
}
-LzText.defaultattrs.pixellock = true;
+LFCText.defaultattrs.pixellock = true;
/**
* If true, the lines of text are wrapped to fit within the text
@@ -261,9 +262,9 @@
this.tsprite.__initTextProperties(args);
trace("__initTextProperties", lzutils.objAsString(args));
- args.font = LzNode._ignoreAttribute;
- args.fontsize = LzNode._ignoreAttribute;
- args.fontstyle = LzNode._ignoreAttribute;
+ args.font = LFCNode._ignoreAttribute;
+ args.fontsize = LFCNode._ignoreAttribute;
+ args.fontstyle = LFCNode._ignoreAttribute;
if ('maxlength' in args && args.maxlength != null) {
this.setMaxLength(args.maxlength);
@@ -373,7 +374,7 @@
/**
- * Get a reference to the control mc (overridden from LzView)
+ * Get a reference to the control mc (overridden from LFCView)
* @access private
*/
function getMCRef () {
@@ -384,23 +385,23 @@
/**
* @access private
*/
-LzText.setters.text = "setText";
+LFCText.setters.text = "setText";
/**
* @access private
*/
-LzText.setters.resize = "setResize";
+LFCText.setters.resize = "setResize";
/**
* @access private
*/
-LzText.setters.multiline = -1;
+LFCText.setters.multiline = -1;
/**
* @access private
*/
-LzText.setters.yscroll = "setYScroll";
+LFCText.setters.yscroll = "setYScroll";
/**
* @access private
*/
-LzText.setters.xscroll = "setXScroll";
+LFCText.setters.xscroll = "setXScroll";
/**
* If true, the text is selectable
@@ -409,8 +410,8 @@
* @modifiers virtual
*/
// no var decl since this is a virtual field
-LzText.setters.selectable = "setSelectable";
-LzText.defaultattrs.selectable = false;
+LFCText.setters.selectable = "setSelectable";
+LFCText.defaultattrs.selectable = false;
/**
* @lzxtype numberExpression
@@ -418,7 +419,7 @@
*/
var maxlength;
/** @access private */
-LzText.setters.maxlength = "setMaxLength";
+LFCText.setters.maxlength = "setMaxLength";
/**
* @lzxtype string
@@ -426,14 +427,14 @@
*/
var pattern;
/** @access private */
-LzText.setters.pattern = "setPattern";
+LFCText.setters.pattern = "setPattern";
-LzText.defaultattrs.clip = true;
+LFCText.defaultattrs.clip = true;
/**
* setResize set behavior of text field width when new text is added.
- * LzText only (cannot be used with LzInputText).
+ * LFCText only (cannot be used with LzInputText).
* @param Boolean val: if true, the textfield will recompute it's width after
setText() is called
*/
function setResize ( val, ignore = null ){
@@ -472,7 +473,7 @@
*/
//Abstract method
-//LzText.prototype.setText
+//LFCText.prototype.setText
/**
* Appends the string to the current text in the textfield.
@@ -548,7 +549,7 @@
* @access private
*/
override function toString ( ){
- return "LzText: " + this.getText();
+ return "LFCText: " + this.getText();
}
@@ -620,15 +621,15 @@
/**
* @access private
*/
-LzText.setters.font = "setFontName";
+LFCText.setters.font = "setFontName";
/**
* @access private
*/
-LzText.setters.fontsize = "setFontSize";
+LFCText.setters.fontsize = "setFontSize";
/**
* @access private
*/
-LzText.setters.fontstyle = "setFontStyle";
+LFCText.setters.fontstyle = "setFontStyle";
/**
* @access private
@@ -843,11 +844,11 @@
var t = ts == null ? this.text : ts;
var i;
- for ( var ec in LzText.escapeChars ){
+ for ( var ec in LFCText.escapeChars ){
while( t.indexOf( ec ) > -1 ){
i = t.indexOf( ec );
- t = t.substring( 0 , i ) + LzText.escapeChars[ ec ] +
+ t = t.substring( 0 , i ) + LFCText.escapeChars[ ec ] +
t.substring( i+1 );
}
}
@@ -1129,4 +1130,24 @@
*/
}
-} // End of LzText
+} // End of LFCText
+
+
+public dynamic class LzText extends LFCText {
+ static var tagname = 'text';
+ ConstructorMap[tagname] = LzText;
+
+ static var getters = new LzInheritedHash(LFCText.getters);
+ static var defaultattrs = new LzInheritedHash(LFCText.defaultattrs);
+ static var options = new LzInheritedHash(LFCText.options);
+ static var setters = new LzInheritedHash(LFCText.setters);
+ static var __LZdelayedSetters:* = new
LzInheritedHash(LFCText.__LZdelayedSetters);
+ static var earlySetters:* = new LzInheritedHash(LFCText.earlySetters);
+
+
+ function LzText ( parent:* , attrs:* , children:* = null, instcall:* =
null) {
+ super(parent,attrs,children,instcall);
+ }
+
+}
+
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
===================================================================
---
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
2008-01-17 20:07:13 UTC (rev 7848)
+++
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
2008-01-17 22:05:43 UTC (rev 7849)
@@ -114,7 +114,9 @@
compiler.setProperty(CompilationEnvironment.RUNTIME_PROPERTY,
LPS.getProperty("compiler.runtime.default",
LPS.getRuntimeDefault()));
- boolean flushScriptCache = false;
+ // TODO [hqm 2008-01] I set this to true because when working on
+ // the LFC, I frequently get screwed by using cached script.
+ boolean flushScriptCache = true;
for (int i = 0; i < args.length; i++) {
String arg = args[i].intern();
@@ -293,7 +295,7 @@
}
/**
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights
* Reserved. Use is subject to license terms.
*/
Modified: openlaszlo/branches/devildog/test/swf9/hello.lzx
===================================================================
--- openlaszlo/branches/devildog/test/swf9/hello.lzx 2008-01-17 20:07:13 UTC
(rev 7848)
+++ openlaszlo/branches/devildog/test/swf9/hello.lzx 2008-01-17 22:05:43 UTC
(rev 7849)
@@ -2,6 +2,17 @@
<!-- <text bgcolor="#ccffcc">Hello OpenLaszlo!</text> -->
<text oninit="this.setText('runtime='+canvas.runtime)"/>
+ <text y="20" name="mytimer">
+ <method name="tellTime" args="tt">
+ this.setText("time = "+tt+" msecs");
+ </method>
+ </text>
+
+ <method event="oninit" >
+ var d = new LzDelegate( canvas.mytimer , "tellTime" );
+ LzIdle.callOnIdle( d );
+ </method>
+
<view x="200" y="10" resource="testmedia/cherry.png"
onclick="this.animate('rotation', 45, 1000, true)">
<handler name="oninit">
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins