Making canvas more of a real view seems like a good idea. Maybe all views can build their sprites sooner?

On 2008-03-27, at 13:14 EDT, [EMAIL PROTECTED] wrote:
Author: hqm
Date: 2008-03-27 10:14:30 -0700 (Thu, 27 Mar 2008)
New Revision: 8441

Modified:
  openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs
  openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.js
  openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
  openlaszlo/trunk/test/swf9/hello.lzx
Log:
Change 20080327-hqm-d by [EMAIL PROTECTED] on 2008-03-27 13:14:05 EDT
   in /Users/hqm/openlaszlo/trunk4
   for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix for swf9 to make canvas init just once and have nonzero size

New Features:

Bugs Fixed:

Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:


Tests:



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs 2008-03-27 16:06:15 UTC (rev 8440) +++ openlaszlo/trunk/WEB-INF/lps/lfc/events/LaszloEvents.lzs 2008-03-27 17:14:30 UTC (rev 8441)
@@ -21,7 +21,7 @@
  * @shortdesc The receiver in Laszlo's point-to-point event system.
  * @see LzEvent
  */
-final class LzDelegate {
+dynamic final class LzDelegate {

    var __delegateID:int = 0;


Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.js 2008-03-27 16:06:15 UTC (rev 8440) +++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.js 2008-03-27 17:14:30 UTC (rev 8441)
@@ -69,7 +69,7 @@
  static var attributes = new LzInheritedHash(LzView.attributes);

var resourcetable:*;
-var _lzinitialsubviews:*;
+var _lzinitialsubviews:Array = [];
var totalnodes:*;
var framerate:*;
var creatednodes:*;
@@ -86,17 +86,9 @@
var __LZmousemoveDel:LzDelegate;


-
function LzCanvas ( args ) {
    super(null, args);

- // 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');
@@ -104,10 +96,7 @@
    // TODO [hqm 2008-01] nobody seems to reference this
    //    this.hasdatapath = true;

-
-
    this.datapath = {};
-
    this.immediateparent = this;

    this.mask = null;
@@ -123,13 +112,6 @@
    this.lpsversion = args.lpsversion + "." + this.__LZlfcversion;
    delete args.lpsversion;

-    this.sprite = new LzSprite(this, true);
-
-    this.__LZapplyArgs( args );
-
-    this.isinited = false;
-    this._lzinitialsubviews = [];
-
    this.datasets = {};
    global.canvas = this;
    this.parent = this;
@@ -352,7 +334,6 @@
  */
override function init (){
    trace("LzCanvas.init called");
-
    // cheapo debugger printing
    sprite.addChild(lzconsole.consoletext);
    sprite.addChild(lzconsole.consoleinputtext);
@@ -465,15 +446,6 @@
/**
  * @access private
  */
-override function setWidth (v){
-    if ( $debug ){
-        Debug.error( "setWidth cannot be called on the canvas." );
-    }
-}
-
-/**
-  * @access private
-  */
function isProxied ( ){
    return this.proxied;
}
@@ -487,14 +459,6 @@
    }
}

-/**
-  * @access private
-  */
-override function setHeight (v ){
-    if ( $debug ){
-        Debug.error( "setHeight cannot be called on the canvas." );
-    }
-}

/**
  * @access private

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-03-27 16:06:15 UTC (rev 8440) +++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-03-27 17:14:30 UTC (rev 8441)
@@ -365,12 +365,6 @@
  * @access public
  */
override function construct ( parent , args) {
- // TODO [hqm 2008-03] Needed to move this up earlier for swf9, better verify that is OK in swf8/dhtml,
-    // but args won't be munged by applyArgs properly yet?
-    if ($swf9) {
-        this.__makeSprite(args);
-    }
-
//this.callInherited( "construct" , arguments.callee , parent ,args );
    super.construct( (parent ? parent : canvas), args );

@@ -389,11 +383,7 @@
        this.mask = ip.mask;
    }

-    if ($swf9) {
-        // can we make swf9 support __makeSprite call here?
-    } else {
-        this.__makeSprite(args);
-    }
+    this.__makeSprite(args);

    //this.__LZdepth = ip.__LZsvdepth++;
    //this.__LZsvdepth = 0;
@@ -1434,7 +1424,6 @@
function setWidth ( v ){
    if (this._width != v) {
        this._width = v;
-        //Debug.write('LzView.setWidth', this, v, this.sprite);
        this.sprite.setWidth(v);

        if ( v == null ){

Modified: openlaszlo/trunk/test/swf9/hello.lzx
===================================================================
--- openlaszlo/trunk/test/swf9/hello.lzx 2008-03-27 16:06:15 UTC (rev 8440) +++ openlaszlo/trunk/test/swf9/hello.lzx 2008-03-27 17:14:30 UTC (rev 8441)
@@ -4,16 +4,19 @@
  <!--    <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>

-  <handler event="oninit" >
+
+  <handler name="oninit" >
    var d = new LzDelegate( canvas.mytimer , "tellTime" );
    LzIdle.callOnIdle( d );
  </handler>
+-->

  <view x="200" y="10" resource="testmedia/cherry.png"
        onclick="this.animate('rotation', 45, 1000, true)">


_______________________________________________
Laszlo-checkins mailing list
[EMAIL PROTECTED]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to