Revision: 4797 http://sourceforge.net/p/vexi/code/4797 Author: clrg Date: 2015-05-23 12:33:23 +0000 (Sat, 23 May 2015) Log Message: ----------- Port slider, separator
Added Paths: ----------- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Slider.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Slider.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Slider.t Removed Paths: ------------- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/slider.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/slider.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/separator.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/slider.t branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_poke/poke/widgets/slider.t Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Separator.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/separator.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Separator.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,9 @@ +<!-- Copyright 2009 - see COPYING for details [LGPL] --> + +<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.widget"> + <meta:doc> + <author>Charles Goodwin</author> + </meta:doc> + + <ui:Box v_separator="true" /> +</vexi> Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Slider.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/slider.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Slider.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/gui/Slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,108 @@ +<!-- Copyright 2015 - see COPYING for details [LGPL] --> + +<vexi xmlns:meta="vexi://meta" + xmlns="org.vexi.lib.role"> + + <meta:doc> + <author>Charles Goodwin</author> + </meta:doc> + + <Draggable /> + <Focusable /> + <Polarized /> + <TooltipAgent> + + // public variables + thisbox.interval = 1; // user defined interval between steps + thisbox.minvalue = 0; // the lower limit of the value range + thisbox.maxvalue = 10; // the upper limit of the value range + thisbox.step = 0; // the current step (integer) + thisbox.value = 0; // the current value + + // theme box traps + thisbox.th_handle = null; // the slider handle + thisbox.th_track = null; // the track in which the slider runs + + // private variables + thisbox.numsteps = 10; // the number of steps + thisbox.traplock = false; // lock for firing traps + + var surfaceToTrack; + var syncStep = function() { + if (surfaceToTrack==null) surfaceToTrack = surface.frame.distanceto(th_track); + step = vexi.math.round(numsteps * + (surface.frame.mouse[pos] - + vexi.math.abs(surfaceToTrack[pos]) - + th_handle[dim]/2) / (th_track[dim] - th_handle[dim])); + } + + /** used to sync the handle position */ + thisbox.syncHandle = function(v) { cascade = v; step = step; } + + // draggable integration + thisbox.moveEvent = function(v) { cascade = v; syncStep(); } + thisbox.Press1 ++= thisbox.moveEvent; + + // assign static trap functions + KeyPressed ++= static.keypressEvent; + interval ++= static.syncLimits; + minvalue ++= static.syncLimits; + maxvalue ++= static.syncLimits; + step ++= static.stepWrite; + value ++= static.valueRead; + value ++= static.valueWrite; + th_track ++= static.trackWrite; + + </TooltipAgent> + + /** adjust step on keypress */ + static.keypressEvent = function(v) { + if (v == "left" or v == "down") trapee.step -= 1; + else if (v == "right" or v == "up") trapee.step += 1; + cascade = v; + } + + /** move handle based on new step value */ + static.stepWrite = function(v) { + // make sure step has a valid value + cascade = (0 > v) ? 0 : (v > trapee.numsteps) ? trapee.numsteps : v; + // adjust the handle position according to the step + trapee.th_handle[trapee.pos] = trapee.step * (trapee.th_track[trapee.dim] - trapee.th_handle[trapee.dim]) / trapee.numsteps; + // fire value traps + trapee.traplock = true; + trapee.value = trapee.value; + trapee.traplock = false; + cascade = v; + } + + /** recalculate numsteps based on interval/min/max */ + static.syncLimits = function(v) { + cascade = v; + // we need all of the following to be set + if (trapee.interval == null || trapee.minvalue == null || trapee.maxvalue == null) return; + // interval should be a factor of (max - min) + //if ((trapee.max - trapee.min) % trapee.interval) + // vexi.log.warn("min/max range is not divisible by interval"); + // work out the number of steps + trapee.numsteps = (trapee.maxvalue - trapee.minvalue) / trapee.interval; + } + + /** mak sure the handle is kept at the write track position */ + static.trackWrite = function(v) { + cascade = v; + trapee.th_track.width ++= trapee.syncHandle; + } + + /** return value based on step */ + static.valueRead = function() { + return vexi.math.min(trapee.minvalue + trapee.step * trapee.interval, trapee.maxvalue); + } + + /** set step based on value */ + static.valueWrite = function(v) { + if (!trapee.traplock) + trapee.step = vexi.math.round((v - trapee.minvalue) / trapee.interval); + return; + } + +</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/separator.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/separator.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,9 +0,0 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> - -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.widget"> - <meta:doc> - <author>Charles Goodwin</author> - </meta:doc> - - <ui:box v_separator="true" /> -</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/slider.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/slider.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,107 +0,0 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> - -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.role"> - <meta:doc> - <author>Charles Goodwin</author> - </meta:doc> - - <draggable /> - <focusable /> - <polarizable /> - <tooltipable /> - <ui:box> - - // public variables - thisbox.interval = 1; // user defined interval between steps - thisbox.minvalue = 0; // the lower limit of the value range - thisbox.maxvalue = 10; // the upper limit of the value range - thisbox.step = 0; // the current step (integer) - thisbox.value = 0; // the current value - - // theme box traps - thisbox.th_handle = null; // the slider handle - thisbox.th_track = null; // the track in which the slider runs - - // private variables - thisbox.numsteps = 10; // the number of steps - thisbox.traplock = false; // lock for firing traps - - var surfaceToTrack; - var syncStep = function() { - if (surfaceToTrack==null) surfaceToTrack = surface.frame.distanceto(th_track); - step = vexi.math.round(numsteps * - (surface.frame.mouse[pos] - - vexi.math.abs(surfaceToTrack[pos]) - - th_handle[dim]/2) / (th_track[dim] - th_handle[dim])); - } - - /** used to sync the handle position */ - thisbox.syncHandle = function(v) { cascade = v; step = step; } - - // draggable integration - thisbox.moveEvent = function(v) { cascade = v; syncStep(); } - thisbox.Press1 ++= thisbox.moveEvent; - - // assign static trap functions - KeyPressed ++= static.keypressEvent; - interval ++= static.syncLimits; - minvalue ++= static.syncLimits; - maxvalue ++= static.syncLimits; - step ++= static.stepWrite; - value ++= static.valueRead; - value ++= static.valueWrite; - th_track ++= static.trackWrite; - - </ui:box> - - /** adjust step on keypress */ - static.keypressEvent = function(v) { - if (v == "left" or v == "down") trapee.step -= 1; - else if (v == "right" or v == "up") trapee.step += 1; - cascade = v; - } - - /** move handle based on new step value */ - static.stepWrite = function(v) { - // make sure step has a valid value - cascade = (0 > v) ? 0 : (v > trapee.numsteps) ? trapee.numsteps : v; - // adjust the handle position according to the step - trapee.th_handle[trapee.pos] = trapee.step * (trapee.th_track[trapee.dim] - trapee.th_handle[trapee.dim]) / trapee.numsteps; - // fire value traps - trapee.traplock = true; - trapee.value = trapee.value; - trapee.traplock = false; - cascade = v; - } - - /** recalculate numsteps based on interval/min/max */ - static.syncLimits = function(v) { - cascade = v; - // we need all of the following to be set - if (trapee.interval == null || trapee.minvalue == null || trapee.maxvalue == null) return; - // interval should be a factor of (max - min) - //if ((trapee.max - trapee.min) % trapee.interval) - // vexi.log.warn("min/max range is not divisible by interval"); - // work out the number of steps - trapee.numsteps = (trapee.maxvalue - trapee.minvalue) / trapee.interval; - } - - /** mak sure the handle is kept at the write track position */ - static.trackWrite = function(v) { - cascade = v; - trapee.th_track.width ++= trapee.syncHandle; - } - - /** return value based on step */ - static.valueRead = function() { - return vexi.math.min(trapee.minvalue + trapee.step * trapee.interval, trapee.maxvalue); - } - - /** set step based on value */ - static.valueWrite = function(v) { - if (!trapee.traplock) - trapee.step = vexi.math.round((v - trapee.minvalue) / trapee.interval); - return; - } - -</vexi> Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Separator.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/separator.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Separator.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,27 @@ +<!-- Copyright 2015 - see COPYING for details [LGPL] --> + +<vexi xmlns:ui="vexi://ui" + xmlns="org.vexi.lib.gui"> + + <Separator redirect="null" margin="3"> + <ui:box orient="vertical" hshrink="true" minwidth="1"> + <ui:box fill="#69000000" vshrink="true" minheight="1" /> + <ui:box fill="#69000000" /> + <ui:box fill="#3fffffff" vshrink="true" minheight="1" /> + </ui:box> + + // central column + <ui:box orient="vertical"> + <ui:box fill="#69000000" vshrink="true" minheight="1" /> + <ui:box /> + <ui:box fill="#ffffff" vshrink="true" minheight="1" /> + </ui:box> + + // right column + <ui:box orient="vertical" hshrink="true" minwidth="1"> + <ui:box fill="#3fffffff" vshrink="true" minheight="1" /> + <ui:box fill="#ffffff" /> + <ui:box fill="#ffffff" vshrink="true" minheight="1" /> + </ui:box> + </Separator> +</vexi> Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Slider.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/slider.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Slider.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/Slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,37 @@ +<!-- Copyright 2015 - see COPYING for details [LGPL] --> + +<vexi xmlns:ui="vexi://ui" + xmlns:lib="org.vexi.lib.gui" + xmlns="vexi.theme"> + + <lib:Slider redirect=":$content" orient="horizontal" vshrink="true"> + <ui:Box id="track" layout="layer" minwidth="21" minheight="21"> + <lib.FocusBorder id="focus" cursor="hand"> + <ui:Box width="3" hshrink="true" /> + <Separator id="slot" vshrink="true" /> + <ui:Box width="3" hshrink="true" /> + </lib.FocusBorder> + <ui:Box id="content" /> + <ui:Box align="topleft" layout="layer"> + <ui:Box id="handle" fill=":.image.slider_h" shrink="true" /> + </ui:Box> + </ui:Box> + + thisbox.th_focus = $focus; + thisbox.th_handle = $handle; + thisbox.th_track = $track; + + thisbox.focused ++= .lib.FocusBorder..focusWrite; + + thisbox.orient ++= function(v) { + if (orient == v) return; + cascade = v; + $focus.orient = v; + $slot[shr] = false; + $slot[flip(shr)] = true; + var o = ((orient == "horizontal") ? "h" : "v"); + $handle.fill = .image["slider_"+o]; + } + + </lib:Slider> +</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/separator.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/separator.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,29 +0,0 @@ -<!-- Copyright 2013 - see COPYING for details [LGPL] --> - -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.widget"> - <meta:doc> - <author>Charles Goodwin</author> - </meta:doc> - - <separator redirect="null" margin="3"> - <ui:box orient="vertical" hshrink="true" minwidth="1"> - <ui:box fill="#69000000" vshrink="true" minheight="1" /> - <ui:box fill="#69000000" /> - <ui:box fill="#3fffffff" vshrink="true" minheight="1" /> - </ui:box> - - // central column - <ui:box orient="vertical"> - <ui:box fill="#69000000" vshrink="true" minheight="1" /> - <ui:box /> - <ui:box fill="#ffffff" vshrink="true" minheight="1" /> - </ui:box> - - // right column - <ui:box orient="vertical" hshrink="true" minwidth="1"> - <ui:box fill="#3fffffff" vshrink="true" minheight="1" /> - <ui:box fill="#ffffff" /> - <ui:box fill="#ffffff" vshrink="true" minheight="1" /> - </ui:box> - </separator> -</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/slider.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/slider.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,38 +0,0 @@ -<!-- Copyright 2011 - 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> - </meta:doc> - - <lib:slider redirect=":$content" orient="horizontal" vshrink="true"> - <ui:box id="track" layout="layer" minwidth="21" minheight="21"> - <lib.focusborder id="focus" cursor="hand"> - <ui:box width="3" hshrink="true" /> - <separator id="slot" vshrink="true" /> - <ui:box width="3" hshrink="true" /> - </lib.focusborder> - <ui:box id="content" /> - <ui:box align="topleft" layout="layer"> - <ui:box id="handle" fill=":.image.slider_h" shrink="true" /> - </ui:box> - </ui:box> - - thisbox.th_focus = $focus; - thisbox.th_handle = $handle; - thisbox.th_track = $track; - - thisbox.focused ++= .lib.focusborder..focusWrite; - - thisbox.orient ++= function(v) { - if (orient == v) return; - cascade = v; - $focus.orient = v; - $slot[shr] = false; - $slot[flip(shr)] = true; - var o = ((orient == "horizontal") ? "h" : "v"); - $handle.fill = .image["slider_"+o]; - } - - </lib:slider> -</vexi> Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Separator.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/separator.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Separator.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,14 @@ +<!-- Copyright 2015 - see COPYING for details [LGPL] --> + +<vexi xmlns:meta="vexi://meta" + xmlns="vexi.theme"> + + <meta:doc> + <name>Separator</name> + <desc>Visually separates content</desc> + <usage> + </usage> + </meta:doc> + + <Separator /> +</vexi> Copied: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Slider.t (from rev 4785, branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/slider.t) =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Slider.t (rev 0) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/gui/Slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -0,0 +1,14 @@ +<!-- Copyright 2015 - see COPYING for details [LGPL] --> + +<vexi xmlns:meta="vexi://meta" + xmlns="vexi.theme"> + + <meta:doc> + <name>Slider Widget</name> + <desc>Creates a sliding value selector</desc> + <usage> + </usage> + </meta:doc> + + <Slider /> +</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/separator.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/separator.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/separator.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,14 +0,0 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> - -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns:theme="vexi.theme" - xmlns="org.vexi.lib.layout"> - <meta:doc> - <name>Separator</name> - <desc>Visually separates content</desc> - <usage> - </usage> - </meta:doc> - - <margin /> - <theme:separator /> -</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/slider.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/slider.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_main/vexi/widget/slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,16 +0,0 @@ -<!-- Copyright 2009 - see COPYING for details [LGPL] --> - -<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns:theme="vexi.theme" - xmlns="org.vexi.lib.layout"> - <meta:doc> - <name>Slider Widget</name> - <desc>Creates a sliding value selector</desc> - <usage> - </usage> - </meta:doc> - - <margin /> - <theme:slider /> - <pad /> - <container /> -</vexi> Deleted: branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_poke/poke/widgets/slider.t =================================================================== --- branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_poke/poke/widgets/slider.t 2015-05-23 11:30:20 UTC (rev 4796) +++ branches/vexi3_integrated_layout/org.vexi-vexi.widgets/src_poke/poke/widgets/slider.t 2015-05-23 12:33:23 UTC (rev 4797) @@ -1,21 +0,0 @@ -<!-- public domain --> - -<vexi xmlns:ui="vexi://ui" xmlns:w="vexi.widget"> - <w:surface /> - <ui:box orient="vertical"> - <ui:box> - <ui:box align="right" text="Slider value: " /> - <ui:box id="output" align="left" /> - </ui:box> - <ui:box> - <ui:box /> - <w:slider id="slider" minvalue="0" maxvalue="10" step="1" /> - <ui:box /> - </ui:box> - - $slider.value ++= function(v) { cascade = v; $output.text = v; } - - vexi.ui.frame = thisbox; - - </ui:box> -</vexi> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn