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 mt...@apache.org on 2006/11/09 05:33:55 UTC

svn commit: r472779 - in /incubator/xap/trunk: WebContent/examples/widgets/window.html WebContent/examples/widgets/window.xal src/xap/widgets/dojo/Window.js

Author: mturyn
Date: Wed Nov  8 21:33:54 2006
New Revision: 472779

URL: http://svn.apache.org/viewvc?view=rev&rev=472779
Log:
Minimisation and maximisation seem to be in decent shape now.

Modified:
    incubator/xap/trunk/WebContent/examples/widgets/window.html
    incubator/xap/trunk/WebContent/examples/widgets/window.xal
    incubator/xap/trunk/src/xap/widgets/dojo/Window.js

Modified: incubator/xap/trunk/WebContent/examples/widgets/window.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/window.html?view=diff&rev=472779&r1=472778&r2=472779
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/window.html (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/window.html Wed Nov  8 21:33:54 2006
@@ -3,7 +3,7 @@
 <html>
 	<head>
 	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-	    <title>Simple XAP Widget Example</title>
+	    <title>Simple XAP Window Example</title>
 	
 		<style type="text/css">
 	      <!--
@@ -16,10 +16,27 @@
 			djConfig = {
 				parseWidgets: false
 			};
+			// Debug these classes:
+			debug_config = {
+							_debugList:[
+									"xap.bridges.dojo.WindowBridge",
+									"xap.widgets.dojo.Window",					
+									"xap.bridges.dojo.DojoWidgetBridge"	
+										],
+										_debugAll:true		
+			
+			 } ;
+					 			
 		</script>    
 		
 		<script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
 	    <script language="JavaScript" type="text/javascript" src="AttributeTester.js"></script>    
+
+	    <script language="JavaScript">  
+		<!-- must do this before we load the actual application: -->    
+	    	xap.util.Debug.loadDebuggables();
+	    </script>	    
+	    
 	</head>
 	  
 	<body onload="Xap.createEmbeddedApplications();">

Modified: incubator/xap/trunk/WebContent/examples/widgets/window.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/widgets/window.xal?view=diff&rev=472779&r1=472778&r2=472779
==============================================================================
--- incubator/xap/trunk/WebContent/examples/widgets/window.xal (original)
+++ incubator/xap/trunk/WebContent/examples/widgets/window.xal Wed Nov  8 21:33:54 2006
@@ -13,9 +13,9 @@
 	<xm:append select="/xal">
 	
 
-		<xal:window title="No min,max,close or resize" x="200px" resizable="false" minimizable="false" maximizable="false" closable="false" 		onClose="mco:attributeSetter.reportEvent(event)"
+		<xal:window title="No min,max,close or resize" x="200px" resizable="false" minimizable="false" maximizable="false" closable="false" onClose="mco:attributeSetter.reportEvent(event)"
 			onActiveGained="mco:attributeSetter.reportEvent(event)" onActiveLost="mco:attributeSetter.reportEvent(event)" onBeforeActiveLost="mco:attributeSetter.reportEvent(event)" onContextMenu="mco:attributeSetter.reportEvent(event)" onDoubleClick="mco:attributeSetter.reportEvent(event)" onKeyChar="mco:attributeSetter.reportEvent(event)" onKeyDown="mco:attributeSetter.reportEvent(event)" onKeyUp="mco:attributeSetter.reportEvent(event)" onMouseDown="mco:attributeSetter.reportEvent(event)" onMouseDrag="mco:attributeSetter.reportEvent(event)" onMouseMove="mco:attributeSetter.reportEvent(event)" onMouseOut="mco:attributeSetter.reportEvent(event)" onMouseOver="mco:attributeSetter.reportEvent(event)"/>
-	<xal:window title="A window" id="testComponent"
+	<xal:window title="A window" id="testComponent" minimized="true"
 		onClose="mco:attributeSetter.reportEvent(event)"
 		onMinimize="mco:attributeSetter.reportEvent(event)"
 		onMaximize="mco:attributeSetter.reportEvent(event)"

Modified: incubator/xap/trunk/src/xap/widgets/dojo/Window.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/Window.js?view=diff&rev=472779&r1=472778&r2=472779
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/Window.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/Window.js Wed Nov  8 21:33:54 2006
@@ -49,17 +49,12 @@
 			return;
 		}
 		
-		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.setPrevious() ;
 		
+		this.resizeBar.style.visibility="hidden" ;
+		// Show just the top bar:
 		this.resizeTo(this.previous.width, 
-			dojo.style.getOuterHeight(this.titleBar) + dojo.style.getOuterHeight(this.resizeBar));
+			dojo.style.getOuterHeight(this.titleBar) /*+ dojo.style.getOuterHeight(this.resizeBar)*/);
 		this.minimizeAction.style.display="none";
 		
 		var restoreParent = this.restoreAction.parentNode;
@@ -75,6 +70,9 @@
 		if (xap.util.Event.getPreventDefault(evt)){
 			return;
 		}
+
+		this.resizeBar.style.visibility="visible" ;
+		
 		xap.widgets.dojo.Window.superclass.restoreWindow.call(this,evt);
 		this.minimizeAction.style.display=this.displayMinimizeAction ? "" : "none";
 	},
@@ -84,6 +82,8 @@
 			return;
 		}
 		
+		this.resizeBar.style.visibility="visible" ;		
+		
 		var restoreParent = this.restoreAction.parentNode;
 		restoreParent.removeChild(this.restoreAction);
 		restoreParent.insertBefore(this.restoreAction,this.minimizeAction);
@@ -108,6 +108,17 @@
 				  {domNode: this.resizeBar, layoutAlign: "bottom"},
 				  {domNode: this.containerNode, layoutAlign: "client"}
 				] );
+	},
+	
+	setPrevious: function(){
+		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
+		};	
 	}
 });