Revision: 4708 http://sourceforge.net/p/vexi/code/4708 Author: clrg Date: 2014-07-30 14:24:05 +0000 (Wed, 30 Jul 2014) Log Message: ----------- Circle today's date + fix padding on pop up
Modified Paths: -------------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/popupmanager.t branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datepicker.t Added Paths: ----------- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/popupmanager.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/popupmanager.t 2014-07-30 14:05:13 UTC (rev 4707) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/popupmanager.t 2014-07-30 14:24:05 UTC (rev 4708) @@ -230,8 +230,8 @@ model.addPopBox = function(v) { var p = v.v_popbox; - // silence popbox - p.display = false; + // detach popbox + p.thisbox = null; // use default group if none is specified var g = p.popgroup ? p.popgroup : "default"; Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datepicker.t =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datepicker.t 2014-07-30 14:05:13 UTC (rev 4707) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datepicker.t 2014-07-30 14:24:05 UTC (rev 4708) @@ -12,18 +12,18 @@ <ui:box orient="vertical"> <ui:box fill="white" vshrink="true"> <button id="decmonth" focusable="false" hshrink="true"> - <lay:pad padding="4 2"><ui:box fill=":image.arrowleft" /></lay:pad> + <lay:pad padding="4 3"><ui:box fill=":image.arrowleft" /></lay:pad> </button> <ui:box id="month" /> <button id="incmonth" focusable="false" hshrink="true"> - <lay:pad padding="4 2"><ui:box fill=":image.arrowright" /></lay:pad> + <lay:pad padding="4 3"><ui:box fill=":image.arrowright" /></lay:pad> </button> <button id="decyear" focusable="false" hshrink="true"> - <lay:pad padding="4 2"><ui:box fill=":image.arrowleft" /></lay:pad> + <lay:pad padding="4 3"><ui:box fill=":image.arrowleft" /></lay:pad> </button> <ui:box id="year" /> <button id="incyear" focusable="false" hshrink="true"> - <lay:pad padding="4 2"><ui:box fill=":image.arrowright" /></lay:pad> + <lay:pad padding="4 3"><ui:box fill=":image.arrowright" /></lay:pad> </button> <button id="close" focusable="false" hshrink="true"> <lay:pad padding="4 2"><ui:box fill=":image.close" /></lay:pad> @@ -40,9 +40,12 @@ <ui:box text="S" textcolor="#888888" /> </lay:pad> <ui:box fill="black" height="1" vshrink="true" /> - <lay:pad padding="5 0"> - <lay:grid id="dategrid" cols="7" /> - </lay:pad> + <ui:Box id="base" align="topleft" layout="layer"> + <lay:pad padding="5 0"> + <lay:grid id="dategrid" cols="7" /> + </lay:pad> + <ui:Box id="circle" display="false" fill=":image.datecircle" shrink="true" /> + </ui:Box> /** * required because mouse press on the popbox would @@ -68,6 +71,15 @@ return day!=null and year==showyear and month==showmonth and day==v; } + var today; // vexi.js.Date + var circleToday = function() { + var today_box = $dategrid[showweekday + today.day - 1]; + var d = $base.distanceto(today_box); + $circle.x = d.x - 2; + $circle.y = d.y - 8; + $circle.display = true; + } + /** set the dates shown according to the month/year properties */ var layoutDates = function() { // establish starting day @@ -90,6 +102,19 @@ $month.text = getMonthName(showmonth); $year.text = showyear; + // mark today + if (showyear == today.year and showmonth == today.month) { + if ($dategrid.width == 0) { + // not yet been displayed; use a thread as it + // will get called after layout is performed + vexi.thread = function() { + circleToday(); + } + } else circleToday(); + } else { + $circle.display = false; + } + if (olddate) { olddate.fill = "white"; olddate[0].textcolor = "black"; @@ -117,18 +142,6 @@ return; } - // create boxes to contain the dates - for (var i=0; 42>i; i++) { - var b = role.clickable(vexi.box); - b[0] = util.digit(vexi.box); - b.action ++= actionTrap; - b.active ++= static.activeTrap; - b.hover ++= static.hoverTrap; - b.normal ++= static.normalTrap; - b.isCurrent = isCurrent; - $dategrid[$dategrid.numchildren] = b; - } - /** close us */ $close.action ++= function(v) { popdown = true; cascade = v; } @@ -162,15 +175,33 @@ cascade = v; } + var initialize = function() { + // create boxes to contain the dates + for (var i=0; 42>i; i++) { + var b = new role.clickable(); + b[0] = new util.digit(); + b.action ++= actionTrap; + b.active ++= static.activeTrap; + b.hover ++= static.hoverTrap; + b.normal ++= static.normalTrap; + b.isCurrent = isCurrent; + $dategrid.add(b); + } + } + /** initialize the view */ thisbox.visible ++= function(v) { cascade = v; if (v) { + if (initialize) { + initialize(); + initialize = null; + } + today = vexi.js.Date.today; // initialize to current month/year if unset if (year == null) { - var d = vexi.date(); - showyear = d.getFullYear(); - showmonth = d.getMonth()+1; + showyear = today.year; + showmonth = today.month; } else { showyear = year; showmonth = month; Added: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png =================================================================== (Binary files differ) Index: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png =================================================================== --- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png 2014-07-30 14:05:13 UTC (rev 4707) +++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png 2014-07-30 14:24:05 UTC (rev 4708) Property changes on: branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/image/datecircle.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn