Revision: 4410 http://vexi.svn.sourceforge.net/vexi/?rev=4410&view=rev Author: clrg Date: 2012-07-11 06:05:13 +0000 (Wed, 11 Jul 2012) Log Message: ----------- Feature - resizeable table columns.
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/draggable.t 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 trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/draggable.t =================================================================== (Binary files differ) 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-06-27 07:33:34 UTC (rev 4409) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t 2012-07-11 06:05:13 UTC (rev 4410) @@ -1,4 +1,4 @@ -<!-- Copyright 2011 - see COPYING for details [LGPL] --> +<!-- Copyright 2012 - see COPYING for details [LGPL] --> <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.role"> <meta:doc> @@ -6,15 +6,28 @@ </meta:doc> <clickable /> + <draggable /> <tooltipable /> <ui:box> + thisbox.holdButton = 1; + thisbox.datatype ++= static.datatypeWrite; thisbox.size ++= static.sizeWrite; thisbox.value ++= static.valueRead; + thisbox.th_resizeLeft ++= static.initResize; + thisbox.th_resizeRight ++= static.initResize; </ui:box> + static.blockPress = function(v) { return; } + + static.initResize = function(v) { + cascade = v; + trapee.Press1 ++= static.blockPress; + trapee.Press1 ++= trapee.pressEvent; + } + static.datatypeWrite = function(v) { cascade = v; switch (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-06-27 07:33:34 UTC (rev 4409) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t 2012-07-11 06:05:13 UTC (rev 4410) @@ -1,4 +1,4 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> +<!-- Copyright 2012 - see COPYING for details [LGPL] --> <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.widget"> <meta:doc> @@ -8,21 +8,44 @@ <ui:box> thisbox.Children ++= function(c) { - if (c) c.Press1 ++= static.pressEvent; + if (c) { + c.dragStart ++= function(v) { + var colL, colR; + var widthL, widthR; + var i = indexof(c); + var m = c.mouse; + if (3 > m.x) { + if (i == 0) return; + colL = thisbox[i-1]; + if (i != numchildren-1) + colR = c; + } + if (m.x > c.width-3) { + if (i == numchildren-1) return; + colL = c; + if (i != numchildren-2) + colR = thisbox[i+1]; + } + if (colL == null) return; + colL.width = colL.width; + widthL = colL.width; + if (colR) { + colR.width = colR.width; + widthR = colR.width; + } + c.dragUpdate ++= function(d) { + colL.width = widthL + d.x; + if (colR) { + colR.width = widthR - d.x; + } + } + } + } if (c == null) { - var _c = thisbox[trapname]; - if (_c) _c.Press1 --= static.pressEvent; } cascade = c; } </ui:box> - static.pressEvent = function(v) { - var t = trapee; - var m = t.mouse; - if (3 > m.x or m.x > t.width-3) return; - cascade = v; - } - </vexi> Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t 2012-06-27 07:33:34 UTC (rev 4409) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t 2012-07-11 06:05:13 UTC (rev 4410) @@ -1,27 +1,31 @@ -<!-- Copyright 2011 - see COPYING for details [LGPL] --> +<!-- Copyright 2012 - see COPYING for details [LGPL] --> -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.theme" - xmlns:lib="org.vexi.lib.widget"> - <meta:doc> - <author>Charles Goodwin</author> - <author>Michael Goodwin</author> - <name>Table Cell</name> - <desc>A basic cell implementation</desc> - <usage>See vexi.widget.table.table</usage> - </meta:doc> +<vexi xmlns:ui="vexi://ui" + xmlns:lib="org.vexi.lib.widget" + xmlns="vexi.theme"> <lib:column /> - <bevel redirect=":$content" form="up" hshrink="false" margin="0" padding="2 1"> - <ui:box id="wrap" align="left" layout="place" minwidth="8"> + <ui:box redirect=":$content" hshrink="false" margin="0" padding="2 1"> + <ui:box align="left" layout="layer" minwidth="8"> + <bevel id="bevel" form="up"> + <ui:box id="wrap"> + <ui:box id="sp_left" align="right" minwidth="8" display="false"> + <ui:box id="sort" shrink="true" /> + </ui:box> + <ui:box id="content" /> + <ui:box id="sp_right" minwidth="8" display="false" /> + </ui:box> + </bevel> <ui:box> - <ui:box id="sp_left" align="right" minwidth="8" display="false"> - <ui:box id="sort" shrink="true" /> - </ui:box> - <ui:box id="content" /> - <ui:box id="sp_right" minwidth="8" display="false" /> + <ui:box id="resizeleft" width="4" cursor="east" /> + <ui:box /> + <ui:box id="resizeRight" width="4" cursor="east" /> </ui:box> </ui:box> + thisbox.th_resizeLeft = $resizeLeft; + thisbox.th_resizeRight = $resizeRight; + thisbox.th_bevel = $bevel; thisbox.v_init = static.init; thisbox.active ++= static.activeWrite; @@ -95,11 +99,18 @@ thisbox.tooltip ++= checkTooltip; } - </bevel> + </ui:box> static.init = { fill : .settings..widgetfill }; - static.activeWrite = function(v) { cascade = v; trapee.form = "down"; } - static.normalWrite = function(v) { cascade = v; trapee.form = trapee.enabled ? (trapee.selected ? "down" : "up") : "thinup"; } + static.activeWrite = function(v) { + cascade = v; + trapee.th_bevel.form = "down"; + } + static.normalWrite = function(v) { + cascade = v; + trapee.th_bevel.form = trapee.enabled ? (trapee.selected ? "down" : "up") : "thinup"; + } + </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