[Laszlo-checkins] r8370 - in openlaszlo/branches/devildog/WEB-INF/lps/lfc: compiler controllers core helpers kernel/dhtml services services/platform/dhtml services/platform/swf services/platform/swf9 views
hqm@openlaszlo.org
hqm at openlaszlo.org
Mon Mar 24 11:04:58 PDT 2008
Author: hqm
Date: 2008-03-24 11:04:46 -0700 (Mon, 24 Mar 2008)
New Revision: 8370
Added:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzModeManager.js
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/dhtml/LzModeManager.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf/LzModeManager.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.lzs
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzViewLinkage.lzs
Log:
Change 20080324-hqm-Q by hqm at badtzmaru.local on 2008-03-24 14:03:52 EDT
in /Users/hqm/openlaszlo/devildog2
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: more merging of swf9/swf8 LFC code
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
swf8/dhtml smokecheck, calendar
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/compiler/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -3,7 +3,7 @@
/**
* Compiler runtime support
*
- * @copyright Copyright 2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2007, 2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @access private
@@ -16,6 +16,10 @@
if ($swf9) {
+// Debugger requires this, so must be loaded very early
+#include "compiler/LzFormatter.lzs"
+
+
} else {
// Basic runtime and stubs
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloAnimation.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -31,8 +31,14 @@
* @shortdesc Changes the value of another object's attribute over time.
* @see animatorgroup
*/
-class LzAnimator extends LzAnimatorGroup {
+dynamic class LzAnimator extends LzAnimatorGroup {
+ function LzAnimator ( parent:* , attrs:* , children:* = null, instcall:* = null) {
+ super(parent,attrs,children,instcall);
+ this.calcMethod = this.calcNextValue;
+ }
+
+
/** @access private
* @modifiers override
*/
@@ -40,37 +46,22 @@
/** @access private */
static var attributes = new LzInheritedHash(LzAnimatorGroup.attributes);
-var beginPoleDelta = .25;
-var endPoleDelta = .25;
+var calcMethod:Function;
-/** 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.
- * @lzxtype token
- */
-var attribute;
+var lastIterationTime:Number;
+var currentValue:Number;
+var doBegin:Boolean;
-/**
- * The style of motion to use for the animator. This
- * is one of "linear", "easin" , "easeout" , and "easeboth". The default
- * is "easeboth"
- *
- * @type String
- */
-var motion;
+var beginPoleDelta:Number = .25;
+var endPoleDelta:Number = .25;
-/**
- * The destination value for the animator.
- *
- * @type Number
- */
-var to;
+var primary_K:Number;
+var origto:Number;
-
/**
* @access private
*/
-function construct ( parent , args ){
+override function construct ( parent , args ){
super.construct.apply(this, arguments);
this.primary_K = 1.0;
}
@@ -86,9 +77,9 @@
this.motion = eparam
//easin, easeout , linear , easeboth (default)
if ( eparam == "linear" ){
- this.calcNextValue = this.calcNextValueLinear;
+ this.calcMethod = this.calcNextValueLinear;
} else {
- delete this.calcNextValue;
+ this.calcMethod = this.calcNextValue;
if ( eparam == "easeout" ){
this.beginPoleDelta = 100;
} else if ( eparam == "easein" ){
@@ -134,7 +125,7 @@
*
* @access private
*/
-function calcControlValues ( cval ){
+function calcControlValues ( cval = null){
// reset currentValue
this.currentValue = cval || 0;
@@ -180,7 +171,7 @@
*
* @access private
*/
-function doStart (){
+override function doStart (){
if ( this.isactive ) return;
this.isactive = true;
@@ -194,7 +185,7 @@
/**
* @access private
*/
-function prepareStart ( ){
+override function prepareStart ( ){
// create a "repeat" counter to be decremented each time after the
// animator finishes a cycle.
this.crepeat = this.repeat;
@@ -239,7 +230,7 @@
* reset the time variables and currentValue
* @access private
*/
-function resetAnimator() {
+override function resetAnimator() {
// Set the attribute of the view to its "from" value but make sure
// expectedAttribute is updated.
if ( this.from != null ){
@@ -291,7 +282,7 @@
/**
* @access private
*/
-function stop( ) {
+override function stop( ) {
if ( !this.isactive ) return;
var e_prop = "e_" + this.attribute;
@@ -310,7 +301,7 @@
/**
* @access private
*/
-function __LZfinalizeAnim( ) {
+override function __LZfinalizeAnim( ) {
var e_prop = "e_" + this.attribute;
if (!this.target[e_prop].c) { this.target[e_prop].c = 0; }
this.target[e_prop].c -= 1; //decrement animation counter for prop
@@ -381,7 +372,7 @@
* value.
* @return animatorIsDone: a boolean indicating if the animation is complete
*/
-function update( time ) {
+public override function update( time ) {
var animatorIsDone = false;
// If this is its first iteration then calc the necessary paramters.
@@ -394,7 +385,7 @@
if ( !this.paused ) {
var aTotalTimeDifference = time - this.startTime;
if ( aTotalTimeDifference < this.duration ) {
- this.setValue( this.calcNextValue( aTotalTimeDifference ));
+ this.setValue( this.calcMethod( aTotalTimeDifference ));
this.lastIterationTime = time;
} else {
this.setValue( this.to );
@@ -426,9 +417,11 @@
/**
* @access private
*/
-function toString(){
+override function toString(){
return "Animator for " + this.target + " attribute:" + this.attribute + " to:" + this.to;
}
} // End of LzAnimator
+
+ConstructorMap[LzAnimator.tagname] = LzAnimator;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LaszloLayout.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -59,15 +59,28 @@
* @lzxname layout
*/
-class LzLayout extends LzNode {
+dynamic class LzLayout extends LzNode {
+
/** @access private
+ * Just used to effect a type cast of immediateparent to LzView
+ */
+ var vip:LzView = null;
+
+ function LzLayout ( parent:* , attrs:* , children:* = null, instcall:* = null) {
+ super(parent,attrs,children,instcall);
+ }
+
+/** @access private
* @modifiers override
*/
static var tagname = 'layout';
/** @access private */
static var attributes = new LzInheritedHash(LzNode.attributes);
+ /** @access private */
+ var initDelegate;
+
/**
* Set to true if layout is locked from updates.
* @type Boolean
@@ -115,17 +128,27 @@
*
* @access private
*/
-function construct ( view , args) {
+override function construct ( view , args) {
super.construct.apply(this, arguments);
this.subviews = new Array;
+ // TODO [hqm 2008-03] this is a hack to cast to type LzView for
+ // the SWF9 compiler, until the compiler is taught to understand
+ // type casting DHTML/SWF8
+ if ($swf9) {
+ this.vip = LzView(this.immediateparent);
+ } else {
+ this.vip = this.immediateparent;
+ }
+
+
// 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 ( this.vip.layouts == null ){
+ this.vip.layouts = [ this ];
} else {
- this.immediateparent.layouts.push( this );
+ this.vip.layouts.push( this );
}
this.updateDelegate = new LzDelegate( this , "update" );
@@ -145,7 +168,7 @@
/**
* @access private
*/
-function constructWithArgs ( args ) {
+override function constructWithArgs ( args ) {
//all layouts need to know when their view adds/deletes a subview
this.delegates.push( new LzDelegate ( this, "gotNewSubview",
this.immediateparent,"onaddsubview" ));
@@ -153,10 +176,10 @@
this.delegates.push( new LzDelegate ( this, "removeSubview",
this.immediateparent, "onremovesubview" ));
- var vsl = this.immediateparent.subviews.length;
+ var vsl = this.vip.subviews.length;
for (var i = 0; i < vsl; i++){
- this.gotNewSubview( this.immediateparent.subviews[i] );
+ this.gotNewSubview( this.vip.subviews[i] );
}
}
@@ -165,7 +188,7 @@
/**
* @access private
*/
-function destroy ( ) {
+override function destroy ( recursiveCall = null) {
this.releaseLayout();
super.destroy.apply(this, arguments);
}
@@ -181,7 +204,7 @@
* funciton. This is usually unused, since more than one type of delegate can
* call reset.
*/
-function reset( e ) {
+function reset( e = null ) {
if ( this.locked ) { return; }
//defalt behavior on reset is to update
this.update( e );
@@ -297,10 +320,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 && this.vip.layouts) {
+ for ( var i = this.vip.layouts.length -1 ; i >= 0 ; i-- ){
+ if ( this.vip.layouts[ i ] == this ){
+ this.vip.layouts.splice( i , 1 );
}
}
}
@@ -401,9 +424,11 @@
/**
* @access private
*/
-function toString (){
+override function toString (){
return "LzLayout for view " + this.immediateparent;
}
}
+
+ConstructorMap[LzLayout.tagname] = LzLayout;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -7,14 +7,7 @@
* @access private
*/
-if ($swf9) {
- #include "controllers/LzAnimatorGroup.js"
- #include "controllers/LaszloAnimation.js"
- #include "controllers/LaszloLayout.js"
-} else {
- #include "controllers/LzAnimatorGroup.lzs"
- #include "controllers/LaszloAnimation.lzs"
- #include "controllers/LaszloLayout.lzs"
+#include "controllers/LzAnimatorGroup.lzs"
+#include "controllers/LaszloAnimation.lzs"
+#include "controllers/LaszloLayout.lzs"
-}
-
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/controllers/LzAnimatorGroup.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -41,8 +41,12 @@
* @see LzAnimator
*
*/
-class LzAnimatorGroup extends LzNode {
+dynamic class LzAnimatorGroup extends LzNode {
+ function LzAnimatorGroup ( parent:* , attrs:* , children:* = null, instcall:* = null) {
+ super(parent,attrs,children,instcall);
+ }
+
/** @access private
* @modifiers override
*/
@@ -58,7 +62,14 @@
* @lzxtype token
*/
var attribute;
-
+
+ var updateDel;
+ var crepeat;
+ var startTime;
+ var __LZpauseTime;
+ var actAnim;
+
+
/** Whether to start the animation instantly (the default),
* or wait for a script command.
*
@@ -163,12 +174,6 @@
*/
var process = "sequential";
- /** The object to animate
- *
- * @type string
- * @devnote see $lzc$set_target below
- */
- var target;
/** The active-state of the animator. If true, the animator is currently processing its animation.
* This field is read-only.
@@ -221,14 +226,23 @@
LzAnimatorGroup.attributes.ignoreplacement = true;
+ var vip:LzView = null;
+
/**
* @access private
*/
-function construct ( parent, args ) {
+override function construct ( parent, args ) {
super.construct.apply(this, arguments);
- if ( (this.immediateparent) instanceof ( LzAnimatorGroup ) ){
+ if ($swf9) {
+ this.vip = LzView(this.immediateparent);
+ } else {
+ this.vip = this.immediateparent;
+ }
+
+
+ if ( (this.immediateparent) is ( LzAnimatorGroup ) ){
for ( var k in this.animatorProps ){
if ( args[ k ] == null ){
args[ k ] = this.immediateparent[ k ] ;
@@ -237,7 +251,7 @@
if ( this.immediateparent.animators == null ){
this.immediateparent.animators = [ this ];
} else {
- this.immediateparent.animators.push( this );
+ this.immediateparent.animators.push( this );
}
args.start = LzNode._ignoreAttribute;
} else {
@@ -251,7 +265,7 @@
/**
* @access private
*/
-function init ( ) {
+override function init ( ) {
if (! this.target) this.target = this.immediateparent;
if ( this.started ) this.doStart();
super.init.apply(this, arguments);
@@ -266,7 +280,7 @@
var nodes = this.subnodes;
if (nodes) {
for (var i=0; i < nodes.length; i++) {
- if ((nodes[i]) instanceof ( LzAnimatorGroup )) {
+ if ((nodes[i]) is ( LzAnimatorGroup )) {
nodes[i].$lzc$set_target(new_target);
}
}
@@ -330,16 +344,6 @@
/**
* @access private
*/
-function start ( ){
- if ( $debug ){
- Debug.deprecated(this, arguments.callee, this.doStart);
- }
- this.doStart();
-}
-
-/**
- * @access private
- */
function prepareStart ( ){
for ( var i = this.animators.length-1; i >=0 ; i-- ){
this.animators[ i ].notstarted = true;
@@ -375,7 +379,7 @@
* @return a boolean indicating if all of the animations within
* this group are done.
*/
-function update( time ) {
+public function update( time ) {
var animend = this.actAnim.length -1;
if (animend > 0 && this.process == "sequential")
animend = 0;
@@ -415,7 +419,7 @@
* @param Boolean dop: If true, pauses the animator. If false, unpauses the
* animator. If null, toggles the paused state of the animator.
*/
-function pause ( dop ){
+function pause ( dop = null){
if ( dop == null ){
dop = !this.paused;
}
@@ -475,11 +479,11 @@
duration = Number(duration);
}
this.duration = duration;
- if(!(this instanceof LzAnimator)){
+ if(!(this is LzAnimator)){
var sn = this.subnodes;
if(sn){
for(var i = 0; i < sn.length; ++i){
- if(sn[i] instanceof LzAnimatorGroup){
+ if(sn[i] is LzAnimatorGroup){
sn[i].setDuration(duration);
}
}
@@ -526,24 +530,24 @@
/**
* @access private
*/
-function destroy( ) {
+override function destroy( recursiveCall = null) {
this.stop();
this.updateDel.unregisterAll();
this.animators = null;
this.actAnim = null;
- if ( this.parent.animators && this.parent.animators.length ){
- for ( var i = 0 ; i < this.parent.animators.length ; i++ ){
- if ( this.parent.animators[ i ] == this ){
- this.parent.animators.splice( i , 1 );
- break
+ if ( this.parent.animators && this.parent.animators.length){
+ for ( var i = 0 ; i < this.parent.animators.length ; i++ ){
+ if ( this.parent.animators[ i ] == this ){
+ this.parent.animators.splice( i , 1 );
+ break;
+ }
}
- }
- for ( var i = 0 ; i < this.parent.actAnim.length ; i++ ){
- if ( this.parent.actAnim[ i ] == this ){
- this.parent.actAnim.splice( i , 1 );
- break
+ for ( var i = 0 ; i < LzAnimatorGroup(this.parent).actAnim.length ; i++ ){
+ if ( LzAnimatorGroup(this.parent).actAnim[ i ] == this ){
+ LzAnimatorGroup(this.parent).actAnim.splice( i , 1 );
+ break;
}
}
}
@@ -554,9 +558,10 @@
/**
* @access private
*/
-function toString( ) {
+override function toString( ) {
return "GroupAnimator length = " + this.animators.length;
}
} // End of LzAnimatorGroup
+ConstructorMap[LzAnimatorGroup.tagname] = LzAnimatorGroup;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -13,12 +13,10 @@
if ($swf9) {
#include "core/dummyclasses.js"
}
-
#include "core/LzNode.lzs"
if ($swf9) {
-
} else {
#include "core/UserClass.lzs"
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -32,7 +32,7 @@
* defaultplacement in lexical parent). See the
* <method>LzNode.determinePlacement</method> method. Defaults to false.
*/
-class LzNode {
+public dynamic class LzNode {
/** @access private
* @modifiers override
@@ -50,6 +50,7 @@
var data:* = null;
var classChildren:Array = null;
var __LZvizDat:Boolean = true;
+ var animators:Array = null;
if ($swf9) {
@@ -593,7 +594,7 @@
* @type Number
* @keywords readonly
*/
-var nodeLevel;
+var nodeLevel = 0;
if ($debug) {
/** The source locator table maps source locations to nodes
@@ -2192,6 +2193,4 @@
} // End of LzNode
-if ($swf9) {
ConstructorMap[LzNode.tagname] = LzNode;
-}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -27,13 +27,11 @@
Debug.error('helpers/Library.lzs unsupported runtime %s', $runtime);
}
-if ($swf9) {
- #include "helpers/LzState.js"
-} else {
- #include "helpers/LzState.lzs"
-}
+#include "helpers/LzState.lzs"
+
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/helpers/LzState.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -74,10 +74,20 @@
*/
class LzState extends LzNode {
-/** @access private
- * @modifiers override
- */
-static var tagname = 'state';
+ public function LzState ( parent:* , attrs:* , children:* = null, instcall:* = null) {
+ super(parent,attrs,children,instcall);
+ }
+
+ var __LZpool = [];
+ var __LZstatedelegates;
+ var collectArgs:Boolean = true;
+
+
+
+ /** @access private
+ * @modifiers override
+ */
+ static var tagname = 'state';
/** @access private */
static var attributes = new LzInheritedHash(LzNode.attributes);
@@ -140,7 +150,7 @@
/**
* @access private
*/
-function construct ( parent , args ){
+override function construct ( parent , args ){
super.construct.apply(this, arguments);
this.heldArgs = {};
this.handlerMethodNames = {};
@@ -150,7 +160,7 @@
/**
* @access private
*/
-function createChildren ( carr ){
+override function createChildren ( carr ){
this.subh = carr;
this.__LZinstantiationDone();
}
@@ -310,7 +320,7 @@
* Clean up after yourself
* @access private
*/
-function destroy ( ) {
+override function destroy ( recursiveCall = null ) {
// stop pooling
this.pooling = false;
// clean up delegates and views
@@ -333,7 +343,7 @@
* @devnote NOTE: [2006-12-09 ptw] Currently the only args that apply to the
* state are args that have setters or handlers for state events
*/
-/* override */ function __LZapplyArgs ( args ){
+override function __LZapplyArgs ( args , constcall = null){
var stateArgs = {};
var held = this.heldArgs;
var handlers = this.handlerMethodNames;
@@ -407,7 +417,7 @@
* application to the parent (and pass the ones that do apply to the
* state on to your superclass).
*/
-/* override */ function $lzc$set_$delegates ( delarr ){
+ override function $lzc$set_$delegates ( delarr ){
var pardels = [];
var mydels = [];
@@ -473,3 +483,5 @@
}
} // End of LzState
+
+ConstructorMap[LzState.tagname] = LzState;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2008-03-24 18:04:46 UTC (rev 8370)
@@ -1,7 +1,7 @@
/**
* LzMouseKernel.js
*
- * @copyright Copyright 2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2007, 2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic Kernel
@@ -42,6 +42,7 @@
LzMouseKernel.__y = e.clientY;
}
}
+
if (LzMouseKernel.__callback) {
if (e.button == 2 && eventname != 'oncontextmenu') return;
if (eventname == 'oncontextmenu') {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -7,16 +7,19 @@
* @access private
*/
+#include "services/LzInstantiator.lzs"
+#include "services/LzGlobalMouse.lzs"
+
if ($swf9) {
-#include "services/LzInstantiator.js"
-#include "services/LzGlobalMouse.js"
-#include "services/LzModeManager.js"
+ #include "services/LzModeManager.lzs"
+} else {
+ #include "services/LzModeManager.lzs"
+}
+
+if ($swf9) {
#include "services/LzURL.js"
} else {
-#include "services/LzInstantiator.lzs"
-#include "services/LzGlobalMouse.lzs"
-#include "services/LzModeManager.lzs"
#include "services/LzCursor.lzs"
#include "services/LzURL.lzs"
}
@@ -28,6 +31,7 @@
#include "services/platform/dhtml/LzHistory.js"
} else if ($swf9) {
#include "services/platform/swf9/LzKeys.js"
+// #include "services/platform/dhtml/LzModeManager.js"
} else if ($as2) {
#include "services/platform/swf/LzModeManager.as"
#include "services/platform/swf/LzKeys.as"
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzGlobalMouse.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @affects lzglobalmouse
@@ -72,16 +72,17 @@
* rollover or button state changes. The argument sent with the events is the
* view that was clicked. If no view was clicked, the argument is null.
*/
-var LzGlobalMouse = new Object;
+public class LzGlobalMouse {
-LzGlobalMouse.onmousemove = LzDeclaredEvent;
-LzGlobalMouse.onmouseup = LzDeclaredEvent;
-LzGlobalMouse.onmousedown = LzDeclaredEvent;
+ static var onmousemove = LzDeclaredEvent;
+ static var onmouseup = LzDeclaredEvent;
+ static var onmousedown = LzDeclaredEvent;
-LzGlobalMouse.__movecounter = 0;
+ static var __movecounter = 0;
/** @access private */
-LzGlobalMouse.__mouseEvent = function(eventname, view) {
- if (eventname == 'onmousemove') LzGlobalMouse.__movecounter++;
- if (LzGlobalMouse[eventname] && LzGlobalMouse[eventname].ready) LzGlobalMouse[eventname].sendEvent(view);
+ static function __mouseEvent (eventname, view) {
+ if (eventname == 'onmousemove') LzGlobalMouse.__movecounter++;
+ if (LzGlobalMouse[eventname] && LzGlobalMouse[eventname].ready) LzGlobalMouse[eventname].sendEvent(view);
+ }
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzInstantiator.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -16,8 +16,9 @@
*
* @shortdesc Handles application instantiation.
*/
-class LzInstantiatorClass {
+dynamic public class LzInstantiatorClass {
+
var checkQDel = null;
function LzInstantiatorClass () {
this.checkQDel = new LzDelegate( this , "checkQ" );
@@ -40,7 +41,7 @@
var makeQ = [];
var trickleQ = [];
var tricklingQ = [];
-var syncNew = true;
+public var syncNew = true;
/**
* The length of time to spend creating initstage=
* "late" nodes before allowing an idle event to pass. By default this
@@ -49,6 +50,7 @@
*/
var trickletime = 10;
+var datareplq:Array;
/**
* @access private
@@ -131,8 +133,10 @@
/**
* @access private
+ *
+ * N.B.: [hqm 2008-03] This gets an event timer arg from the onidle event, which we ignore
*/
-function checkQ ( ){
+function checkQ ( ignoreme = null){
if ( ! this.makeQ.length ) {
if (! this.tricklingQ.length ){
if ( !this.trickleQ.length ){
@@ -316,4 +320,6 @@
} // End of LzInstantiatorClass
-var LzInstantiator = new LzInstantiatorClass ();
+
+var LzInstantiator:LzInstantiatorClass = new LzInstantiatorClass ();
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -47,19 +47,28 @@
* @devnote Manages the modal states of views and also notifies views ( that have
* registered with it ) when their focus has changed.
*/
-var LzModeManager = new Object();
+public class LzModeManagerBase {
+if ($swf9) {
+ #passthrough (toplevel:true) {
+
+ import flash.utils.*;
+
+}#
+}
+
/** Sent when the mode changes. */
-LzModeManager.onmode = LzDeclaredEvent;
+ var onmode = LzDeclaredEvent;
/** @access private */
-LzModeManager.__LZlastclick = null;
-LzModeManager.willCall = false;
-LzModeManager.eventsLocked = false;
+ var __LZlastclick = null;
+ var __LZlastClickTime = 0;
+ var willCall = false;
+ var eventsLocked = false;
-LzModeManager.modeArray = new Array();
+ var modeArray = new Array();
-LzModeManager.toString = function (){
+ function toString (){
return "mode manager";
}
@@ -68,14 +77,12 @@
* Pushes the view onto the stack of modal views
* @param LzView view: The view intending to have modal iteraction
*/
-LzModeManager.makeModal = function ( view ) {
- if (this.modeArray.length == 0 || !this.hasMode( view )) {
- this.modeArray.push( view );
- if (this.onmode.ready) this.onmode.sendEvent( view );
- var f = LzFocus.getFocus();
- if ( f && ! f.childOf( view ) ){
- LzFocus.clearFocus();
- }
+ function makeModal ( view ) {
+ this.modeArray.push( view );
+ if (this.onmode.ready) this.onmode.sendEvent( view );
+ var f = LzFocus.getFocus();
+ if ( f && ! f.childOf( view ) ){
+ LzFocus.clearFocus();
}
}
@@ -83,13 +90,13 @@
* Removes the view (and all the views below it) from the stack of modal views
* @param LzView view: The view to be released of modal interaction
*/
-LzModeManager.release = function ( view ) {
+ function release ( view ) {
//releases all views past this one in the modelist as well
for ( var i = this.modeArray.length-1 ; i >=0 ; i-- ){
if ( this.modeArray[ i ] == view ){
this.modeArray.splice( i , this.modeArray.length - i );
var newmode = this.modeArray[ i - 1 ];
- if (this.onmode.ready) this.onmode.sendEvent( newmode || null );
+ if (onmode.ready) onmode.sendEvent( newmode || null );
var f = LzFocus.getFocus();
if ( newmode && f && ! f.childOf( newmode ) ){
LzFocus.clearFocus();
@@ -102,10 +109,10 @@
/**
* Clears all modal views from the stack
*/
-LzModeManager.releaseAll = function ( ) {
+ function releaseAll ( ) {
// reset array to remove all views
this.modeArray = new Array();
- if (this.onmode.ready) this.onmode.sendEvent( null );
+ if (onmode.ready) onmode.sendEvent( null );
}
/**
@@ -115,17 +122,18 @@
* @param LzView view: the view that received the event
* @param String eventStr: the event string
*/
-LzModeManager.handleMouseEvent= function ( view, eventStr ) {
- //Debug.warn("%w, %w", view , eventStr);
-
+ function handleMouseEvent ( view, eventStr ) {
if (eventStr == "onmouseup") LzTrack.__LZmouseup();
-
var dosend = true;
var isinputtext = false;
- if (view == null ) { // check if the mouse event is in a inputtext
- view = this.__findInputtextSelection();
+ if ($swf9) {
+ } else {
+ // TODO [hqm 2008-01] What is this supposed to be doing, and where is _findInputtextSelection defined??
+ if (view == null ) { // check if the mouse event is in a inputtext
+ view = this.__findInputtextSelection();
+ }
}
LzGlobalMouse.__mouseEvent(eventStr, view);
@@ -152,13 +160,13 @@
if ( dosend ){
//check for double-click
- if ( eventStr == "onclick" ){
+ if ( this.eventStr == "onclick" ){
if ( this.__LZlastclick == view &&
('ondblclick' in view && view.ondblclick) &&
(view.ondblclick.getDelegateCount() > 0) &&
(getTimer() - this.__LZlastClickTime)< view.DOUBLE_CLICK_TIME ){
//this is a double-click
- eventStr = "ondblclick";
+ this.eventStr = "ondblclick";
this.__LZlastclick = null;
} else {
this.__LZlastclick = view;
@@ -177,17 +185,24 @@
//this on matters for onmouseup and onmousedown, but it's easier to just
//set it regardless
- this[ "haveGlobal" + eventStr ] = false;
+ if ($swf9) {
+ // TODO [hqm 2008-01] I don't know what this is for...
+ // this[ "haveGlobal" + eventStr ] = false;
+ } else {
+ this[ "haveGlobal" + eventStr ] = false;
+ }
}
+ function __findInputtextSelection () { return null};
+
/**
* return true if the given view is allowed to receive the focus
* any view that is a child of the view that has the mode may be focused
* other views may not
* @access private
*/
-LzModeManager.__LZallowFocus= function ( view ) {
+ function __LZallowFocus ( view ) {
var len = this.modeArray.length;
return len == 0 || view.childOf ( this.modeArray[len-1] );
}
@@ -195,15 +210,15 @@
/**
* Prevents all mouse events from firing.
* */
-LzModeManager.globalLockMouseEvents = function (){
- this.eventsLocked = true;
+ function globalLockMouseEvents (){
+ this.eventsLocked = true;
}
/**
* Restore normal mouse event firing.
* */
-LzModeManager.globalUnlockMouseEvents = function (){
- this.eventsLocked = false;
+ function globalUnlockMouseEvents (){
+ this.eventsLocked = false;
}
/**
@@ -212,7 +227,7 @@
* @return Boolean: true if the view is in the modelist
*
*/
-LzModeManager.hasMode = function ( view ){
+ function hasMode ( view ){
for ( var i = this.modeArray.length -1 ; i >= 0; i-- ){
if ( view == this.modeArray[ i ] ){
return true;
@@ -224,9 +239,9 @@
/**
* @access private
*/
-LzModeManager.getModalView = function ( ){
+ function getModalView ( ){
return this.modeArray[ this.modeArray.length - 1] || null;
}
+}
-// Register for callbacks from the kernel
-LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/dhtml/LzModeManager.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/dhtml/LzModeManager.js 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/dhtml/LzModeManager.js 2008-03-24 18:04:46 UTC (rev 8370)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @affects lzmodemanager
@@ -9,22 +9,30 @@
* @subtopic Services
*/
-LzModeManager.rawMouseEvent = function(me) {
- this.handleMouseEvent( null , me );
-}
+public class LzModeManagerClass extends LzModeManagerBase {
-LzModeManager.handleMouseButton = function(view, eventName) {
- this.handleMouseEvent( view , eventName );
-}
+ function rawMouseEvent (me) {
+ this.handleMouseEvent( null , me );
+ }
+
+ function handleMouseButton (view, eventName) {
+ this.handleMouseEvent( view , eventName );
+ }
-/**
- * Finds the view for if the mouse event occurred in an input text field
- * TODO: implement
- * @access private
- */
-LzModeManager.__findInputtextSelection = function () {
- if (LzInputTextSprite.prototype.__focusedSprite
- && LzInputTextSprite.prototype.__focusedSprite.owner) {
- return LzInputTextSprite.prototype.__focusedSprite.owner;
+ /**
+ * Finds the view for if the mouse event occurred in an input text field
+ * TODO: implement
+ * @access private
+ */
+ override function __findInputtextSelection () {
+ if (LzInputTextSprite.prototype.__focusedSprite
+ && LzInputTextSprite.prototype.__focusedSprite.owner) {
+ return LzInputTextSprite.prototype.__focusedSprite.owner;
+ }
}
}
+
+var LzModeManager:LzModeManagerClass = new LzModeManagerClass();
+// Register for callbacks from the kernel
+LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf/LzModeManager.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf/LzModeManager.as 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf/LzModeManager.as 2008-03-24 18:04:46 UTC (rev 8370)
@@ -1,6 +1,6 @@
/**
*
- * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @affects lzmodemanager
@@ -10,16 +10,18 @@
*/
/** */
-LzModeManager.clickStream = new Array();
-LzModeManager.clstDel = new LzDelegate( LzModeManager , "checkClickStream" );
+public class LzModeManagerClass extends LzModeManagerBase {
-LzModeManager.clstDict ={ onmouseup : 1 , onmousedown: 2 };
+static var clickStream = new Array();
+static var clstDel = new LzDelegate( LzModeManager , "checkClickStream" );
+static var clstDict ={ onmouseup : 1 , onmousedown: 2 };
+
/**
* Called by clickable movieclip
* @access private
*/
-LzModeManager.handleMouseButton = function ( view , eventStr){
+static function handleMouseButton ( view , eventStr){
//Debug.write('handleMouseButton', view, eventStr);
this.clickStream.push( this.clstDict[ eventStr ] + 2);
@@ -37,7 +39,7 @@
*
* @access private
*/
-LzModeManager.rawMouseEvent = function ( eName ) {
+static function rawMouseEvent ( eName ) {
// If applicable, update the current sprite's insertion position/size.
var focus = Selection.getFocus();
if (focus) {
@@ -58,12 +60,12 @@
this.callNext();
}
-LzModeManager.WAIT_FOR_CLICK = 4;
+static var WAIT_FOR_CLICK = 4;
/**
* Cleanup method for raw mouseup
* @access private
*/
-LzModeManager.checkClickStream = function (){
+static function checkClickStream (){
this.willCall = false;
//clickstream that looks like this
@@ -130,7 +132,7 @@
/**
* @access private
*/
-LzModeManager.callNext = function (){
+static function callNext (){
if ( !this.willCall ){
this.willCall = true;
LzIdle.callOnIdle( this.clstDel );
@@ -141,7 +143,7 @@
* Finds the view for if the mouse event occurred in an input text field
* @access private
*/
-LzModeManager.__findInputtextSelection = function () {
+override static function __findInputtextSelection () {
var ss = Selection.getFocus();
if ( ss != null ){
var focusview = eval(ss + '.__lzview');
@@ -149,3 +151,7 @@
if ( focusview != undefined ) return focusview;
}
}
+}
+var LzModeManager:LzModeManagerClass = new LzModeManagerClass();
+// Register for callbacks from the kernel
+LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
Added: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzModeManager.js
Property changes on: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/platform/swf9/LzModeManager.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js 2008-03-24 18:04:46 UTC (rev 8370)
@@ -8,29 +8,66 @@
*/
+/**
+ * <p>The canvas is the container for all views within an application.</p>
+ *
+ * <p>The <classname>LzCanvas</classname> class represents the viewable
+ * area of the application. There is one instance of
+ * <classname>LzCanvas</classname>, named <varname>canvas</varname>. The
+ * canvas contains all views within an application.</p>
+ *
+ * <p>The <tagname>canvas</tagname> tag is the document root of an LZX
+ * application file. It contains class, resource, and font definitions,
+ * library includes, and view and other instances.</p>
+ *
+ * <p>See the <a
+ * href="${dguide}program-structure.html#program-structure.canvas-tag">Guide</a>
+ * for a complete discussion of the <tagname>canvas</tagname> tag.</p>
+ *
+ * In addition to any events documented in the section below, these events are also available:
+ *
+ * <event>oninit</event> This event is sent right before a node becomes active
+ * -- e.g. before a view displays, or before a layout affects its
+ * subviews.
+ *
+ * <p>In addition to any fields documented in the section at the end, these fields are also available:
+ * <ul>
+ * <li><attribute>anm_multipler</attribute> A <type>Number</type> specifying the animation speed.</li>
+ * <li><attribute>embedfonts</attribute> A <type>Boolean</type> true | false. Whether to embed fonts in the compiled application.</li>
+ * <li><attribute>lpsbuild</attribute> A <type>String</type> specifying the LPS build revision and the build directory: e.g. "4075 /Users/maxcarlson/openlaszlo/legals"</li>
+ * <li><attribute>lpsbuilddate</attribute> A <type>String</type> specifying the date and time of the LPS build. "2007-03-05T15:33:42-0800"</li>
+ * <li><attribute>lpsrelease</attribute> A <type>String</type> specifying the LPS release type, e.g. "Latest" </li>
+ * <li><attribute>lpsversion</attribute> A <type>String</type> specifying the LPS version, e.g. "4.0.x"</li>
+ * <li><attribute>proxied</attribute> A <type>Boolean</type> true | false</li>
+ * <li><attribute>runtime</attribute> A <type>String</type> describing the target runtime. "dhtml" | "swf7" | "swf8" are currently supported. Others are in development.</li>
+ * <li><attribute>version</attribute>A String. The same as lpsversion. </li>
+ * </ul></p>
+ * @see LzView
+ * @lzxname canvas
+ * @shortdesc The top-most view in a Laszlo application.
+ * @topic LFC
+ * @subtopic Views
+ * @access public
+ * @initarg Boolean accessible: Specifies if this application is intended to be accessible
+ * @initarg Boolean debug: If true, the application is compiled with debugging enabled.
+ * See the <a href="${dguide}debugging.html">Debugging</a> chapter of
+ * the Guide for more information about debugging.
+ */
dynamic class LzCanvas extends LzView {
+ static var tagname = 'canvas';
+
#passthrough (toplevel:true) {
import flash.utils.*;
}#
-
/**
* @access private
* @modifiers override
*/
- static var tagname = 'canvas';
- ConstructorMap[tagname] = LzCanvas;
+/** @access private */
+ static var attributes = new LzInheritedHash(LzView.attributes);
-
-
- 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);
-
var resourcetable:*;
var _lzinitialsubviews:*;
var totalnodes:*;
@@ -49,11 +86,15 @@
var __LZmousemoveDel:LzDelegate;
+
function LzCanvas ( args ) {
- super(null, null);
-
// TODO: [2006-05-19 ptw] The original did not do this, should we?
// super(null, args);
+ // No, we can't. But you have to be aware that if you futz with
+ // LzNode or LzView, you have to consider whether you will have to
+ // change the canvas constructor too, since it _pretends_ to be a
+ // view!
+
// Note canvas start
if ($profile) {
Profiler.event('start: #canvas');
@@ -101,52 +142,7 @@
this.id = LzBrowser.getInitArg('id')
}
-function initiatorAddNode ( e , n ){
- this.totalnodes += n;
- this._lzinitialsubviews.push( e );
-}
- // work around some parser bug with optional args
-override function __LZcallInit (an = null ){
- if (this.isinited) return;
-
- //do this now, so that others know that they're too late
- this.isinited = true;
-
- this.__LZresolveReferences();
- var sl = this.subnodes;
- if (sl) {
- var i = 0;
- var l = sl.length;
- while(i < l){
- var s = sl[ i++ ];
- //remember next one too
- var t = sl[ i ]
- if ( s.isinited || s.__LZlateinit ) continue;
- s.__LZcallInit( );
- //if the next one is not where it was, back up till we find it or to
- //the beginning of the array
- if ( t != sl[ i ] ){
- // When does this ever happen?
- // Debug.warn('subnodes array changed after %w -> sl[%d]: %w', t, i, sl[i]);
- while ( i > 0 ){
- if ( t == sl[ --i ] ) break;
- }
- }
- }
- }
-
- this.init();
- this.sprite.init(true);
- if (this.oninit.ready) this.oninit.sendEvent( this );
- if (this.datapath && this.datapath.__LZApplyDataOnInit) {
- this.datapath.__LZApplyDataOnInit();
- }
-
- //new lz.text(canvas,{x:0, y:80, selectable: true, text: ('canvas initdone time: '+getTimer() )} );
-
- }
-
/**
* Sends onmouseup event
* @access private
@@ -182,7 +178,6 @@
}
}
-
var initdelay = 0;
/** Sent whenever the number of created nodes changes
@@ -192,8 +187,6 @@
-var updatePercentCreated:*;
-
/** version number of the LPS that generated this application (for .lzo files,
* this is the version number of the server that generated the optimized file, not the one
* that served it).
@@ -222,10 +215,15 @@
/** @access private */
var __LZlfcversion = "0";
-var proxied:Boolean = false;
+/** If true, requests for data and media are proxied through LPS server.
+ * if false, requests are made directly to target URLs.
+ * if inherit, inherit from lzproxied query arg.
+ *
+ * @lzxtype booleanLiteral | "inherit"
+ * @lzxdefault "inherit"
+ */
+var proxied = true;
-
-
/** If present, specifies the default timeout in milliseconds of data load requests
* @type Number
* @lzxtype numberExpression
@@ -249,8 +247,68 @@
var datasets;
+
/**
+ * Compares two version strings.
+ * @param ver: A version string
+ * @param over: Another version string. If omitted, defaults to the version of
+ * of the app.
+ * @return: -1, 0 , 1 to indicate whether the ver parameter preceeds, matches,
+ * or succeeds the second parameter (respectively)
+ */
+function compareVersion ( ver , over ){
+
+ if ( over ==null ){
+ over = this.lpsversion;
+ }
+
+ if ( ver == over ) return 0;
+
+ var ver1 = ver.split( '.' );
+ var ver2 = over.split( '.' );
+
+ var i = 0;
+ while( i < ver1.length || i < ver2.length ){
+ var my = Number( ver1[ i ] )|| 0;
+ var oth = Number( ver2[ i++ ] )|| 0;
+ if ( my < oth ) {
+ return -1;
+ }else if ( my > oth ) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/**
+ * The canvas setResource function is redefined to throw an error when
+ * called.
* @access private
+ */
+override function setResource ( ) {
+ Object.error("You can't set a resource for the canvas.");
+}
+
+
+/**
+ * @access private
+ */
+override function toString (){
+ return "This is the canvas";
+}
+
+/*
+ * Canvas can't change size
+ */
+// Override values defined in LzView
+/** @access private */ prototype.__LZcheckwidth = null;
+/** @access private */ prototype.__LZcheckheight = null;
+/** @access private */ prototype.hassetwidth = true;
+/** @access private */ prototype.hassetheight = true;
+
+
+/**
+ * @access private
* only called from the snippet loader
*/
function initDone (){
@@ -277,8 +335,6 @@
//this.isinited = false;
//Debug.write('LzCanvas.initDone');
LzInstantiator.requestInstantiation( this, sva );
- // LzInstantiator.createImmediate( this, sva );
-
}
@@ -303,10 +359,17 @@
override function __LZinstantiationDone (){
this.percentcreated = 1;
this.updatePercentCreated = null;
- this.okToInit();
+ if (this.onpercentcreated.ready) this.onpercentcreated.sendEvent( this.percentcreated );
+
+ if ( this.initdelay > 0 ){
+ LzInstantiator.halt();
+ this.initokdel = new LzDelegate ( this , "okToInit" );
+ LzTimer.addTimer( this.initokdel , this.initdelay );
+ } else {
+ this.okToInit();
+ }
}
-
/**
* @access private
*/
@@ -315,17 +378,166 @@
this.__LZcallInit();
}
+/**
+ * @access private
+ */
+function updatePercentCreated (){
+ this.percentcreated = Math.max( this.percentcreated ,
+ this.creatednodes / this.totalnodes );
+ this.percentcreated = Math.min( .99 , this.percentcreated );
+ if (this.onpercentcreated.ready) this.onpercentcreated.sendEvent( this.percentcreated );
+}
+/**
+ * @access private
+ */
+function initiatorAddNode ( e , n ){
+ this.totalnodes += n;
+ this._lzinitialsubviews.push( e );
+}
- function LzInstantiateView(e, tn:* = null)
- {
- if ( tn == null) {
- tn = 1;
+/**
+ * @access private
+ * @devnote N.B.: replaces LzNode.__LZcallInit, so must be kept in sync with that
+ */
+override function __LZcallInit ( an = null ){
+ // Canvas-only: Don't bother with preventSubInit
+ if (this.isinited) return;
+
+ //do this now, so that others know that they're too late
+ this.isinited = true;
+
+ this.__LZresolveReferences();
+ if (this.__LZstyleConstraints) this.__LZapplyStyleConstraints();
+ var sl = this.subnodes;
+ if (sl) {
+ var i = 0;
+ var l = sl.length;
+ while(i < l){
+ var s = sl[ i++ ];
+ //remember next one too
+ var t = sl[ i ]
+ if ( s.isinited || s.__LZlateinit ) continue;
+ s.__LZcallInit( );
+ //if the next one is not where it was, back up till we find it or to
+ //the beginning of the array
+ if ( t != sl[ i ] ){
+ // When does this ever happen?
+ // Debug.warn('subnodes array changed after %w -> sl[%d]: %w', t, i, sl[i]);
+ while ( i > 0 ){
+ if ( t == sl[ --i ] ) break;
+ }
+ }
}
- initiatorAddNode( e , tn );
}
+ // Register in the source locator table, if debugging
+ if ($debug) {
+ if (this.__LZsourceLocation) {
+ LzNode.sourceLocatorTable[this.__LZsourceLocation] = this;
+ }
+ }
+ this.init();
+ // Canvas-only: Why? TODO: [2008-02-01 ptw] Ask max
+ this.sprite.init(true);
+ if (this.oninit.ready) this.oninit.sendEvent( this );
+ if (this.datapath && this.datapath.__LZApplyDataOnInit) {
+ this.datapath.__LZApplyDataOnInit();
+ }
+
+}
+
+
+
+/**
+ * @access private
+ */
+override function setWidth ( ){
+ if ( $debug ){
+ Debug.error( "setWidth cannot be called on the canvas." );
+ }
+}
+
+/**
+ * @access private
+ */
+function isProxied ( ){
+ return this.proxied;
+}
+
+/**
+ * @access private
+ */
+override function setX ( ){
+ if ( $debug ){
+ Debug.error( "setX cannot be called on the canvas." );
+ }
+}
+
+/**
+ * @access private
+ */
+override function setHeight ( ){
+ if ( $debug ){
+ Debug.error( "setHeight cannot be called on the canvas." );
+ }
+}
+
+/**
+ * @access private
+ */
+override function setY ( ){
+ if ( $debug ){
+ Debug.error( "setY cannot be called on the canvas." );
+ }
+}
+
+/**
+ * LzView.setDefaultContextMenu
+ * Install default menu items for the right-mouse-button
+ * @param LzContextMenu cmenu: LzContextMenu to install on this view
+ */
+function setDefaultContextMenu ( cmenu ){
+ this.setContextMenu(cmenu);
+ this.sprite.setDefaultContextMenu( cmenu );
+}
+
+/**
+ * Compute version info as a string
+ * @access public
+ */
+static function versionInfoString () {
+ return (
+ 'URL: ' + LzBrowser.getLoadURL() + '\n' +
+ 'Version: ' + canvas.lpsversion + '\n' +
+ 'Release: ' + canvas.lpsrelease + '\n' +
+ 'Build: ' + canvas.lpsbuild + '\n' +
+ 'Date: ' + canvas.lpsbuilddate + '\n' +
+ 'Target: ' + canvas.runtime + '\n' +
+ 'Runtime: ' + LzBrowser.getVersion() + '\n');
+}
+
+/**
+ * Callback for LzScreenKernel window resize events
+ * @access private
+ */
+function __windowResize(size) {
+ if (this.__canvaswidthratio != null) {
+ this.width = Math.floor(size.width * this.__canvaswidthratio);
+ if (this.onwidth.ready) this.onwidth.sendEvent(this.width);
+ this.sprite.setWidth(this.width);
+ }
+
+ if (this.__canvasheightratio != null) {
+ this.height = Math.floor(size.height * this.__canvasheightratio);
+ if (this.onheight.ready) this.onheight.sendEvent(this.height);
+ this.sprite.setHeight(this.height);
+ }
+}
+
} // End of LzCanvas
+ConstructorMap[LzCanvas.tagname] = LzCanvas;
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -79,13 +79,37 @@
*/
var vip:LzView = null;
- var animators:Array;
+ /** @access private */
var _height:Number;
+ /** @access private */
var _width:Number;
+ /** @access private */
var _y:Number;
+ /** @access private */
var _x:Number;
- var __LZhaser;
+ /** @access private */
+ var __LZhaser;
+ /** @access private */
+ var __LZlayout
+ /** @access private */
+ var fontname;
+ /** @access private */
+ var _visible;
+ /** @access private */
+ var __LZstoredbounds;
+
+ /** @access private */
+ var __movecounter;
+ /** @access private */
+ var __mousecache;
+
+ var __lzcheckframe;
+
+ var playing = false;
+
+
+
/** Event called when this view adds a subview
* @access public
* @lzxtype event
@@ -1021,7 +1045,7 @@
* @access private
* @param String val: The value for the new font name
*/
-function setFontName ( val ,prop ){
+function setFontName ( val ,prop = null){
this.fontname = val ;
// Canvas has no sprite
if (! this.sprite) {
@@ -1523,7 +1547,7 @@
* Sets the <attribute>x</attribute> position of the view to the given value.
* @param Number v: The new value for <attribute>x</attribute>.
*/
-function setX ( v, force ){
+function setX ( v, force = null){
if (force || this._x != v) {
this._x = v;
this.x = v;
@@ -1550,7 +1574,7 @@
* Sets the <attribute>y</attribute> position for the view to the given value.
* @param Number v: The new value for <attribute>y</attribute>.
*/
-function setY ( v, force ){
+function setY ( v, force = null){
if (force || this._y != v) {
this._y = v;
this.y = v;
@@ -1678,7 +1702,7 @@
/** @access private
* @devnote Initial value required to make interpreter happy
*/
-LzView.prototype.__LZlastmtrix = [ 0,0,0,0,0,0,0,0,0,0,0 ];
+static var __LZlastmtrix = [ 0,0,0,0,0,0,0,0,0,0,0 ];
/**
@@ -2049,7 +2073,7 @@
}
/** @access private */
-function reevaluateSize ( ia ){
+function reevaluateSize ( ia = null){
//if called with no args, check both
if ( ia == null ){
var axis = "height";
@@ -2572,7 +2596,7 @@
* begin playing at the current frame.
* @param Boolean rel: If true, f is relative to the current frame. Otherwise f is relative to the beginning of the resource.
*/
-function play (f, rel){
+function play (f, rel = null){
this.sprite.play(f, rel);
}
@@ -2582,7 +2606,7 @@
* stop at the current frame.
* @param Boolean rel: If true, f is relative to the current frame. Otherwise it is relative to the start position of the resource.
*/
-function stop (f, rel){
+function stop (f, rel = null){
this.sprite.stop(f, rel);
}
@@ -2774,7 +2798,7 @@
* Set accessibility name
* @param string s: Sets the accessibility name for this view
*/
-function setAAName ( s, mc ){
+function setAAName ( s, mc = null){
if (this.capabilities.accessibility) {
this.sprite.setAAName(s, mc);
} else if ($debug) {
@@ -2786,7 +2810,7 @@
* Set accessibility description
* @param string s: Sets the accessibility name for this view
*/
-function setAADescription ( s, mc ){
+function setAADescription ( s, mc = null){
if (this.capabilities.accessibility) {
this.sprite.setAADescription(s, mc);
} else if ($debug) {
@@ -2798,7 +2822,7 @@
* Set accessibility tab order
* @param number s: The tab order index for this view. Must be a unique number.
*/
-function setAATabIndex ( s, mc ){
+function setAATabIndex ( s, mc = null){
if (this.capabilities.accessibility) {
this.sprite.setAATabIndex(s, mc);
} else if ($debug) {
@@ -2811,7 +2835,7 @@
* @param string s: If true, this view is made silent to the screen reader.
* If false, it is active to the screen reader.
*/
-function setAASilent ( s, mc ){
+function setAASilent ( s, mc = null){
if (this.capabilities.accessibility) {
this.sprite.setAASilent(s, mc);
} else if ($debug) {
@@ -2909,7 +2933,7 @@
/** @access private */
function __warnCapability(msg) {
- Debug.warn('The %s runtime does not support %s', lzr, msg);
+ Debug.warn('The %s runtime does not support %s', canvas['runtime'], msg);
}
/**
@@ -2926,3 +2950,4 @@
}
} // End of LzView
+ConstructorMap[LzView.tagname] = LzView;
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/Library.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -7,25 +7,21 @@
* @access private
*/
-
#include "views/LaszloView.lzs"
+#include "views/LzText.lzs"
-
if($swf9) {
#include "views/LzViewLinkage.js"
- #include "views/LzText.js"
#include "views/LzInputText.js"
+} else {
+ #include "views/LzViewLinkage.lzs"
+ #include "views/LzInputText.lzs"
+}
+if($swf9) {
#include "views/LaszloCanvas.js"
-
} else {
-
-#include "views/LzViewLinkage.lzs"
-#include "views/LzText.lzs"
-#include "views/LzInputText.lzs"
-
-#include "views/LaszloCanvas.lzs"
-
+ #include "views/LaszloCanvas.lzs"
}
if ($as2) {
#include "views/platform/LzPlatform.lzs"
@@ -39,8 +35,5 @@
Debug.error('views/Library.lzs unsupported runtime %s', $runtime)
}
-if ($swf9) {
- #include "views/LzScript.js"
-} else {
- #include "views/LzScript.lzs"
-}
+#include "views/LzScript.lzs"
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzInputText.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -70,7 +70,7 @@
* @shortdesc The basic input-text element.
* @lzxname inputtext
*/
-class LzInputText extends LzText {
+dynamic public class LzInputText extends LzText {
/** @access private
* @modifiers override
@@ -105,15 +105,23 @@
* Width to use for text field if none is specified
* @access private
*/
-function getDefaultWidth () {
+override function getDefaultWidth () {
return 100;
}
+/** @access private */
+var _onfocusDel;
+/** @access private */
+var _onblurDel;
+/** @access private */
+var _modemanagerDel;
+
/**
* @access private
*/
-function construct ( parent , args ){
+override function construct ( parent , args ){
+ this.focusable = true;
super.construct.apply(this, arguments);
this._onfocusDel = new LzDelegate( this , "_gotFocusEvent" , this,
"onfocus" );
@@ -145,29 +153,40 @@
super.destroy.apply(this, arguments);
}
+var isprite:LzInputTextSprite = null;
+
/**
* Called to create the sprite object. May be overridden to use a specific
* version, e.g. LzTextSprite();
* @access private
*/
-function __makeSprite(args) {
+override function __makeSprite(args) {
this.sprite = new LzInputTextSprite(this, args);
+ // TODO [hqm 2008-03] fix this when compiler can handle type casts properly
+ if ($swf9) {
+ this.isprite = LzInputTextSprite(this.sprite);
+ } else {
+ this.isprite = this.sprite;
+ }
+
}
+var _focused = false;
+
/** @access private */
function _gotFocusEvent(){
this._focused = true;
- this.sprite.gotFocus();
+ this.isprite.gotFocus();
}
/** @access private */
function _gotBlurEvent(){
this._focused = false;
- this.sprite.gotBlur();
+ this.isprite.gotBlur();
}
// Receive input text events from sprite
-function inputtextevent (eventname, value){
+function inputtextevent (eventname, value = null) {
//Debug.warn('inputtextevent', eventname, value);
if (eventname == 'onfocus' && this._focused) return;
if (eventname == 'onblur' && ! this._focused) return;
@@ -182,8 +201,8 @@
//multiline resizable fields adjust their height
if ( this.multiline &&
this.sizeToHeight &&
- this.height != this.sprite.getTextHeight() ) {
- this.setHeight(this.sprite.getTextfieldHeight());
+ this.height != this.isprite.getTextHeight() ) {
+ this.setHeight(this.isprite.getTextfieldHeight());
}
if (this.ontext.ready) this.ontext.sendEvent(value);
return;
@@ -193,20 +212,18 @@
if (this[eventname].ready) this[eventname].sendEvent(value);
}
-// FIXME [2006-09-27 pbr] (LPP-2397) Uncomment 'override' when implemented
-/* override */ var focusable = true; // Defined in LzView
-
-
/**
* Retrieves the contents of the text field for use by a datapath. See
* <code>LzDatapath.updateData</code> for more on this.
* @access protected
*/
function updateData (){
- return this.sprite.getText();
+ return this.isprite.getText();
}
+ public var enabled = true;
+
/**
* Sets whether user can modify input text field
* @param Boolean enabled: true if the text field can be edited
@@ -214,7 +231,7 @@
function setEnabled (enabled){
this.setAttribute('focusable', enabled);
this.enabled = enabled;
- this.sprite.setEnabled(enabled);
+ this.isprite.setEnabled(enabled);
if (this.onenabled.ready) this.onenabled.sendEvent(enabled);
}
@@ -228,7 +245,7 @@
*/
function setHTML (htmlp) {
if (this.capabilities['htmlinputtext']) {
- this.sprite.setHTML(htmlp);
+ this.isprite.setHTML(htmlp);
} else if ($debug) {
this.__warnCapability('inputtext.setHTML()');
}
@@ -238,7 +255,7 @@
* setText sets the text of the field to display
* @param String t: the string to which to set the text
*/
-function setText ( t ){
+override function setText ( t ){
// force to a string
t += '';
if (this.maxlength != null && t.length > this.maxlength){
@@ -264,10 +281,12 @@
return this.sprite.getText();
}
-prototype.getText.dependencies = function(who, self) {
+if ($swf9) { } else {
+ // TODO [hqm 2008-03] fix this when new dependencies mechanism is in
+ prototype.getText.dependencies = function(who, self) {
return [ self, "text" ];
}
-
+}
/**
* this attribute control the LzText::selectable attribute trough its setter
* @access private
@@ -319,10 +338,14 @@
/**
* @access private
*/
-function setSelectable(value) {
+public override function setSelectable(value) {
this._selectable = value;
// depending on allowselectable : the setted value or false !
super.setSelectable( this._allowselectable ? value : false );
}
} // End of LzInputText
+
+ConstructorMap[LzInputText.tagname] = LzInputText;
+
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzScript.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -70,11 +70,12 @@
/** @access private */
static var attributes = new LzInheritedHash(LzNode.attributes);
-function LzScript ( parent, args ) {
- super(parent, args);
- args.script();
-}
+ public function LzScript ( parent:* , attrs:* , children:* = null, instcall:* = null) {
+ super(parent,attrs,children,instcall);
+ attrs.script();
+ }
+
}; // End of LzScript
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -73,6 +73,26 @@
*/
class LzText extends LzView with LzFormatter {
+ var maxlines = 1;
+ var selectable = false;
+ var antiAliasType = "normal";
+ var gridFit = "subpixel";
+ var sharpness = 0;
+ var thickness = 0;
+ var tsprite:LzTextSprite = null;
+
+
+
+ var password;
+ var sizeToHeight;
+
+ var yscroll;
+ var xscroll;
+
+ var scrollheight;
+
+
+
/** @access private
* @modifiers override
*/
@@ -175,13 +195,13 @@
var colorstring = "#000000"; // black
/** @access private */
-function init () {
+override function init () {
super.init.apply(this, arguments);
// [max] had to do this because text fields don't have a height until they're attached into the DOM.
// multiline resizable fields adjust their height
if (this.sizeToHeight) {
- var h = this.sprite.getTextfieldHeight();
+ var h = this.tsprite.getTextfieldHeight();
if (h > 0) {
this.setHeight(h);
}
@@ -191,7 +211,8 @@
/**
* @access private
*/
-function construct ( parent, args ) {
+override function construct ( parent, args ) {
+
this.password = ('password' in args && args.password) ? true : false;
this.multiline = ('multiline' in args) ? args.multiline : null;
@@ -206,7 +227,7 @@
args.font = this.fontname;
args.fontsize = this.fontsize;
args.fontstyle = this.fontstyle;
- this.sprite.__initTextProperties(args);
+ this.tsprite.__initTextProperties(args);
args.font = LzNode._ignoreAttribute;
args.fontsize = LzNode._ignoreAttribute;
@@ -230,7 +251,7 @@
this.setMultiline( this.multiline );
- this.sprite.setText( this.text );
+ this.tsprite.setText( this.text );
// To compute our width:
// + if text is multiline:
@@ -298,6 +319,9 @@
} else {
this.setThickness(0);
}
+ if ($swf9) {
+ // TODO [hqm 2008-03] what should we be doing in swf9 here??
+ } else {
// ---+++--- WTF? ---+++---
if (! LzText.setters.antiAliasType) {
/**
@@ -317,6 +341,7 @@
LzText.setters.thickness = "setThickness";
LzText.attributes.thickness = 0;
}
+ }
}
}
@@ -325,9 +350,16 @@
* version, e.g. LzTextSprite();
* @access private
*/
-function __makeSprite(args) {
+override function __makeSprite(args) {
//Debug.write('__makeSprite', args);
this.sprite = new LzTextSprite(this, args);
+ // TODO [hqm 2008-03] fix this when compiler can handle type casts properly
+ if ($swf9) {
+ this.tsprite = LzTextSprite(this.sprite);
+ } else {
+ this.tsprite = this.sprite;
+ }
+ console.log('this.tsprite', this.tsprite, this);
}
@@ -335,8 +367,8 @@
* Get a reference to the control mc (overridden from LzView)
* @access private
*/
-function getMCRef () {
- return this.sprite.getMCRef();
+override function getMCRef () {
+ return this.tsprite.getMCRef();
// return this.__LZtextclip;
}
@@ -400,7 +432,7 @@
* @param Boolean val: if true, the textfield will recompute it's width after setText() is called
*/
function setResize ( val ){
- this.sprite.setResize(val);
+ this.tsprite.setResize(val);
this.resize = val;
}
@@ -408,12 +440,12 @@
/**
* @access private
*/
-function setWidth ( val ){
- this.sprite.setWidth(val);
+override function setWidth ( val ){
+ this.tsprite.setWidth(val);
super.setWidth.apply(this, arguments);
// recalculate height
if (this.sizeToHeight) {
- var h = this.sprite.getTextfieldHeight();
+ var h = this.tsprite.getTextfieldHeight();
if (h > 0) {
this.setHeight(h);
}
@@ -442,7 +474,15 @@
* @param String t: The string to add
*/
function addText ( t ){
- this.setText( this.getText() + t );
+ // TODO [hqm 2008-02] this could be done more efficiently (in swf9
+ // anyway) with appendText. I think it needs to invoke the part of
+ // setText that recomputes the dimensions if needed. But we want
+ // to omit the call to sprite.setText(). I don't want to refactor
+ // setText to introduce a new level of function call there though.
+ //this.tsprite.appendText( t );
+ //this.text = this.tsprite.getText();
+
+ this.setText( this.getText() + t );
}
/**
@@ -458,7 +498,7 @@
*/
function setMaxLength ( val ){
if (val == null || val == '') return;
- this.sprite.setMaxLength(val);
+ this.tsprite.setMaxLength(val);
this.maxlength = val;
if (this.onmaxlength.ready) this.onmaxlength.sendEvent(val);
@@ -474,7 +514,7 @@
*/
function setPattern ( val ){
if (val == null || val == '') return;
- this.sprite.setPattern(val);
+ this.tsprite.setPattern(val);
this.pattern = val;
if (this.onpattern.ready) this.onpattern.sendEvent(val);
}
@@ -483,7 +523,7 @@
* Calculates the current width of the text held by the text field.
*/
function getTextWidth ( ){
- return this.sprite.getTextWidth();
+ return this.tsprite.getTextWidth();
}
@@ -491,7 +531,7 @@
* Calculates the current height of the text held by the text field.
*/
function getTextHeight ( ){
- return this.sprite.getTextHeight();
+ return this.tsprite.getTextHeight();
//return this.__LZtextclip.textHeight;
}
@@ -537,14 +577,14 @@
* @access private
*/
function setScroll ( h ){
- this.sprite.setScroll(h);
+ this.tsprite.setScroll(h);
}
/**
* @access private
*/
function getScroll ( ){
- return this.sprite.getScroll();
+ return this.tsprite.getScroll();
}
@@ -552,7 +592,7 @@
* @access private
*/
function getMaxScroll ( ){
- return this.sprite.getMaxScroll();
+ return this.tsprite.getMaxScroll();
}
@@ -560,7 +600,7 @@
* @access private
*/
function getBottomScroll ( ){
- return this.sprite.getBottomScroll();
+ return this.tsprite.getBottomScroll();
}
/**
@@ -570,7 +610,7 @@
* (n is always < 0)
*/
function setXScroll ( n ){
- this.sprite.setXScroll(n);
+ this.tsprite.setXScroll(n);
//this.onxscroll.sendEvent(??);
}
@@ -580,7 +620,7 @@
* vertically (n is always < 0)
*/
function setYScroll ( n ){
- this.sprite.setYScroll(n);
+ this.tsprite.setYScroll(n);
//this.onyscroll.sendEvent(this.yscroll);
}
@@ -693,15 +733,15 @@
* setText sets the text of the field to display
* @param String t: the string to which to set the text
*/
-function setText ( t, force ){
+function setText ( t, force = null){
// force to a string
t = '' + t;
if (force != true && t == this.text) return;
- if (this.visible) this.sprite.setVisible(this.visible);
+ if (this.visible) this.tsprite.setVisible(this.visible);
if (this.maxlength != null && t.length > this.maxlength){
t = t.substring(0, this.maxlength);
}
- this.sprite.setText(t);
+ this.tsprite.setText(t);
this.text = t;
if (this.width == 0 || (this.resize && this.multiline == false)) {
@@ -715,7 +755,7 @@
//resizable fields adjust their height
if (this.sizeToHeight) {
- var h = this.sprite.getTextfieldHeight();
+ var h = this.tsprite.getTextfieldHeight();
if (h > 0) {
this.setHeight(h);
}
@@ -755,24 +795,29 @@
/**
* @access private
*/
-prototype.getTextWidth.dependencies = function ( who , self){
+ if($swf9) { } else {
+ prototype.getTextWidth.dependencies = function ( who , self){
return [ self , "text" ];
}
-
+ }
/**
* @access private
*/
-prototype.getTextHeight.dependencies = function ( who , self){
+if ($swf9) { } else {
+ prototype.getTextHeight.dependencies = function ( who , self){
return [ self , "text" ];
}
+}
/**
* @access private
*/
-prototype.getMaxScroll.dependencies = function ( who , self){
+if ($swf9) { } else {
+ prototype.getMaxScroll.dependencies = function ( who , self){
return [ self , "maxscroll" ];
}
+}
/**
@@ -786,9 +831,11 @@
/**
* @access private
*/
-prototype.getText.dependencies = function ( who , self){
+if ($swf9) { } else {
+ prototype.getText.dependencies = function ( who , self){
return [ self , "text" ];
}
+}
static var escapeChars = { '>': '>', '<': '<'};
@@ -823,14 +870,14 @@
*/
function setSelectable ( isSel ){
this.selectable = isSel;
- this.sprite.setSelectable(isSel);
+ this.tsprite.setSelectable(isSel);
}
/**
* @access private
*/
function setFontName ( fname ){
- this.sprite.setFontName(fname);
+ this.tsprite.setFontName(fname);
this.fontname = fname;
// force recompute of height if needed
this.setText( this.getText(), true);
@@ -840,7 +887,7 @@
* @access private
*/
function setFontSize ( fsize ){
- this.sprite.setFontSize(fsize);
+ this.tsprite.setFontSize(fsize);
this.fontsize = fsize;
// force recompute of height if needed
this.setText( this.getText(), true);
@@ -850,7 +897,7 @@
* @access private
*/
function setFontStyle ( fstyle ){
- this.sprite.setFontStyle(fstyle);
+ this.tsprite.setFontStyle(fstyle);
this.fontstyle = fstyle;
}
@@ -862,7 +909,7 @@
* @param Boolean ml: true if the text field should allow multiple lines
*/
function setMultiline ( ml ){
- this.sprite.setMultiline(ml);
+ this.tsprite.setMultiline(ml);
this.multiline = (ml == true);
}
@@ -872,7 +919,7 @@
* @access private
*/
function setBorder ( onroff ){
- this.sprite.setBorder(onroff);
+ this.tsprite.setBorder(onroff);
}
/**
@@ -880,7 +927,7 @@
* @todo should wrapping be made orthogonal to the multiline flag?
*/
function setWordWrap ( wrap ){
- this.sprite.setWordWrap(wrap);
+ this.tsprite.setWordWrap(wrap);
}
@@ -888,7 +935,7 @@
* @access private
*/
function setEmbedFonts ( onroff ){
- this.sprite.setEmbedFonts(onroff);
+ this.tsprite.setEmbedFonts(onroff);
}
/***
@@ -900,7 +947,7 @@
if (this.capabilities.advancedfonts) {
if ((aliasType == "normal") || (aliasType == "advanced")) {
this.antiAliasType = aliasType;
- this.sprite.setAntiAliasType(aliasType);
+ this.tsprite.setAntiAliasType(aliasType);
} else if ($debug) {
Debug.warn("antiAliasType invalid, must be 'normal' or 'advanced', but you said '" + aliasType + "'");
}
@@ -929,7 +976,7 @@
if (this.capabilities.advancedfonts) {
if ((gridFit == "none") || (gridFit == "pixel") || (gridFit == "subpixel")) {
this.gridFit = gridFit;
- this.sprite.setGridFit(gridFit);
+ this.tsprite.setGridFit(gridFit);
} else if ($debug) {
Debug.warn("gridFit invalid, must be 'none', 'pixel', or 'subpixel' but you said '" + gridFit + "'");
}
@@ -959,7 +1006,7 @@
if (this.capabilities.advancedfonts) {
if ((sharpness >= -400) && (sharpness <= 400)) {
this.sharpness = sharpness;
- this.sprite.setSharpness(sharpness);
+ this.tsprite.setSharpness(sharpness);
} else if ($debug) {
Debug.warn("sharpness out of range, must be -400 to 400");
}
@@ -989,7 +1036,7 @@
if (this.capabilities.advancedfonts) {
if ((thickness >= -200) && (thickness <= 200)) {
this.thickness = thickness;
- this.sprite.setThickness(thickness);
+ this.tsprite.setThickness(thickness);
} else if ($debug) {
Debug.warn("thickness out of range, must be -200 to 200");
}
@@ -1025,7 +1072,7 @@
*
*/
function setHScroll (s){
- this.sprite.setHScroll(s);
+ this.tsprite.setHScroll(s);
}
@@ -1040,7 +1087,7 @@
* selected.
*/
function setSelection ( start , end ){
- this.sprite.setSelection(start, end);
+ this.tsprite.setSelection(start, end);
/*
var sf = targetPath( this.__LZtextclip);
if( Selection.getFocus() != sf ) {
@@ -1062,7 +1109,7 @@
* based. If the text cursor is not in the textfield, this method returns -1.
*/
function getSelectionPosition ( ){
- return this.sprite.getSelectionPosition();
+ return this.tsprite.getSelectionPosition();
/*
var sf = targetPath( this.__LZtextclip) ;
if( Selection.getFocus() != sf ) {
@@ -1079,7 +1126,7 @@
* If the text cursor is not in the textfield, this method returns -1.
*/
function getSelectionSize ( ){
- return this.sprite.getSelectionSize();
+ return this.tsprite.getSelectionSize();
/*
var sf = targetPath( this.__LZtextclip);
if( Selection.getFocus() != sf ) {
@@ -1091,3 +1138,6 @@
}
} // End of LzText
+
+ConstructorMap[LzText.tagname] = LzText;
+
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzViewLinkage.lzs
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzViewLinkage.lzs 2008-03-24 15:57:54 UTC (rev 8369)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzViewLinkage.lzs 2008-03-24 18:04:46 UTC (rev 8370)
@@ -34,6 +34,12 @@
* @access private
*/
class LzViewLinkage {
+
+ var scale:* = 1;
+ var offset:* = 0;
+ var uplinkArray:Array = null;
+ var downlinkArray:Array = null;
+
/**
* @param fromView: the view from which to originate the transformation
* @param toView: the reference view
More information about the Laszlo-checkins
mailing list