Revision: 1933
          http://svn.sourceforge.net/vexi/?rev=1933&view=rev
Author:   clrg
Date:     2007-07-06 06:04:35 -0700 (Fri, 06 Jul 2007)

Log Message:
-----------
Layout fixes
- start migrating pad/border to vexi.layout
- make monthview layout a bit nicer

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

Added Paths:
-----------
    widgets/trunk/org.vexi.widgets/src/vexi/layout/border.t
    widgets/trunk/org.vexi.widgets/src/vexi/layout/pad.t

Added: widgets/trunk/org.vexi.widgets/src/vexi/layout/border.t
===================================================================
(Binary files differ)


Property changes on: widgets/trunk/org.vexi.widgets/src/vexi/layout/border.t
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: widgets/trunk/org.vexi.widgets/src/vexi/layout/pad.t
===================================================================
(Binary files differ)


Property changes on: widgets/trunk/org.vexi.widgets/src/vexi/layout/pad.t
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: widgets/trunk/org.vexi.widgets/src/vexi/util/date/datechooser.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/vexi/util/date/datechooser.t     
2007-07-06 12:45:39 UTC (rev 1932)
+++ widgets/trunk/org.vexi.widgets/src/vexi/util/date/datechooser.t     
2007-07-06 13:04:35 UTC (rev 1933)
@@ -7,9 +7,9 @@
     
     <lib:popupable />
     <widg:bevel blockPress="true" fill="white" form="down" margin="3" 
shrink="true">
-        <widg:pad padding="3">
-            <ui:box id="date">
-                minwidth = 14*vexi.ui.font.width(font,fontsize,"0");
+        <widg:pad padding="3 0">
+            <ui:box id="date" align="center">
+                minwidth = 12*vexi.ui.font.width(font,fontsize,"0");
             </ui:box>
         </widg:pad>
         <widg:button id="button" fill="#d4d0c8" margin="0" padding="1 5" 
text="Choose" />
@@ -19,6 +19,7 @@
         thisbox.date      = null;
         thisbox.day       = null;
         thisbox.format    = "DDMMYYYY";
+        thisbox.separator = " / ";
         thisbox.month     = null;
         thisbox.shortdate = null;
         thisbox.year      = null;
@@ -139,30 +140,35 @@
         thisbox.year  ++= readFunc;
         thisbox.month ++= readFunc;
         
-        thisbox.datestring ++= function()
+        thisbox.getDateString = function(f, s)
         {
-            switch (format)
+            if (!f) f = format;
+            if (!s) f = separator;
+            switch (f)
             {
                 case "DDMMYYYY":
-                return day + "/" + month + "/" + year;
+                return (10>day?'0':'') + day + s + (10>month?'0':'') + month + 
s + year;
                 break;
                 
                 case "MMDDYYYY":
-                return month + "/" + day + "/" + year;
+                return (10>month?'0':'') + month + s + (10>day?'0':'') + day + 
s + year;
                 break;
                 
                 case "YYYYMMDD":
                 default:
-                return year + "-" + (10>month?'0':'')+month + "-" + 
(10>day?'0':'')+day;
+                return year + s + (10>month?'0':'') + month + s + 
(10>day?'0':'') + day;
             }
         }
         
-        thisbox.format ++= function(v)
+        var updateFunc = function(v)
         {
             cascade = v;
             displayDate();
         }
         
