diff mde/content/AStringContent.d @ 124:a2ef6b549101

Dynamic minimal size changing is now fully supported. Support for reducing minimal size in layouts. Editing numbers as text now always converts new number back to string at end of edit. Floating point number display format changed.
author Diggory Hardy <diggory.hardy@gmail.com>
date Mon, 05 Jan 2009 12:43:27 +0000
parents d3b2cefd46c9
children c9843fbaac88
line wrap: on
line diff
--- a/mde/content/AStringContent.d	Sun Jan 04 17:35:15 2009 +0000
+++ b/mde/content/AStringContent.d	Mon Jan 05 12:43:27 2009 +0000
@@ -171,7 +171,8 @@
     
     override char[] endEdit () {
 	v = sv && (sv[0] == 't' || sv[0] == 'T' || sv[0] == '1');
-	endEvent;
+        sv = v ? "true" : "false";
+        endEvent;
 	return sv;
     }
     
@@ -237,9 +238,9 @@
             v = Int.toInt (sv);
         } catch (Exception e) {
             logger.warn (e.msg);
-            sv = Int.toString (v);
         }
-	endEvent;
+        sv = Int.toString (v);
+        endEvent;
 	return sv;
     }
     
@@ -258,7 +259,7 @@
     
     void assignNoCb (double val) {
 	v = val;
-	sv = Float.toString (v);
+	sv = Float.toString (v, 8, 4);
 	if (pos > sv.length) pos = sv.length;
     }
     void opAssign (double val) {
@@ -275,9 +276,9 @@
             v = Float.toFloat (sv);
         } catch (Exception e) {
             logger.warn (e.msg);
-            sv = Float.toString (v);
         }
-	endEvent;
+        sv = Float.toString (v, 8, 4);
+        endEvent;
 	return sv;
     }