Author: hqm
Date: 2008-01-06 18:27:58 -0800 (Sun, 06 Jan 2008)
New Revision: 7751
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.js
openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
Log:
checkpoint swf9 lfc changes
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-06
22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/LzNode.js 2008-01-07
02:27:58 UTC (rev 7751)
@@ -1492,7 +1492,7 @@
* @access protected
* @param String name: A string to use for the name of this node.
*/
-function setName ( name ){
+function setName ( name, ignore = null ){
if ((typeof(name) == 'string') && name.length) {
if ($debug) {
if (this.parent && this.parent[name] && this.parent[name] !==
this) {
@@ -1556,7 +1556,7 @@
* @access protected
* @param String id: The id to use for this node.
*/
-function setID ( id ){
+ function setID ( id , ignore = null){
//support for current system
if ((typeof(id) == 'string') && id.length) {
if ($debug) {
@@ -1588,7 +1588,7 @@
* @access public
* @param String dp: The string to use as the datapath.
*/
-function setDatapath ( dp ) {
+ function setDatapath ( dp , ignore = null) {
if (null != this.datapath && dp != LzNode._ignoreAttribute) {
this.datapath.setXPath(dp);
} else {
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/core/dummyclasses.js
2008-01-07 02:27:58 UTC (rev 7751)
@@ -57,10 +57,6 @@
trace('dummy LzAnimator declared in core/dummyclasses.js');
}
-public class LzGlobalMouse {
- public function LzGlobalMouse(...rest){}
-}
-
public class LzBrowser {
public static var defaultPortNums = { http: 80, https: 443 };
@@ -69,3 +65,20 @@
return null;
}
}
+
+public class LzFocus {
+ static function getFocus() {
+ }
+
+ static function clearFocus() {
+ }
+ static function __LZcheckFocusChange(...rest) {
+ }
+
+}
+
+public class LzTrack {
+ static function __LZmouseup() {
+ }
+
+}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.js
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/events/LaszloEvents.js
2008-01-07 02:27:58 UTC (rev 7751)
@@ -21,10 +21,9 @@
* @shortdesc The receiver in Laszlo's point-to-point event system.
* @see LzEvent
*/
-class LzDelegate {
+dynamic class LzDelegate {
var __delegateID:int = 0;
- var events:Array;
/**
*
@@ -40,7 +39,6 @@
// if ($debug) {
// this._dbg_created = Debug.backtrace();
// }
- this.events = [];
this.c = context;
if ( $debug ){
if (typeof(functionName) != "string")
@@ -91,7 +89,8 @@
// Usually this is because a deleted view has idle or timer events
// still registered.
var context = this.c;
- if (context) {
+ trace('** LzDelegate execute', this.enabled && context);
+ if (this.enabled && context) {
if (context['__LZdeleted']) {
return;
}
@@ -126,7 +125,7 @@
anEvent.addDelegate( this );
}
- this.events[ this.lastevent++ ] = anEvent;
+ this[ this.lastevent++ ] = anEvent;
// If debugging, add an informative name
if ($debug) {
@@ -151,8 +150,8 @@
*/
function unregisterAll ( ){
for (var i = 0; i< this.lastevent ; i++){
- this.events[ i ].removeDelegate( this );
- this.events[ i ] = null;
+ this[ i ].removeDelegate( this );
+ this[ i ] = null;
}
this.lastevent = 0;
}
@@ -165,19 +164,19 @@
function unregisterFrom ( event ){
var keep = [];
for (var i = 0; i< this.lastevent ; i++){
- var ev = this.events[ i ];
+ var ev = this[ i ];
if ( ev == event ){
ev.removeDelegate( this );
} else {
keep.push( ev );
}
- this.events[ i ] = null;
+ this[ i ] = null;
}
//now fix it
this.lastevent = 0;
var l = keep.length;
for ( var i = 0; i < l; i++ ){
- this.events[ this.lastevent++ ] = keep[ i ];
+ this[ this.lastevent++ ] = keep[ i ];
}
}
@@ -236,8 +235,8 @@
*/
function _dbg_name (){
var name = Debug.formatToString("%0.48w.%s()", this.c, this.f);
- if (this.events[0]) {
- name += Debug.formatToString("/* handles %w%s */", this.events[0],
this.events[1]?" ...":"");
+ if (this[0]) {
+ name += Debug.formatToString("/* handles %w%s */", this[0], this[1]?"
...":"");
}
return name;
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
2008-01-07 02:27:58 UTC (rev 7751)
@@ -73,17 +73,13 @@
,advancedfonts: true
}
- public function LzSprite (... initargs) {
+ public function LzSprite (newowner = null, isroot = null, args = null) {
// owner:*, isroot:Boolean
- if (initargs.length == 2) {
- this.owner = initargs[0];
- this.isroot = initargs[1];
+ this.owner = newowner;
+ if (owner == null) return;
+ if (isroot) {
+ this.isroot = true;
}
- // Defaulting bitmap caching to true, for performance.
- this.cacheAsBitmap = true;
- if (this.isroot) {
-
- }
}
public function init (v:Boolean = true):void {
@@ -185,7 +181,6 @@
spr.addEventListener(MouseEvent.DOUBLE_CLICK,
handleMouse_DOUBLE_CLICK);
spr.addEventListener(MouseEvent.MOUSE_DOWN, handleMouse_MOUSE_DOWN);
spr.addEventListener(MouseEvent.MOUSE_UP, handleMouse_MOUSE_UP);
- spr.addEventListener(MouseEvent.MOUSE_MOVE, handleMouse_MOUSE_MOVE);
spr.addEventListener(MouseEvent.MOUSE_OVER, handleMouse_MOUSE_OVER);
spr.addEventListener(MouseEvent.MOUSE_OUT, handleMouse_MOUSE_OUT);
}
@@ -228,8 +223,10 @@
o If false, sets the sprite to be unclickable and not receive mouse
events
*/
public function setClickable( c:Boolean ):void {
+ trace('setClickable', owner, c);
//if (this.clickable == c) return;
this.clickable = c;
+ attachMouseEvents(this);
if (this.clickable) {
var cb:Sprite = this.clickbutton;
if (cb == null) {
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
2008-01-07 02:27:58 UTC (rev 7751)
@@ -50,7 +50,8 @@
public var password:Boolean = false;
public var scrollheight:Number = 0;
- public function LzTextSprite (... initargs) {
+ public function LzTextSprite (newowner = null, isroot = null) {
+ super(newowner,false)
// owner:*, isroot:Boolean
this.textfield = createTextField(0,0,400,20);
}
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.js
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/services/LzModeManager.js
2008-01-07 02:27:58 UTC (rev 7751)
@@ -47,19 +47,26 @@
* @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 LzModeManager {
+ #passthrough (toplevel:true) {
+
+ import flash.utils.*;
+
+}#
+
/** Sent when the mode changes. */
-LzModeManager.onmode = LzDeclaredEvent;
+static var onmode = LzDeclaredEvent;
/** @access private */
-LzModeManager.__LZlastclick = null;
-LzModeManager.willCall = false;
-LzModeManager.eventsLocked = false;
+static var __LZlastclick = null;
+static var __LZlastClickTime = 0;
+static var willCall = false;
+static var eventsLocked = false;
-LzModeManager.modeArray = new Array();
+static var modeArray = new Array();
-LzModeManager.toString = function (){
+static function toString (){
return "mode manager";
}
@@ -68,9 +75,9 @@
* Pushes the view onto the stack of modal views
* @param LzView view: The view intending to have modal iteraction
*/
-LzModeManager.makeModal = function ( view ) {
- this.modeArray.push( view );
- if (this.onmode.ready) this.onmode.sendEvent( view );
+static function makeModal ( view ) {
+ modeArray.push( view );
+ if (onmode.ready) onmode.sendEvent( view );
var f = LzFocus.getFocus();
if ( f && ! f.childOf( view ) ){
LzFocus.clearFocus();
@@ -81,13 +88,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 ) {
+static 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 );
+ for ( var i = modeArray.length-1 ; i >=0 ; i-- ){
+ if ( modeArray[ i ] == view ){
+ modeArray.splice( i , modeArray.length - i );
+ var newmode = modeArray[ i - 1 ];
+ if (onmode.ready) onmode.sendEvent( newmode || null );
var f = LzFocus.getFocus();
if ( newmode && f && ! f.childOf( newmode ) ){
LzFocus.clearFocus();
@@ -100,10 +107,10 @@
/**
* Clears all modal views from the stack
*/
-LzModeManager.releaseAll = function ( ) {
+static function releaseAll ( ) {
// reset array to remove all views
- this.modeArray = new Array();
- if (this.onmode.ready) this.onmode.sendEvent( null );
+ modeArray = new Array();
+ if (onmode.ready) onmode.sendEvent( null );
}
/**
@@ -113,7 +120,7 @@
* @param LzView view: the view that received the event
* @param String eventStr: the event string
*/
-LzModeManager.handleMouseEvent= function ( view, eventStr ) {
+static function handleMouseEvent ( view, eventStr ) {
//Debug.warn("%w, %w", view , eventStr);
if (eventStr == "onmouseup") LzTrack.__LZmouseup();
@@ -122,19 +129,22 @@
var dosend = true;
var isinputtext = false;
- if (view == null ) { // check if the mouse event is in a inputtext
- view = this.__findInputtextSelection();
+ // TODO [hqm 2008-01] what is this?
+ /*
+ if (view == null ) { // check if the mouse event is in a inputtext
+ view = __findInputtextSelection();
}
+ */
LzGlobalMouse.__mouseEvent(eventStr, view);
- if ( this.eventsLocked == true ){
+ if ( eventsLocked == true ){
return;
}
- var i = this.modeArray.length-1;
+ var i = modeArray.length-1;
while( dosend && i >= 0 ){
- var mView = this.modeArray[ i-- ];
+ var mView = modeArray[ i-- ];
// exclude the debugger from the mode
if ($debug) {
if (view && Debug && view.childOf(Debug))
@@ -151,16 +161,16 @@
if ( dosend ){
//check for double-click
if ( eventStr == "onclick" ){
- if ( this.__LZlastclick == view &&
+ if ( __LZlastclick == view &&
('ondblclick' in view && view.ondblclick) &&
(view.ondblclick.getDelegateCount() > 0) &&
- (getTimer() - this.__LZlastClickTime)< view.DOUBLE_CLICK_TIME
){
+ (getTimer() - __LZlastClickTime)< view.DOUBLE_CLICK_TIME ){
//this is a double-click
eventStr = "ondblclick";
- this.__LZlastclick = null;
+ __LZlastclick = null;
} else {
- this.__LZlastclick = view;
- this.__LZlastClickTime = getTimer();
+ __LZlastclick = view;
+ __LZlastClickTime = getTimer();
}
}
@@ -175,7 +185,8 @@
//this on matters for onmouseup and onmousedown, but it's easier to just
//set it regardless
- this[ "haveGlobal" + eventStr ] = false;
+ // TODO [hqm 2008-01] I don't know what this is for...
+ // this[ "haveGlobal" + eventStr ] = false;
}
@@ -185,23 +196,23 @@
* other views may not
* @access private
*/
-LzModeManager.__LZallowFocus= function ( view ) {
- var len = this.modeArray.length;
- return len == 0 || view.childOf ( this.modeArray[len-1] );
+static function __LZallowFocus ( view ) {
+ var len = modeArray.length;
+ return len == 0 || view.childOf ( modeArray[len-1] );
}
/**
* Prevents all mouse events from firing.
* */
-LzModeManager.globalLockMouseEvents = function (){
- this.eventsLocked = true;
+static function globalLockMouseEvents (){
+ eventsLocked = true;
}
/**
* Restore normal mouse event firing.
* */
-LzModeManager.globalUnlockMouseEvents = function (){
- this.eventsLocked = false;
+static function globalUnlockMouseEvents (){
+ eventsLocked = false;
}
/**
@@ -210,9 +221,9 @@
* @return Boolean: true if the view is in the modelist
*
*/
-LzModeManager.hasMode = function ( view ){
- for ( var i = this.modeArray.length -1 ; i >= 0; i-- ){
- if ( view == this.modeArray[ i ] ){
+static function hasMode ( view ){
+ for ( var i = modeArray.length -1 ; i >= 0; i-- ){
+ if ( view == modeArray[ i ] ){
return true;
}
}
@@ -222,9 +233,10 @@
/**
* @access private
*/
-LzModeManager.getModalView = function ( ){
- return this.modeArray[ this.modeArray.length - 1] || null;
+static function getModalView ( ){
+ return modeArray[ modeArray.length - 1] || null;
}
+}
// Register for callbacks from the kernel
-LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
+ //LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-01-06 22:04:35 UTC (rev 7750)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/views/LaszloView.js
2008-01-07 02:27:58 UTC (rev 7751)
@@ -1230,6 +1230,7 @@
* events
*/
function mouseevent(eventname) {
+ trace('view mouseevent', eventname, this, this[eventname].ready);
if (this[eventname] && this[eventname].ready)
this[eventname].sendEvent(this);
}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins