Revision: 3047
          http://vexi.svn.sourceforge.net/vexi/?rev=3047&view=rev
Author:   clrg
Date:     2008-08-09 14:50:56 +0000 (Sat, 09 Aug 2008)

Log Message:
-----------
Make polarizable integrate better with containers (fixes widget.scrollbar)

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/polarizable.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/polarizable.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/polarizable.t  
2008-08-08 17:29:47 UTC (rev 3046)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/polarizable.t  
2008-08-09 14:50:56 UTC (rev 3047)
@@ -5,24 +5,6 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    static.flip = function(f) {
-        if (f == "width") return "height";
-        else if (f == "height") return "width";
-        else if (f == "x") return "y";
-        else if (f == "y") return "x";
-        else if (f == "contentwidth") return "contentheight";
-        else if (f == "contentheight") return "contentwidth";
-        else if (f == "maxwidth") return "maxheight";
-        else if (f == "maxheight") return "maxwidth";
-        else if (f == "minwidth") return "minheight";
-        else if (f == "minheight") return "minwidth";
-        else if (f == "horizontal") return "vertical";
-        else if (f == "vertical") return "horizontal";
-        else if (f == "hshrink") return "vshrink";
-        else if (f == "vshrink") return "hshrink";
-        return null;
-    }
-    
     <ui:box>
         
         thisbox.contentdim = "contentwidth";
@@ -35,26 +17,57 @@
         thisbox.flip = static.flip;
         thisbox.horizontal = true;
         
-        thisbox.orient ++= function(v) {
+        thisbox.orient ++= static.orientWrite;
+        
+    </ui:box>
+    
+    static.flip = function(f) {
+        switch (f) {
+        case "width": return "height";
+        case "height": return "width";
+        case "x": return "y";
+        case "y": return "x";
+        case "contentwidth": return "contentheight";
+        case "contentheight": return "contentwidth";
+        case "maxwidth": return "maxheight";
+        case "maxheight": return "maxwidth";
+        case "minwidth": return "minheight";
+        case "minheight": return "minwidth";
+        case "horizontal": return "vertical";
+        case "vertical": return "horizontal";
+        case "hshrink": return "vshrink";
+        case "vshrink": return "hshrink";
+        default: return null;
+        }
+    }
+    
+    static.orientWrite = function(v) {
+        var t = trapee;
+        var c = trapee.v_container ? null : trapee.v_content;
+        if (c) {
+            if (v==c.orient) return;
+            c.orient = v;
+        } else {
+            if (v==trapee.orient) return;
             cascade = v;
-            if (v == "horizontal") {
-                contentdim = "contentwidth";
-                dim        = "width";
-                maxdim     = "maxwidth";
-                mindim     = "minwidth";
-                pos        = "x";
-                shr        = "hshrink";
-                horizontal = true;
-            } else {
-                contentdim = "contentheight";
-                dim        = "height";
-                maxdim     = "maxheight";
-                mindim     = "minheight";
-                pos        = "y";
-                shr        = "vshrink";
-                horizontal = false;
-            }
         }
-        
-    </ui:box>
+        if (v == "horizontal") {
+            t.contentdim = "contentwidth";
+            t.dim        = "width";
+            t.maxdim     = "maxwidth";
+            t.mindim     = "minwidth";
+            t.pos        = "x";
+            t.shr        = "hshrink";
+            t.horizontal = true;
+        } else {
+            t.contentdim = "contentheight";
+            t.dim        = "height";
+            t.maxdim     = "maxheight";
+            t.mindim     = "minheight";
+            t.pos        = "y";
+            t.shr        = "vshrink";
+            t.horizontal = false;
+        }
+    }
+    
 </vexi>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to