Revision: 1953
          http://svn.sourceforge.net/vexi/?rev=1953&view=rev
Author:   clrg
Date:     2007-07-08 14:05:29 -0700 (Sun, 08 Jul 2007)

Log Message:
-----------
Sync date.monthview with layout.grid changes plus some refactoring

Modified Paths:
--------------
    widgets/trunk/org.vexi.widgets/src/vexi/util/date/monthview.t

Modified: widgets/trunk/org.vexi.widgets/src/vexi/util/date/monthview.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/vexi/util/date/monthview.t       
2007-07-08 21:05:04 UTC (rev 1952)
+++ widgets/trunk/org.vexi.widgets/src/vexi/util/date/monthview.t       
2007-07-08 21:05:29 UTC (rev 1953)
@@ -22,10 +22,7 @@
             </button>
         </ui:box>
         <ui:box fill="black" height="1" vshrink="true" />
-        <layout:pad paddingleft="10">
-            <layout:grid id="dategrid" cols="7" />
-        </layout:pad>
-        <ui:box id="holder" display="false">
+        <layout:pad padding="5 0 5 10" vshrink="true">
             <ui:box text="S" />
             <ui:box text="M" />
             <ui:box text="T" />
@@ -33,14 +30,11 @@
             <ui:box text="T" />
             <ui:box text="F" />
             <ui:box text="S" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-            <ui:box fill="black" height="1" vshrink="true" />
-        </ui:box>
+        </layout:pad>
+        <ui:box fill="black" height="1" vshrink="true" />
+        <layout:pad padding="5 0 5 10">
+            <layout:grid id="dategrid" cols="7" />
+        </layout:pad>
         
         $year.width = vexi.ui.font.width(font, fontsize, "000000");
         $month.width = vexi.ui.font.width(font, fontsize, "0000000000");
@@ -102,11 +96,11 @@
             var i=0;
             var j=0;
             // reset leading days
-            while (weekday>i) { $dategrid.getChild(14+i).text = ""; i++; }
+            while (weekday>i) { $dategrid[i].text = ""; i++; }
             // set active day dates
-            while (numdays+weekday>i) { $dategrid.getChild(14+i).text = 
i+1-weekday; i++; }
+            while (numdays+weekday>i) { $dategrid[i].text = i+1-weekday; i++; }
             // reset trailing days
-            while (42>i) { $dategrid.getChild(14+i).text = ""; i++; }
+            while (42>i) { $dategrid[i].text = ""; i++; }
 
             $month.text = toName(month);
             $year.text = year;
@@ -117,7 +111,7 @@
                 olddate.textcolor = "black";
             }
             
-            olddate = $dategrid.getChild(14+weekday+day-1);
+            olddate = $dategrid[weekday+day-1];
             if (olddate and isCurrent(day))
             {
                 olddate.fill = "darkblue";
@@ -164,12 +158,6 @@
             return true;
         }
         
-        while ($holder.numchildren)
-        {
-            $holder[0].align = "left";
-            $dategrid[$dategrid.numchildren] = $holder[0];
-        }
-        
         // create boxes to contain the dates
         for (var i=0; 42>i; i++)
         {
@@ -211,7 +199,7 @@
                 olddate.textcolor = "black";
             }
 
-            olddate = $dategrid.getChild(14+weekday+day-1);
+            olddate = $dategrid[weekday+day-1];
             if (olddate and isCurrent(day)) {
                 olddate.fill = "darkblue";
                 olddate.textcolor = "white";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to