Author: hqm
Date: 2008-02-13 18:33:06 -0800 (Wed, 13 Feb 2008)
New Revision: 8024
Added:
openlaszlo/branches/devildog/test/swf9/test-visibility.lzx
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
Log:
Change 20080213-hqm-x by [EMAIL PROTECTED] on 2008-02-13 21:28:38 EST
in /Users/hqm/openlaszlo/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: fixes for lzview
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
add full implementation for lzview.setvisible
declare classChildren in lznode
remove some debug trace statements
Tests:
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-02-14
02:11:33 UTC (rev 8023)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-02-14
02:33:06 UTC (rev 8024)
@@ -42,6 +42,7 @@
var __LZdeferredcarr:* = null;
var _events:* = null;
var data:* = null;
+ var classChildren:* = null;
//////////////////
@@ -1793,6 +1794,13 @@
var sview = this;
do{
sview = sview.immediateparent;
+
+ // TODO [hqm 2008-02] put this check in a $debug, when that is working
for swf9
+ if (sview == null) {
+ Debug.error('searchParents got null immediateparent', this);
+ return;
+ }
+
if (sview[ prop ] != null ){
return sview;
}
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
===================================================================
---
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
2008-02-14 02:11:33 UTC (rev 8023)
+++
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
2008-02-14 02:33:06 UTC (rev 8024)
@@ -182,10 +182,6 @@
return this.textfield.height;
}
- public function getText ( ){
- return this.textfield.text;
- }
-
}# // #passthrough
} // End of LzInputTextSprite
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
2008-02-14 02:11:33 UTC (rev 8023)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
2008-02-14 02:33:06 UTC (rev 8024)
@@ -224,7 +224,14 @@
+ public function appendText( t:String ):void {
+ this.textfield.appendText(t);
+ this.text = this.textfield.text;
+ }
+ public function getText():String {
+ return this.text;
+ }
/** setText( String:text )
o Sets the contents to the specified text
@@ -245,7 +252,7 @@
t = t.toString();
}
- this.text = t;// this.format + t + this.closeformat if proper
measurement were working
+ this.text = t;
this.textfield.htmlText = t;
if (this.resize && (this.multiline == false)) {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
2008-02-14 02:11:33 UTC (rev 8023)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloCanvas.js
2008-02-14 02:33:06 UTC (rev 8024)
@@ -22,6 +22,8 @@
static var tagname = 'canvas';
ConstructorMap[tagname] = LzCanvas;
+
+
static var getters = new LzInheritedHash(LFCView.getters);
static var defaultattrs = new LzInheritedHash(LFCView.defaultattrs);
static var options = new LzInheritedHash(LFCView.options);
@@ -50,7 +52,6 @@
function LzCanvas ( args ) {
super(null, null);
- trace('lzcanvas constructor called');
// TODO: [2006-05-19 ptw] The original did not do this, should we?
// super(null, args);
// Note canvas start
@@ -106,8 +107,6 @@
}
// work around some parser bug with optional args
-#passthrough {
-
override function __LZcallInit (an = null ){
if (this.isinited) return;
@@ -143,8 +142,10 @@
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
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-02-14 02:11:33 UTC (rev 8023)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-02-14 02:33:06 UTC (rev 8024)
@@ -1078,8 +1078,8 @@
}
}
+
/** @access private */
-/** @access private */
function deleteView( recursiveCall ){
if ( $debug ){
Debug.deprecated(this, arguments.callee, this.destroy);
@@ -1089,6 +1089,8 @@
+/** @access private */
+var _visible;
/**
@@ -1099,8 +1101,29 @@
* `true` makes the view visible, `false` makes the view hidden,
* `null` will make the view visible only if it has a data binding.
*/
- function setVisible( amVisible , ignore = null) { }
+function setVisible( amVisible, ignore = null ) {
+ if (this._visible == amVisible) return;
+ this._visible = amVisible;
+ // make us compatible with the new 'visibility' attribute
+ if (amVisible) {
+ var v = "visible";
+ } else if (amVisible == null) {
+ if ($debug) {
+ Debug.info("%w.%s(%w) is deprecated. Perhaps you meant %w.%s(%s)?
If not, use %w.%s('collapse').",
+ this, arguments.callee, amVisible, this,
arguments.callee, false, this, this.setVisibility);
+ }
+ var v = "collapse";
+ } else {
+ var v = "hidden";
+ }
+ this.visibility = v;
+
+ if (this.onvisibility.ready) this.onvisibility.sendEvent( this.visibility
);
+ this.__LZupdateShown();
+}
+
+
/**
* This method sets the <attribute>visibility</attribute> attribute of the
view
* and also disables or re-enables any click region associated with the view.
@@ -1114,36 +1137,47 @@
* @param String amVisible: visibility of view
* @access private
*/
- function setVisibility( amVisible , ignore = null ) { }
-
+function setVisibility( amVisible ) {
+ if (this.visibility == amVisible) return;
+ this.visibility = amVisible;
+ if ($debug) {
+ if (! (amVisible == "visible" || amVisible == "hidden" || amVisible ==
"collapse")) {
+ Debug.error("%w.%s called with unknown arg '%s' use 'visible',
'hidden', or 'collapse'.",
+ this, arguments.callee, amVisible);
+ }
+ }
+ if (this.onvisibility.ready) this.onvisibility.sendEvent( amVisible );
+ this.__LZupdateShown();
+}
+
/**
* TODO: max : should be made private, api call from replication should be
cleaner
* @access private
*/
- function __LZupdateShown( ) {
- if ( this.visibility == "collapse" ){
- var shown = this.__LZvizO && this.__LZvizDat && this.__LZvizLoad;
- } else {
- var shown = (this.visibility == "visible");
- }
+ function __LZupdateShown( ) {
+ if ( this.visibility == "collapse" ){
+ var shown = this.__LZvizO && this.__LZvizDat && this.__LZvizLoad;
+ } else {
+ var shown = (this.visibility == "visible");
+ }
- if ( shown != this.visible ){
- this.visible = shown;
+ if ( shown != this.visible ){
+ this.visible = shown;
- // FIXME: [hqm 2006-09] How do we end up with a null sprite? Some
destroy ordering thing?
- if (this.sprite ) {
- this.sprite.setVisible(shown);
- }
+ // FIXME: [hqm 2006-09] How do we end up with a null sprite? Some
destroy ordering thing?
+ if (this.sprite ) {
+ this.sprite.setVisible(shown);
+ }
- var ip = this.immediateparent;
- if (ip && ip.__LZcheckwidth)
- ip.__LZcheckwidthFunction( this );
- if (ip && ip.__LZcheckheight)
- ip.__LZcheckheightFunction( this );
+ var ip = this.immediateparent;
+ if (ip && ip.__LZcheckwidth)
+ ip.__LZcheckwidthFunction( this );
+ if (ip && ip.__LZcheckheight)
+ ip.__LZcheckheightFunction( this );
- if (this.onvisible.ready) this.onvisible.sendEvent( shown );
- }
- }
+ if (this.onvisible.ready) this.onvisible.sendEvent( shown );
+ }
+ }
/**
* Sets the opacity for the view. The opacity is a number between 0.0
* (transparent) and 1.0 (opaque).
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
2008-02-14 02:11:33 UTC (rev 8023)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LzText.js
2008-02-14 02:33:06 UTC (rev 8024)
@@ -477,7 +477,11 @@
* @param String t: The string to add
*/
function addText ( t ){
- this.setText( this.getText() + t );
+ // TODO [hqm 2008-02] this 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();
}
/**
Added: openlaszlo/branches/devildog/test/swf9/test-visibility.lzx
Property changes on: openlaszlo/branches/devildog/test/swf9/test-visibility.lzx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins