Revision: 4421 http://vexi.svn.sourceforge.net/vexi/?rev=4421&view=rev Author: clrg Date: 2012-07-17 00:09:40 +0000 (Tue, 17 Jul 2012) Log Message: ----------- Column resizing fixes (needs improving still)
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t 2012-07-17 00:09:08 UTC (rev 4420) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t 2012-07-17 00:09:40 UTC (rev 4421) @@ -17,8 +17,8 @@ thisbox.hshrink ++= static.hshrinkWrite; thisbox.size ++= static.sizeWrite; thisbox.value ++= static.valueRead; - thisbox.leftResize ++= static.leftResizeWrite; - thisbox.rightResize ++= static.rightResizeWrite; + thisbox.resizeLeft ++= static.resizeLeftWrite; + thisbox.resizeRight ++= static.resizeRightWrite; </ui:box> @@ -37,13 +37,13 @@ } /** initiate resize to the left */ - static.leftResizeWrite = function(v) { + static.resizeLeftWrite = function(v) { cascade = v; setTraps(trapee, trapee.th_resizeLeft, v); } /** initiate resize to the right */ - static.rightResizeWrite = function(v) { + static.resizeRightWrite = function(v) { cascade = v; setTraps(trapee, trapee.th_resizeRight, v); } Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t 2012-07-17 00:09:08 UTC (rev 4420) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t 2012-07-17 00:09:40 UTC (rev 4421) @@ -29,14 +29,19 @@ var m = c.mouse; if (c.th_resizeLeft.mouse.inside) { colL = thisbox[i-1]; + colR = c; } if (c.th_resizeRight.mouse.inside) { colL = c; + colR = thisbox[i+1]; } colL.width = colL.width; + colR.width = colR.width; widthL = colL.width; + widthR = colR.width; c.dragUpdate ++= function(d) { - colL.maxwidth = vexi.math.max(colL.contentwidth, widthL + d.x); + colL.width = vexi.math.min(widthL+widthR-8, vexi.math.max(8, widthL + d.x)); + colR.width = widthL+widthR-colL.width; } } } @@ -44,6 +49,30 @@ syncResizeTabs(); } + thisbox.width ++= function(v) { + cascade = v; + var colwidth = 0; + var expcount = 0; + var maxcount = 0; + for (var i,col in thisbox) { + colwidth += col.width; + if (col.hshrink) continue; + if (col.minwidth == col.maxwidth) { + maxcount ++; + continue; + } + expcount ++; + } + if (expcount > 0) return; + for (var i,col in thisbox) { + if (col.hshrink) continue; + var slack = (width - colwidth) / maxcount; + col.width += slack; + maxcount --; + colwidth += slack; + } + } + </ui:box> </vexi> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn