[Laszlo-checkins] r9595 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/swf9 WEB-INF/lps/lfc/services lps/components/base lps/components/lz
bargull@openlaszlo.org
bargull at openlaszlo.org
Wed Jun 11 15:57:44 PDT 2008
Author: bargull
Date: 2008-06-11 15:57:33 -0700 (Wed, 11 Jun 2008)
New Revision: 9595
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs
openlaszlo/trunk/lps/components/base/basescrollbar.lzx
openlaszlo/trunk/lps/components/base/basetrackgroup.lzx
openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx
openlaszlo/trunk/lps/components/lz/hscrollbar.lzx
openlaszlo/trunk/lps/components/lz/list.lzx
openlaszlo/trunk/lps/components/lz/listitem.lzx
openlaszlo/trunk/lps/components/lz/menu.lzx
openlaszlo/trunk/lps/components/lz/scrollbar.lzx
openlaszlo/trunk/lps/components/lz/textlistitem.lzx
openlaszlo/trunk/lps/components/lz/vscrollbar.lzx
Log:
Change 20080610-bargull-oyd by bargull at dell--p4--2-53 on 2008-06-10 22:04:31
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: menu-component for swf9
New Features:
Bugs Fixed: LPP-6163
Technical Reviewer: hminsky
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
LFCApplication: use lz.ModeManager instead of LzModeManager
LzTrack: check for valid view (__LZlasthit)
listitem: pass current style to _applystyle(..)
basefloatinglist: update destroy() method signature, add method to handle "ondestroy", you can't change a method signature in a subclass in swf9, so added workaround for _setShownItems(..)
hscrollbar, vscrollbar, scrollbar: changed "oninit"-handler to call _showEnabled()
textlistitem: same as listitem
menu: simply text-constraint for menubutton, update method signature for menubutton#showDown(..), add ignore-arg for menuitem#showSubmenu() and menuitem#hideSubmenu()
list: you can't change a method singnature in a subclass in swf9, therefore added workarounds for setBGColor(..), setHeight(..)
basescrollbar: added missing attribute for class, added 'this' to fix swf9-state bug
basetrackgroup: updated construct(..) method signature
Tests:
attached at bugreport (works now in swf8, swf9, dhtml)
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as 2008-06-11 22:57:33 UTC (rev 9595)
@@ -59,7 +59,7 @@
// Register for callbacks from the kernel
- LzMouseKernel.setCallback(LzModeManager, 'rawMouseEvent');
+ LzMouseKernel.setCallback(lz.ModeManager, 'rawMouseEvent');
/* TODO [hqm 2008-01] Do we want to do anything with other
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzTrack.lzs 2008-06-11 22:57:33 UTC (rev 9595)
@@ -231,7 +231,7 @@
}
if ( this.__LZactivegroups == []) this.__LZtrackDel.unregisterAll();
if (typeof(this.__LZreg[group]) != "undefined") {
- this.__LZreg[group].__LZlasthit = 0; // should send ontrackmouseout ?
+ this.__LZreg[group].__LZlasthit = null; // should send ontrackmouseout ?
}
}
@@ -320,12 +320,18 @@
if (thisgroup) this.__LZtrackgroup(thisgroup,hitlist);
if ( !hitlist.length && thisgroup && thisgroup.__LZlasthit ) { // over no tracked views
- if (thisgroup.__LZlasthit.onmousetrackout && thisgroup.__LZlasthit.onmousetrackout.ready) thisgroup.__LZlasthit.onmousetrackout.sendEvent(thisgroup.__LZlasthit);
- thisgroup.__LZlasthit = 0;
+ var onmtrackout:LzDeclaredEventClass = thisgroup.__LZlasthit.onmousetrackout;
+ if (onmtrackout && onmtrackout.ready)
+ onmtrackout.sendEvent(thisgroup.__LZlasthit);
+ thisgroup.__LZlasthit = null;
} else {
var fd = this.__LZfindTopmost(hitlist);
if ( fd && fd != thisgroup.__LZlasthit ) {
- if (thisgroup.__LZlasthit.onmousetrackout && thisgroup.__LZlasthit.onmousetrackout.ready) thisgroup.__LZlasthit.onmousetrackout.sendEvent( thisgroup.__LZlasthit );
+ if (thisgroup.__LZlasthit) {
+ var onmtrackout:LzDeclaredEventClass = thisgroup.__LZlasthit.onmousetrackout;
+ if (onmtrackout && onmtrackout.ready)
+ onmtrackout.sendEvent( thisgroup.__LZlasthit );
+ }
// save this found value so that we can send the onmousetrackover
// after ALL of the onmousetrackouts from all trackgroups are sent
found = true;
@@ -352,12 +358,15 @@
for (var i in this.__LZactivegroups) {
var thisgroup = this.__LZactivegroups[i];
//Debug.info('i', i, thisgroup, thisgroup.__LZlasthit, thisgroup.__LZlasthit.onmousetrackup);
- if (thisgroup && thisgroup.__LZlasthit.onmousetrackup && thisgroup.__LZlasthit.onmousetrackup.ready) {
- if (this['__LZlastmouseup'] == thisgroup.__LZlasthit) {
- this.__LZlastmouseup = null;
- } else {
- thisgroup.__LZlasthit.onmousetrackup.sendEvent(this.__LZlasthit);
- this.__LZlastmouseup = thisgroup.__LZlasthit;
+ if (thisgroup && thisgroup.__LZlasthit) {
+ var onmtrackup:LzDeclaredEventClass = thisgroup.__LZlasthit.onmousetrackup;
+ if (onmtrackup && onmtrackup.ready) {
+ if (this['__LZlastmouseup'] == thisgroup.__LZlasthit) {
+ this.__LZlastmouseup = null;
+ } else {
+ onmtrackup.sendEvent(this.__LZlasthit);
+ this.__LZlastmouseup = thisgroup.__LZlasthit;
+ }
}
}
}
Modified: openlaszlo/trunk/lps/components/base/basescrollbar.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basescrollbar.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/base/basescrollbar.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -18,6 +18,12 @@
@keywords final -->
<attribute name="axis" value="y" type="string"/>
+ <!--- @keywords private -->
+ <attribute name="sizeAxis" type="string" />
+
+ <!--- @keywords private -->
+ <attribute name="otherSizeAxis" type="string" />
+
<!--- The attribute of the scrolltarget that is modified by the scrollbar,
default: value of axis attribute.
@keywords final -->
@@ -81,24 +87,27 @@
<!--- Reference to the other scrollbar, if there is one.
This value is set oninit.
@keywords private -->
- <attribute name="othersb" value="0"/>
+ <attribute name="othersb" value="null" />
+ <!--- @keywords private -->
+ <attribute name="thumb" value="null" />
+
<!-- if the scrollbar is vertical and the developer has not set a height
then the scrollbar should be its parent's height, see oninit -->
<state name="heightConstraint">
<attribute name="height"
- value="${othersb && othersb.visible
- ? immediateparent.height - othersb.height
- : immediateparent.height}"/>
+ value="${this.othersb && this.othersb.visible
+ ? this.immediateparent.height - this.othersb.height
+ : this.immediateparent.height}"/>
</state>
<!-- if the scrollbar is horizontal and the developer has not set a width
then the scrollbar should be its parent's width, see oninit -->
<state name="widthConstraint">
<attribute name="width"
- value="${othersb && othersb.visible
- ? immediateparent.width - othersb.width
- : immediateparent.width }"/>
+ value="${this.othersb && this.othersb.visible
+ ? this.immediateparent.width - this.othersb.width
+ : this.immediateparent.width }"/>
</state>
<!--- @keywords private -->
Modified: openlaszlo/trunk/lps/components/base/basetrackgroup.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basetrackgroup.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/base/basetrackgroup.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -63,7 +63,7 @@
<event name="onmousetrackoutleft" />
<!--- @keywords private -->
- <method name="construct">
+ <method name="construct" args="parent, args">
super.construct.apply(this, arguments);
this._activateDL = new LzDelegate(this,'activateTrackgroup');
Modified: openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/basefloatinglist.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -74,11 +74,16 @@
// Since we are constructed on the canvas, we need to
// listen for out parent being destroyed and clean up after
// ourselves.
- new LzDelegate(this, 'destroy', parent, 'ondestroy');
+ new LzDelegate(this, '_handledestroy', parent, 'ondestroy');
</method>
+
+ <!--- @keywords private -->
+ <method name="_handledestroy" args="ignore" >
+ this.destroy();
+ </method>
<!--- @keywords private -->
- <method name="destroy" args="recursiveCall">
+ <method name="destroy" >
// make sure owner and attachTarget don't know about us.
if (this.owner != null) {
if (this['wouldbename'] != null) {
@@ -166,16 +171,21 @@
this.setAttribute('y', startY);
this.setAttribute('_currentattachy', myAttach);
- this._setShownItems(items, true);
+ this._keepshownitems = true;
+ this._setShownItems(items);
+ this._keepshownitems = false;
this.setAttribute('scrollable', true);
]]></method>
+ <!--- @keywords private -->
+ <attribute name="_keepshownitems" value="false" type="boolean" />
+
<!--- Save original shown items unless overridden by user call or is initial call.
@keywords private -->
- <method name="_setShownItems" args="n,keeporig">
+ <method name="_setShownItems" args="n">
<![CDATA[
super._setShownItems(n);
- if (this._origshownitems == -2 || ! keeporig ) {
+ if (this._origshownitems == -2 || ! this._keepshownitems ) {
this._origshownitems = n;
}
]]>
@@ -239,8 +249,9 @@
}
// Adjust Y
-
- this._setShownItems(this._origshownitems, true);
+ this._keepshownitems = true;
+ this._setShownItems(this._origshownitems);
+ this._keepshownitems = false;
this.setAttribute('scrollable', false);
var doneonce = false;
Modified: openlaszlo/trunk/lps/components/lz/hscrollbar.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/hscrollbar.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/hscrollbar.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -17,9 +17,12 @@
the bgcolor of its closest parent that has a bgcolor defined. -->
<attribute name="disabledbgcolor" value="null"/>
- <handler name="oninit" reference="canvas" method="_showEnabled" />
+ <handler name="oninit" reference="canvas" >
+ this._showEnabled();
+ </handler>
+
<!--- @keywords private -->
- <method name="_showEnabled" args="ignore">
+ <method name="_showEnabled">
<![CDATA[
if (!_enabled) {
var newbgcolor = this.disabledbgcolor;
Modified: openlaszlo/trunk/lps/components/lz/list.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/list.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/list.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -225,18 +225,16 @@
<!--- @keywords private -->
<attribute name="_hasSetHeight" value="false"/>
- <!--- this should not be called internally -->
- <!--- TODO: [2005-02-25 ptw] (Bug 5036) When setters are
- called from __LZapplyArgs they get a second argument that
- is the name of the slot being set. Ignore that. If Bug
- 5036 gets addressed, update this method. -->
<!--- @keywords private -->
- <method name="setHeight" args="h, prop, internal"> <![CDATA[
- if (h != null && !internal) {
+ <attribute name="_heightinternal" value="false" type="boolean" />
+
+ <!--- @keywords private -->
+ <method name="setHeight" args="h"> <![CDATA[
+ if (h != null && !this._heightinternal) {
this._hasSetHeight = true;
} else {
this._hasSetHeight = false;
- if (!internal) {
+ if (!this._heightinternal) {
var hgt = this.calcMyHeight();
h = hgt + border_top + border_bottom;
}
@@ -268,8 +266,9 @@
checkscrollbar();
} else {
var hgt = this.calcMyHeight();
- // TODO: [2005-02-25 ptw] (Bug 5036) See comment on setHeight
- this.setHeight( hgt + border_top + border_bottom, 'height', true);
+ this._heightinternal = true;
+ this.setHeight( hgt + border_top + border_bottom);
+ this._heightinternal = false;
}
]]></method>
@@ -286,13 +285,14 @@
<!--- @keywords private -->
<attribute name="_bgcolor" value="null"/>
+ <!--- @keywords private -->
+ <attribute name="_setbordercolor" value="false" type="boolean" />
- <!--- border == true : call super to set border color
+ <!--- this._setbordercolor == true : call super to set border color
else set _bgcolor for "interior" view
@keywords private -->
- <method name="setBGColor" args="c, border">
- if (border) {
-
+ <method name="setBGColor" args="c">
+ if (this._setborderbg) {
super.setBGColor(c);
} else {
// don't actually set the bgcolor, 'interior' view
@@ -308,8 +308,10 @@
<method name="_applystyle" args="s">
if (this.style != null) {
super._applystyle(s);
- setBGColor(s.bordercolor, true);
- if (this._bgcolor == null) interior.setBGColor(s.bgcolor);
+ this._setbordercolor = true;
+ this.setBGColor(s.bordercolor);
+ this._setbordercolor = false;
+ if (this._bgcolor == null) this.interior.setBGColor(s.bgcolor);
}
</method>
Modified: openlaszlo/trunk/lps/components/lz/listitem.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/listitem.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/listitem.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -46,14 +46,14 @@
<!--- @keywords private -->
<method name="setSelected" args="isSelected" >
super.setSelected(isSelected);
- if (this._initcomplete) _applystyle();
+ if (this._initcomplete) _applystyle(this.style);
</method>
<!--- @keywords private -->
<method name="setHilite" args="ishilited" >
if (ishilited != this.hilited) {
this.hilited = ishilited;
- if (this._initcomplete) _applystyle();
+ if (this._initcomplete) _applystyle(this.style);
}
</method>
@@ -83,7 +83,7 @@
<method name="_showEnabled"> <![CDATA[
setAttribute('clickable', _enabled);
if (_initcomplete) {
- _applystyle();
+ _applystyle(this.style);
}
]]>
</method>
@@ -112,7 +112,7 @@
</class> <!-- END listitem -->
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/trunk/lps/components/lz/menu.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/menu.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/menu.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -114,7 +114,7 @@
<!-- An instance of this class automatically created when a menu is a subview
of a menubar -->
<class name="menubutton" extends="button"
- respondtomouseout="false"
+ respondtomouseout="false" text="${this._menuref.text}"
height="${parent.height}" doesenter="false" focusable="false">
<!--- Reference to menu that created this button.
@@ -139,7 +139,7 @@
<!--- override the button's showDown method to also display the associated menu
@keywords private -->
- <method name="showDown" >
+ <method name="showDown" args="sd=null">
super.showDown();
if ( this._menuref )
parent.openMenu(this._menuref,true);
@@ -302,7 +302,7 @@
// and close this menuitem's menu and all of its hierarchy
parent.owner.open( false );
if ( command ) command.onselect.sendEvent();
- if ( onselect ) this.onselect.sendEvent();
+ if ( this.onselect ) this.onselect.sendEvent();
}
// else do nothing because hiliting this menuitem
// has already opened the submenu if there is one
@@ -328,7 +328,7 @@
<!--- if a menuitem is hilited and has a submenu then this method is
called by a delegate after a period of time specified by delaytime
@keywords private -->
- <method name="showSubmenu" >
+ <method name="showSubmenu" args="ignore" >
// this method is called by a delegate which was activated by a timer.
// First, make sure we still want to show the submenu by checking
// the _doshowsubmenu flag.
@@ -338,7 +338,7 @@
<!--- if a menuitem is unhilited and has a submenu then this method is
called by a delegate after a period of time specified by delaytime
@keywords private -->
- <method name="hideSubmenu" >
+ <method name="hideSubmenu" args="ignore" >
if ( !_doshowsubmenu ) this._submenu.setOpen(false);
</method>
@@ -385,7 +385,7 @@
<!--- @keywords private -->
<method name="_showEnabled"> <![CDATA[
if (_initcomplete) {
- _applystyle();
+ _applystyle(this.style);
}
]]>
</method>
@@ -448,7 +448,7 @@
}
} else { // need to clear hilite
if ( _hiliteview ) {
- this_hiliteview.setHilite( false );
+ this._hiliteview.setHilite( false );
this._hiliteview= null;
}
}
@@ -542,19 +542,9 @@
// Since the parent is a menubar ...
// Create a menubutton and have the menu keep a reference to it.
- this._menubutton = new lz.menubutton( parent,{text:this.text}, null, false);
+ // Likewise, have the menubutton keep a reference to this menu
+ this._menubutton = new lz.menubutton(parent, {_menuref:this}, null, false);
- //Likewise, have the menubutton keep a reference to this menu
- this._menubutton._menuref = this;
-
- // Apply a constraint so that the menubutton's title changes if
- // the menu's title changes.
- var f = function() {
- this.setAttribute("text", this._menuref.text);
- }
- var d = [this, "text"];
- this._menubutton.applyConstraint("text", f, d);
-
// Have the floating list constrain to the menubutton and not
// the parent of the menu ( which would have been menubar in
// this case )
@@ -704,12 +694,12 @@
this.flist.setHilite(null);
this.flist.setAttribute('tracking',true);
this.flist._updateifsubmenu = true;
- this.flist.setVisible( true );
+ this.flist.setAttribute('visible', true);
} else {
LzModeManager.release( this );
this.flist.setHilite(null);
this.flist.setAttribute('tracking',false);
- this.flist.setVisible( false );
+ this.flist.setAttribute('visible', false);
}
if ( onopened ) this.onopened.sendEvent( this.opened );
} else this.opened = isopened;
Modified: openlaszlo/trunk/lps/components/lz/scrollbar.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/scrollbar.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/scrollbar.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -17,9 +17,12 @@
the bgcolor of its closest parent that has a bgcolor defined. -->
<attribute name="disabledbgcolor" value="null"/>
- <handler name="oninit" reference="canvas" method="_showEnabled" />
+ <handler name="oninit" reference="canvas" >
+ this._showEnabled();
+ </handler>
+
<!--- @keywords private -->
- <method name="_showEnabled" args="ignore">
+ <method name="_showEnabled">
<![CDATA[
if (!_enabled) {
var newbgcolor = this.disabledbgcolor;
Modified: openlaszlo/trunk/lps/components/lz/textlistitem.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/textlistitem.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/textlistitem.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -43,7 +43,7 @@
<method name="_showEnabled"> <![CDATA[
super._showEnabled();
if (_initcomplete) {
- _applystyle();
+ _applystyle(this.style);
}
]]>
</method>
@@ -75,7 +75,7 @@
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/trunk/lps/components/lz/vscrollbar.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/vscrollbar.lzx 2008-06-11 20:45:55 UTC (rev 9594)
+++ openlaszlo/trunk/lps/components/lz/vscrollbar.lzx 2008-06-11 22:57:33 UTC (rev 9595)
@@ -18,9 +18,12 @@
<!--- @keywords private -->
<attribute name="width" value="14"/>
- <handler name="oninit" reference="canvas" method="_showEnabled" />
+ <handler name="oninit" reference="canvas" >
+ this._showEnabled();
+ </handler>
+
<!--- @keywords private -->
- <method name="_showEnabled" args="ignore">
+ <method name="_showEnabled">
<![CDATA[
if (!_enabled) {
var newbgcolor = this.disabledbgcolor;
More information about the Laszlo-checkins
mailing list