You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2006/10/13 22:23:30 UTC
svn commit: r463854 - in /incubator/xap/trunk: WebContent/examples/widgets/
src/dojo/src/widget/ src/xap/bridges/basic/ src/xap/bridges/dojo/
src/xap/taghandling/ src/xap/widgets/dojo/
Author: jmargaris
Date: Fri Oct 13 15:23:29 2006
New Revision: 463854
URL: http://svn.apache.org/viewvc?view=rev&rev=463854
Log:
basic events working to some degree (reporting but without
proper parameters), window working to some degree
Added:
incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html (with props)
incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal (with props)
incubator/xap/trunk/WebContent/examples/widgets/window.html (with props)
incubator/xap/trunk/WebContent/examples/widgets/window.xal (with props)
incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js (with props)
Modified:
incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
incubator/xap/trunk/WebContent/examples/widgets/index.html
incubator/xap/trunk/src/dojo/src/widget/FloatingPane.js
incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
incubator/xap/trunk/src/xap/bridges/dojo/MenuBarItemBridge.js
incubator/xap/trunk/src/xap/bridges/dojo/MenuBridge.js
incubator/xap/trunk/src/xap/taghandling/plugin.xml
incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js
Modified: incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/AttributeTester.js Fri Oct 13 15:23:29 2006
@@ -18,9 +18,10 @@
AttributeTester.prototype.reportEvent = function(event){
- alert(event);
+ this.log(event.toString());
}
+//IMPORTANT can remove this now probably
// Don't want to trigger an additional onEdit by popping up
// an alert() box, which would make the textfield lose focus---so write it here
AttributeTester.prototype.reportTextFieldEventWithoutAlert = function(event){
@@ -59,6 +60,31 @@
}
+
+
+AttributeTester.prototype.log = function(text){
+ if (!this._logDiv){
+ var l = document.createElement('div');
+ l.style.position = 'absolute';
+ l.style.right = '5px';
+ l.style.top = '5px';
+ l.style.width = '350px';
+ l.style.height = '350px';
+ l.style.overflow = 'auto';
+ l.style.backgroundColor = '#f0f0f0';
+ l.style.border = '1px solid gray';
+ l.style.fontSize = '10px';
+ l.style.padding = '5px';
+ document.body.appendChild(l);
+ this._logDiv = l;
+ }
+
+ text = text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
+ text = text.replace(/\n/g,'<br>');
+ this._logDiv.innerHTML = this._logDiv.innerHTML + "<br><br>" + text;
+ this._logDiv.scrollTop = this._logDiv.scrollHeight;
+
+}
//IMPORTANT this works if you remove the same thing twice,
//no error. BEcause we still found element in hashtable?
Added: incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html?view=auto&rev=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html Fri Oct 13 15:23:29 2006
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Button</title>
+
+ <style type="text/css">
+ <!--
+ @import url(../../css/xapDefault.css);
+ -->
+ </style>
+
+ <!-- Keep dojo from trying to scan this whole page for dojoType'd tags: -->
+ <script type="text/javascript">
+ djConfig = {
+ parseWidgets: false
+ };
+ </script>
+
+ <script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
+ <script language="JavaScript" type="text/javascript" src="AttributeTester.js"></script>
+
+ </head>
+
+ <body onload="Xap.createAllPredefinedSessions();">
+ <div xapId="ButtonExample" xapSrc="freePanelEvents.xal" xapToolkit="dojo" xapContext="../../"></div>
+</body>
+</html>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal?view=auto&rev=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal Fri Oct 13 15:23:29 2006
@@ -0,0 +1,29 @@
+<xal xmlns="http://www.openxal.org/xal" xmlns:xal="http://www.openxal.org/xal">
+
+
+ <mco:mco
+ xmlns:mco="http://www.openxal.org/mco"
+ id="attributeSetter"
+ src="AttributeTester"
+ />
+
+
+
+ <xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
+ <xm:append select="/xal">
+
+ <xal:freePanel width="200px" height="200px" backgroundColor="black"
+ id="testComponent" orientation="horizontal"
+ onActiveLost="mco:attributeSetter.reportEvent(event)"
+ onActiveGained="mco:attributeSetter.reportEvent(event)"
+ onDblClick="mco:attributeSetter.reportEvent(event)"
+ onMouseDown="mco:attributeSetter.reportEvent(event)"
+ onMouseUp="mco:attributeSetter.reportEvent(event)"
+ onKeyDown="mco:attributeSetter.reportEvent(event)"
+ onKeyUp="mco:attributeSetter.reportEvent(event)"
+ onKeyPress="mco:attributeSetter.reportEvent(event)"
+ />
+
+ </xm:append>
+ </xm:modifications>
+</xal>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/freePanelEvents.xal
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/WebContent/examples/widgets/index.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/index.html?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/index.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/index.html Fri Oct 13 15:23:29 2006
@@ -1,6 +1,6 @@
<body>
-<h2>Basic Tests</h2>
+<h2>Component Tests</h2>
<ul>
<li><a href="button.html"><button></a></li>
<li><a href="label.html"><label></a></li>
@@ -20,6 +20,13 @@
<li><a href="menu.html"><menu></a></li>
<li><a href="popupMenu.html"><popupMenu></a></li>
<li><a href="tooltip.html"><tooltip></a></li>
+<li><a href="window.html"><window></a></li>
+</ul>
+
+
+<h2>Event Tests</h2>
+<ul>
+<li><a href="freePanelEvents.html"><freePanel></a></li>
</ul>
<br>
Added: incubator/xap/trunk/WebContent/examples/widgets/window.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/window.html?view=auto&rev=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/window.html (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/window.html Fri Oct 13 15:23:29 2006
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Button</title>
+
+ <style type="text/css">
+ <!--
+ @import url(../../css/xapDefault.css);
+ -->
+ </style>
+
+ <!-- Keep dojo from trying to scan this whole page for dojoType'd tags: -->
+ <script type="text/javascript">
+ djConfig = {
+ parseWidgets: false
+ };
+ </script>
+
+ <script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
+ <script language="JavaScript" type="text/javascript" src="AttributeTester.js"></script>
+
+ </head>
+
+ <body onload="Xap.createAllPredefinedSessions();">
+ <div xapId="ButtonExample" xapSrc="window.xal" xapToolkit="dojo" xapContext="../../"></div>
+</body>
+</html>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/window.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/xap/trunk/WebContent/examples/widgets/window.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/window.xal?view=auto&rev=463854
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/window.xal (added)
+++ incubator/xap/trunk/WebContent/examples/widgets/window.xal Fri Oct 13 15:23:29 2006
@@ -0,0 +1,71 @@
+<xal xmlns="http://www.openxal.org/xal" xmlns:xal="http://www.openxal.org/xal">
+
+
+ <mco:mco
+ xmlns:mco="http://www.openxal.org/mco"
+ id="attributeSetter"
+ src="AttributeTester"
+ />
+
+
+
+ <xm:modifications xmlns:xm="http://www.openxal.org/xmodify">
+ <xm:append select="/xal">
+
+ <xal:window title="A window" id="testComponent">
+ <xal:borderPanel backgroundColor="green">
+ <xal:menuBar borderPosition="north">
+ <xal:menuBarItem text="Edit">
+ <xal:menu>
+ <xal:menuItem text="Cut" onCommand="mco:attributeSetter.reportEvent(event)"/>
+ <xal:menuItem text="Copy"/>
+ <xal:horizontalSeparator />
+ <xal:menuItem text="Paste"/>
+ </xal:menu>
+ </xal:menuBarItem>
+
+ <xal:menuBarItem text="File">
+ <xal:menu>
+ <xal:menuItem text="Open"/>
+ <xal:menuItem text="Close"/>
+ <xal:menuItem text="Preferences.">
+ <xal:menu>
+ <xal:menuItem text="A preference"/>
+ <xal:menuItem text="A different preference"/>
+ </xal:menu>
+ </xal:menuItem>
+ </xal:menu>
+ </xal:menuBarItem>
+
+ <xal:menuBarItem text="Format">
+ <xal:menu>
+ <xal:menuItem text="Cut"/>
+ <xal:menuItem text="Copy"/>
+ <xal:menuItem text="Paste"/>
+ </xal:menu>
+ </xal:menuBarItem>
+
+ <xal:menuBarItem text="Run">
+ <xal:menu>
+ <xal:menuItem text="Open"/>
+ <xal:menuItem text="Close"/>
+ <xal:menuItem text="Preferences..."/>
+ </xal:menu>
+ </xal:menuBarItem>
+
+ </xal:menuBar>
+
+ <xal:verticalPanel borderPosition="center">
+ <xal:button text="Button 1"/>
+ <xal:button text="Button 2"/>
+ </xal:verticalPanel>
+ </xal:borderPanel>
+
+ </xal:window>
+
+ <!--standard test things -->
+
+ <include href="standardButtons.xal" xmlns="http://www.openxal.org/xinclude"/>
+ </xm:append>
+ </xm:modifications>
+</xal>
Propchange: incubator/xap/trunk/WebContent/examples/widgets/window.xal
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/src/dojo/src/widget/FloatingPane.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/dojo/src/widget/FloatingPane.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/dojo/src/widget/FloatingPane.js (original)
+++ incubator/xap/trunk/src/dojo/src/widget/FloatingPane.js Fri Oct 13 15:23:29 2006
@@ -275,7 +275,7 @@
] );
// If any of the children have layoutAlign specified, obey it
- dojo.html.layout(this.containerNode, this.children, "top-bottom");
+ // dojo.html.layout(this.containerNode, this.children, "top-bottom");
this.bgIframe.onResized();
if(this.shadow){ this.shadow.size(w, h); }
Modified: incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/basic/AbstractBlackBoxWidgetBridge.js Fri Oct 13 15:23:29 2006
@@ -22,6 +22,7 @@
Xap.require("xap.util.LogFactory") ;
Xap.require("xap.taghandling.AbstractTagImpl") ;
Xap.require("dojo.widget.Tooltip") ;
+Xap.require("dojo.event.*") ;
/**
* @fileoverview
@@ -197,6 +198,23 @@
// constructor, via a database call, using a JSON-encoded object over the fibre,
// or stolen from a fruit-cart:
this.obtainPeer() ;
+
+ var rootNode = this.getRootDomNode();
+ if (rootNode){
+ //basic default events
+ //TODO only add these if user has the event
+ //declared in XML? Would be more efficient
+ //TODO what about bubbling? Report events
+ //on children as our own?
+ dojo.event.connect(rootNode,"onfocus", this, "onFocus");
+ dojo.event.connect(rootNode,"onblur", this, "onBlur");
+ dojo.event.connect(rootNode,"ondblclick", this, "onDblClick");
+ dojo.event.connect(rootNode,"onkeydown", this, "onKeyDown");
+ dojo.event.connect(rootNode,"onkeyup", this, "onKeyUp");
+ dojo.event.connect(rootNode,"onkeypress", this, "onKeyPress");
+ dojo.event.connect(rootNode,"onmousedown", this, "onMouseDown");
+ dojo.event.connect(rootNode,"onmouseup", this, "onMouseUp");
+ }
}
/**
@@ -383,13 +401,7 @@
}
-xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getNewAllowedAttributes = function(){
- return ["x","y","width","height","backgroundColor",
- "borderWidth","borderColor","borderStyle","margin",
- "padding","color","textDecoration","fontFamily",
- "fontStyle","fontWeight", "fontSize", "textAlign",
- "popup","tooltip"];
-}
+
xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getAllowedAttributes = function(){
if (this.constructor._allowedAttributes){
@@ -462,6 +474,14 @@
}
}
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.getNewAllowedAttributes = function(){
+ return ["x","y","width","height","backgroundColor",
+ "borderWidth","borderColor","borderStyle","margin",
+ "padding","color","textDecoration","fontFamily",
+ "fontStyle","fontWeight", "fontSize", "textAlign",
+ "popup","tooltip", "focused"];
+}
+
/**
* Returns a mapping of a property name to a setter instance method; the
@@ -589,4 +609,66 @@
tooltip.connectNode = this.getRootDomNode();
dojo.event.connect(tooltip.connectNode, "onmouseover", tooltip, "onMouseOver");
}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.setFocusedAttribute = function( text ){
+ if (text=="true"){
+ this._requestFocus();
+
+ //have to schedule it because focus can't take place
+ //until DOM is all set and doc is fully loaded
+ //so thing above won't always work
+ dojo.lang.setTimeout(this,_requestFocus,0);
+ }
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype._requestFocus = function(){
+ var rootNode = this.getRootDomNode();
+ if (rootNode && rootNode.focus){
+ rootNode.focus();
+ }
+}
+
+
+/***
+ *
+ * BASIC EVENT HANDLERS
+ *
+ *
+ *
+ *
+ */
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onFocus = function(e){
+ this.fireEvent("onActiveGained");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onBlur = function(e){
+ this.fireEvent("onActiveLost");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onDblClick = function(e){
+ this.fireEvent("onDblClick");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onMouseDown = function(e){
+ this.fireEvent("onMouseDown");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onMouseUp = function(e){
+ this.fireEvent("onMouseUp");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onKeyDown = function(e){
+ this.fireEvent("onKeyDown");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onKeyUp = function(e){
+ this.fireEvent("onKeyUp");
+}
+
+xap.bridges.basic.AbstractBlackBoxWidgetBridge.prototype.onKeyPress = function(e){
+ this.fireEvent("onKeyPress");
+}
+
+
+
Modified: incubator/xap/trunk/src/xap/bridges/dojo/MenuBarItemBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/MenuBarItemBridge.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/MenuBarItemBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/MenuBarItemBridge.js Fri Oct 13 15:23:29 2006
@@ -42,6 +42,8 @@
"xap.bridges.dojo.DojoWidgetBridge"
);
+
+//IMPORTANT DOJO workaround menu item sizing is bad in .31 dojo
dojo.widget.MenuBarItem2.prototype.layoutItem = function(item_h){
var label_w = dojo.style.getOuterWidth(this.labelNode.childNodes[0]);
label_w += 20;
Modified: incubator/xap/trunk/src/xap/bridges/dojo/MenuBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/MenuBridge.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/MenuBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/MenuBridge.js Fri Oct 13 15:23:29 2006
@@ -56,6 +56,8 @@
//which we don't always have.
//IMPORTANT give each root dom node the same ID as in XAP dom? would be
//reasonable. Then we can get rid of this
+
+//IMPORTANT DOJO workaround
xap.bridges.dojo.MenuBridge.prototype.bindDomNode = function( node ){
dojo.widget.Menu2.OperaAndKonqFixer.fixNode(node);
Added: incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js?view=auto&rev=463854
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js Fri Oct 13 15:23:29 2006
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+ /**
+ * @fileoverview
+ *
+ * A bridge class that controls a floating pane peer.
+ */
+
+Xap.provide("xap.bridges.dojo.WindowBridge");
+
+Xap.require("dojo.widget.FloatingPane");
+Xap.require("xap.session.ClientEvent");
+
+ /**
+ * @fileoverview
+ *
+ * A bridge class with dojo toolkit box panel peer.
+ */
+
+xap.bridges.dojo.WindowBridge= function() {
+ xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+
+Xap.setupClassAsSubclassOf(
+ "xap.bridges.dojo.WindowBridge",
+ "xap.bridges.dojo.DojoWidgetBridge"
+);
+
+
+
+xap.bridges.dojo.WindowBridge.prototype.init = function() {
+ this.superclass.init.call(this);
+ this.getPeer().resizeTo(200,200);
+}
+
+xap.bridges.dojo.WindowBridge.prototype.getPeerString = function(){
+ return "FloatingPane" ;
+}
+
+
+/**
+ *
+ *
+ * Attribute definitions
+ *
+ */
+
+
+xap.bridges.dojo.WindowBridge.prototype.getNewAllowedAttributes = function(){
+ return [];
+}
+
+
+
+/**
+ *
+ * @return an object mapping allowed initial
+ * XAL properties to their Dojo equivalents
+ */
+xap.bridges.dojo.WindowBridge.prototype.getXalToToolkitMapper = function(){
+ var mapper = this.superclass.getXalToToolkitMapper.call(this);
+ mapper.title = "title";
+ mapper.closable = "displayCloseAction";
+ mapper.minimizable = "displayMinimizeAction";
+ mapper.maximizable = "displayMaximizeAction";
+ mapper.resizable = "resizable";
+ return mapper;
+}
+
+xap.bridges.dojo.WindowBridge.prototype.mapAllowedInitialPropertiesFromXalToDojo = function(propertyMap,attrHolder){
+ //fill in some good defaults
+ propertyMap.displayCloseAction = true;
+ propertyMap.displayMinimizeAction= true;
+ propertyMap.displayMaximizeAction= true;
+
+ //TODO barfs in IE probably some issue with loading timing,
+ //node not a part of DOM yet, etc
+ //propertyMap.hasShadow= true;
+
+ propertyMap.constrainToContainer= true;
+ this.superclass.mapAllowedInitialPropertiesFromXalToDojo.call(this, propertyMap, attrHolder);
+}
+
+xap.bridges.dojo.WindowBridge.prototype.addChild = function(childHandler, index){
+ this.getPeer().containerNode.parentNode.removeChild(this.getPeer().containerNode);
+ this.getPeer().domNode.appendChild(childHandler.getRootDomNode());
+ this.getPeer().containerNode = childHandler.getRootDomNode();
+
+ //IMPORTANT remove this later, workaround only
+ childHandler.getRootDomNode().style.overflow = "hidden";
+
+ //with this set to hidden the shadow won't appear,
+ //but if set to visible the contentArea sizing is messed up
+ this.getPeer().domNode.style.overflow = "hidden";
+}
+
+
+//IMPORTANT DOJO change to minimize behavior which just hides
+//IMPORTANT when you minimize the restore icon doesn't appear in the
+//correct place because instead of swapping images it just shows/hides
+//the icon but the relative position is off.
+dojo.widget.html.FloatingPane.prototype.minimizeWindow = function(evt) {
+ this.previous={
+ width: dojo.style.getOuterWidth(this.domNode) || this.width,
+ height: dojo.style.getOuterHeight(this.domNode) || this.height,
+ left: this.domNode.style.left,
+ top: this.domNode.style.top,
+ bottom: this.domNode.style.bottom,
+ right: this.domNode.style.right
+ };
+
+ this.resizeTo(this.previous.width,
+ dojo.style.getOuterHeight(this.titleBar) + dojo.style.getOuterHeight(this.resizeBar));
+ this.minimizeAction.style.display="none";
+ this.restoreAction.style.display="";
+ this.windowState="minimized";
+}
+
+dojo.widget.html.FloatingPane.prototype.restoreWindow = function(evt) {
+ for(var attr in this.previous){
+ this.domNode.style[attr] = this.previous[attr];
+ }
+ this.resizeTo(this.previous.width, this.previous.height);
+ this.previous=null;
+
+ this.restoreAction.style.display="none";
+ this.maximizeAction.style.display=this.displayMaximizeAction ? "" : "none";
+
+ //added this single new line
+ this.minimizeAction.style.display=this.displayMinimizeAction ? "" : "none";
+ this.windowState="normal";
+}
+
+
+dojo.require("dojo.html.shadow");
+dojo.require("dojo.lang");
+dojo.require("dojo.uri");
+
+//IMPORTANT dojo workaround for dropshadow drawing on 3 sides of object
+dojo.html.shadow.prototype.init = function(node){
+ this.node=node;
+
+ // make all the pieces of the shadow, and position/size them as much
+ // as possible (but a lot of the coordinates are set in sizeShadow
+ this.pieces={};
+ var x1 = -1 * this.shadowThickness;
+ var y0 = this.shadowOffset;
+ var y1 = this.shadowOffset + this.shadowThickness;
+ this._makePiece("tr", "top", y0, "left", 0);
+ this._makePiece("r", "top", y1, "left", 0, "scale");
+ this._makePiece("b", "top", 0, "left", -x1, "crop");
+ this._makePiece("br", "top", 0, "left", 0);
+}
+
+
+dojo.html.shadow.prototype.size = function(width, height){
+ var sideHeight = height - (this.shadowOffset+this.shadowThickness+1);
+ with(this.pieces){
+ r.style.height = sideHeight+"px";
+ b.style.width = (width-1-this.shadowThickness)+"px";
+ b.style.top = (height-1)+"px";
+ br.style.top = (height-1)+"px";
+ tr.style.left = (width-1)+"px";
+ r.style.left = (width-1)+"px";
+ br.style.left = (width-1)+"px";
+ }
+}
Propchange: incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/xap/trunk/src/xap/taghandling/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/plugin.xml?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original)
+++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Fri Oct 13 15:23:29 2006
@@ -81,6 +81,8 @@
<mapping class="xap.bridges.dojo.MenuBridge" name="menu"/>
<mapping class="xap.bridges.dojo.HorizontalSeparatorBridge" name="horizontalSeparator"/>
+ <mapping class="xap.bridges.dojo.WindowBridge" name="window"/>
+
Modified: incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js?view=diff&rev=463854&r1=463853&r2=463854
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/BorderPanel.js Fri Oct 13 15:23:29 2006
@@ -19,7 +19,7 @@
dojo.inherits(xap.widgets.dojo.BorderPanel,dojo.widget.HtmlWidget);
dojo.lang.extend(xap.widgets.dojo.BorderPanel, {
- templateString: '<table><tr align="center" valign="center">'+
+ templateString: '<table style="overflow:hidden"><tr align="center" valign="center">'+
'<td colspan="3" dojoAttachPoint="north" style="height:1px"></td></tr>' +
'<tr align="center" valign="center"">'+
'<td dojoAttachPoint="west" style="width:1px"></td><td dojoAttachPoint="center" style="height:99%;width:99%"></td><td style="width:1px" dojoAttachPoint="east"></td></tr>' +