+        thisbox.format ++= updateFunc;
+        thisbox.separator ++= updateFunc;
+        
         /** write trap to apply to monthview day/month/year */
         var writeFunc = function(v)
         {

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-06 12:45:39 UTC (rev 1932)
+++ widgets/trunk/org.vexi.widgets/src/vexi/util/date/monthview.t       
2007-07-06 13:04:35 UTC (rev 1933)
@@ -1,19 +1,19 @@
 <!-- Copyright 2006 Charles Goodwin -->
 
 <vexi xmlns:ui="vexi://ui" xmlns:layout="vexi.layout" xmlns:meta="vexi://meta" 
xmlns:win2k="org.vexi.theme.win2k.image" xmlns="vexi.widget">
-    <pad orient="vertical" fill="black" padding="1">
+    <layout:border orient="vertical" border="black" depth="1" fill="white">
         <ui:box fill="white" vshrink="true">
             <button id="decmonth" fill="#d4d0c8" hshrink="true" margin="0" 
padding="4 2">
                 <ui:box win2k:fill=".arrowleft" />
             </button>
-            <ui:box id="month" />
+            <ui:box id="month" align="center" />
             <button id="incmonth" fill="#d4d0c8" hshrink="true" margin="0" 
padding="4 2">
                 <ui:box win2k:fill=".arrowright" />
             </button>
             <button id="decyear" fill="#d4d0c8" hshrink="true" margin="0" 
padding="4 2">
                 <ui:box win2k:fill=".arrowleft" />
             </button>
-            <ui:box id="year" width="40" />
+            <ui:box id="year" align="center" />
             <button id="incyear" fill="#d4d0c8" hshrink="true" margin="0" 
padding="4 2">
                 <ui:box win2k:fill=".arrowright" />
             </button>
@@ -22,7 +22,9 @@
             </button>
         </ui:box>
         <ui:box fill="black" height="1" vshrink="true" />
-        <layout:grid id="dategrid" cols="7" fill="white" />
+        <layout:pad paddingleft="10">
+            <layout:grid id="dategrid" cols="7" />
+        </layout:pad>
         <ui:box id="holder" display="false">
             <ui:box text="S" />
             <ui:box text="M" />
@@ -40,11 +42,14 @@
             <ui:box fill="black" height="1" vshrink="true" />
         </ui:box>
         
+        $year.width = vexi.ui.font.width(font, fontsize, "000000");
+        $month.width = vexi.ui.font.width(font, fontsize, "0000000000");
+        
         // public properties used to get the current seleted date */
         thisbox.day   = null;
         thisbox.month = null;
         thisbox.year  = null;
-        thisbox.date = null;
+        thisbox.date  = null;
         thisbox.weekday = null;
         thisbox.numdays = null;
         thisbox.popdown = null;
@@ -160,13 +165,17 @@
         }
         
         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++)
         {
             var tmp = vexi..org.vexi.lib.role.clickable(vexi.box);
             tmp.text = "";
+            tmp.align = "left";
             tmp.active ++= activeFunc;
             tmp.hover  ++= hoverFunc;
             tmp.normal ++= normalFunc;
@@ -253,6 +262,7 @@
         /** close us */
         $close.action ++= function(v) {
             display = false;
+            cascade = v;
         }
         
         /** decrease month, and iff switching from jan to dec, decrease year */
@@ -263,6 +273,7 @@
             if (month > 1) tmpmonth = month-1;
             else { tmpmonth = 12; tmpyear = year-1; }
             setDates();
+            cascade = v;
         }
         
         /** increase month, and iff switching from dec to jan, increase year */
@@ -273,6 +284,7 @@
             if (12 > month) tmpmonth = month+1;
             else { tmpmonth = 1; tmpyear = year+1; }
             setDates();
+            cascade = v;
         }
         
         /** decrease year value */
@@ -283,6 +295,7 @@
             tmpmonth = month;
             tmpyear = year - 1;
             setDates();
+            cascade = v;
         }
         
         /** increase year value */
@@ -300,6 +313,7 @@
         {
             if (!v) { tmpmonth = null; tmpyear = null; }
             else curdate = year+""+month+""+day;
+            cascade = v;
         }
         
         /** initializer */
@@ -307,7 +321,8 @@
         {
             setDates();
             trapee.surface --= callee;
+            cascade = v;
         }
         
-    </pad>
+    </layout:border>
 </vexi>


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