[seam-commits] Seam SVN: r11453 - in sandbox/trunk/modules/xwidgets: src/main/javascript and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Aug 31 02:51:18 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-08-31 02:51:17 -0400 (Mon, 31 Aug 2009)
New Revision: 11453

Modified:
   sandbox/trunk/modules/xwidgets/examples/panels/index.html
   sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
   sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js
   sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js
Log:
fix nested panels


Modified: sandbox/trunk/modules/xwidgets/examples/panels/index.html
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/index.html	2009-08-31 05:44:52 UTC (rev 11452)
+++ sandbox/trunk/modules/xwidgets/examples/panels/index.html	2009-08-31 06:51:17 UTC (rev 11453)
@@ -2,7 +2,13 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <head>
   <style>
-    html, body { height: 100% !important;}
+
+    html {
+      height: 99%;
+    }
+    body { 
+
+    }
   </style>
 </head>
 

Modified: sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	2009-08-31 05:44:52 UTC (rev 11452)
+++ sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	2009-08-31 06:51:17 UTC (rev 11453)
@@ -22,7 +22,16 @@
     </panel>
     
     <panel align="client">
-      <label value="client:client"/>
+      <!--label value="client:client"/-->
+      
+      <panel align="top" height="60">
+       <label value="top"/>
+      </panel>
+      
+      <panel align="client">
+        <label value="client"/>
+      </panel>
+      
     </panel>
   </panel>
 </view>

Modified: sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js
===================================================================
--- sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js	2009-08-31 05:44:52 UTC (rev 11452)
+++ sandbox/trunk/modules/xwidgets/src/main/javascript/xw.Panel.js	2009-08-31 06:51:17 UTC (rev 11453)
@@ -35,7 +35,13 @@
   {
     this.height = height;
   }
-  
+  
+  /*
+   * Paint the control
+   *
+   * layout - an overriding layout to use
+   *
+   */ 
   xw.controls.Panel.prototype.paint = function(layout)
   {
     if (this.control == null)
@@ -78,7 +84,7 @@
       this.inner.style.border = "0px";    
       this.control.appendChild(this.inner);      
     }
-          
+     
     // Create the appropriate layout manager and layout the child controls
     if (this.layoutManager == null && this.layout != null) 
     {
@@ -86,10 +92,10 @@
     }
     else
     {
-      this.layoutManager = new xw.DefaultLayout(this);
+      this.layoutManager = new xw.BorderLayout(this);
     }
-    
-    this.layoutManager.layout(this);           
+      
+    this.layoutManager.layout(this);           
   }  
   
   xw.controls.Panel.prototype.appendChild = function(child)
@@ -97,6 +103,7 @@
     this.inner.appendChild(child);
   }
   
+  // TODO this has *got* to be renamed
   xw.controls.Panel.prototype.getContainingControl = function()
   {
     return this.inner;

Modified: sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js
===================================================================
--- sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js	2009-08-31 05:44:52 UTC (rev 11452)
+++ sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js	2009-08-31 06:51:17 UTC (rev 11453)
@@ -730,8 +730,8 @@
   this.container = null;  
   this.children = new Array();
   
-  this.layout = "border"; // The default layout
-  this.layoutManager = null;
+  this.layout = null;
+  this.layoutManager = null;
     
   /**
    * Callback for window resize events
@@ -743,15 +743,12 @@
   
   xw.View.prototype.setLayout = function(layout)
   {
-    this.layout = layout;
+    if ("string" == (typeof layout))
+      this.layoutManager = new xw.layoutManagers[layout](this);
+    else
+      this.layoutManager = layout;
   }
   
-  xw.View.prototype.setLayoutManager = function(layoutManager)
-  {
-    this.layout = null;
-    this.layoutManager = layoutManager;
-  }
-  
   xw.View.prototype.paint = function()
   {       
     // Determine the container control
@@ -766,7 +763,7 @@
     xw.Sys.chainEvent(window, "resize", callback);    
     
     // Create the appropriate layout manager and layout the child controls
-    if (this.layout != null) this.layoutManager = new xw.layoutManagers[this.layout](this);  
+    if (this.layout == null) this.layoutManager = new xw.BorderLayout(this);
     this.layoutManager.layout();            
   }  
   



More information about the seam-commits mailing list