Revision: 3814 http://vexi.svn.sourceforge.net/vexi/?rev=3814&view=rev Author: clrg Date: 2010-03-05 02:18:56 +0000 (Fri, 05 Mar 2010)
Log Message: ----------- Only create datepicker when it's used Modified Paths: -------------- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/datefield.t Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/datefield.t =================================================================== --- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/datefield.t 2010-03-04 18:31:41 UTC (rev 3813) +++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/classic/datefield.t 2010-03-05 02:18:56 UTC (rev 3814) @@ -40,7 +40,8 @@ </classic:button> </ui:box> <lay:border id="popbox" orient="vertical" border="black" depth="1" fill="white"> - <datepicker id="datepicker" minwidth="200" minheight="160" shrink="true" /> + <!--datepicker id="datepicker" minwidth="200" minheight="160" shrink="true" /--> + <ui:box id="datepicker" /> </lay:border> thisbox.datepick = $datepicker; @@ -127,23 +128,18 @@ $popbox.surface_x ++= function() { return min(surface.frame.distanceto(thisbox).x, surface.frame.width - $popbox.width); } $popbox.surface_y ++= function() { return min(surface.frame.distanceto(thisbox).y, surface.frame.height - $popbox.height); } - /** popdown when monthview wants to popdown */ - $datepicker.action ++= function(v) { - day = $datepicker.day; - month = $datepicker.month; - year = $datepicker.year; + thisbox.popup ++= function(v) { + static.initDatePicker(thisbox, $datepicker); + thisbox.popup --= callee; cascade = v; } - /** popdown when datepicker requests it */ - $datepicker.popdown ++= function(v) { popdown = true; return; } - /** assign date and popup */ $select.action ++= function(v) { + popup = true; $datepicker.day = day; $datepicker.month = month; $datepicker.year = year; - popup = true; return; } @@ -260,6 +256,25 @@ </bevel> + static.initDatePicker = function(datefield, datepicker_box) { + // apply datepicker to box + .datepicker(datepicker_box); + datepicker_box.minwidth = 200; + datepicker_box.minheight = 160; + datepicker_box.shrink = true; + + /** popdown when monthview wants to popdown */ + datepicker_box.action ++= function(v) { + datefield.day = datepicker_box.day; + datefield.month = datepicker_box.month; + datefield.year = datepicker_box.year; + cascade = v; + } + + /** popdown when datepicker requests it */ + datepicker_box.popdown ++= function(v) { datefield.popdown = true; return; } + } + /** write trap to apply to monthview day/month/year */ static.basicWrite = function(v) { cascade = v; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn