autoLayout: Added tests
authorJerome St-Louis <jerome@ecere.com>
Wed, 1 Jun 2016 04:34:47 +0000 (00:34 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 21 Nov 2016 14:18:52 +0000 (09:18 -0500)
autoLayout/autoLayout/autoLayout.ec
autoLayout/tests/test.epj [new file with mode: 0644]
autoLayout/tests/test1.ec [new file with mode: 0644]
autoLayout/tests/test2.ec [new file with mode: 0644]
autoLayout/tests/test3.ec [new file with mode: 0644]
autoLayout/tests/test4.ec [new file with mode: 0644]

index 894e795..c9824bc 100644 (file)
@@ -1,4 +1,4 @@
-import "ecere"
+public import "ecere"
 import "wrapText"
 
 // Add 'unset' ?
diff --git a/autoLayout/tests/test.epj b/autoLayout/tests/test.epj
new file mode 100644 (file)
index 0000000..32f9f95
--- /dev/null
@@ -0,0 +1,53 @@
+{
+   "Version" : 0.2,
+   "ModuleName" : "test1",
+   "Options" : {
+      "Warnings" : "All",
+      "PreprocessorDefinitions" : [
+         "IMPORT_STATIC=\"\""
+      ],
+      "TargetType" : "Executable",
+      "TargetFileName" : "test1",
+      "Libraries" : [
+         "ecere"
+      ]
+   },
+   "Configurations" : [
+      {
+         "Name" : "Debug",
+         "Options" : {
+            "Debug" : true,
+            "Optimization" : "None",
+            "PreprocessorDefinitions" : [
+               "_DEBUG"
+            ],
+            "FastMath" : false
+         }
+      },
+      {
+         "Name" : "Release",
+         "Options" : {
+            "Debug" : false,
+            "Optimization" : "Speed",
+            "FastMath" : true
+         }
+      }
+   ],
+   "Files" : [
+      {
+         "Folder" : "autoLayout",
+         "Files" : [
+            "../autoLayout/autoLayout.ec",
+            "../autoLayout/wrapText.ec"
+         ]
+      },
+      "test1.ec",
+      "test2.ec",
+      "test3.ec",
+      "test4.ec"
+   ],
+   "ResourcesPath" : "",
+   "Resources" : [
+
+   ]
+}
diff --git a/autoLayout/tests/test1.ec b/autoLayout/tests/test1.ec
new file mode 100644 (file)
index 0000000..a18e8c8
--- /dev/null
@@ -0,0 +1,25 @@
+import "autoLayout"
+
+AutoLayoutForm form1 { contents = Elemental1 { }, clientSize = { 1024, 768 } };
+
+class Elemental1 : Col
+{
+   bgColor = ivory;
+   font = { "Verdana", 20, true };
+
+   Bar c1 { this, bgColor = gray, maxSize = { 1.0, 100 }, hAlignment = center, vAlignment = right, caption = "Line 1" };
+      Element b0 { c1, caption = "<<", fgColor = white, bgColor = navy, selfHAlignment = left, selfVAlignment = left };
+      Element b1 { c1, caption = "The", bgColor = red };
+      Element b2 { c1, caption = "Quick", bgColor = blue, fgColor = white };
+      Element b3 { c1, caption = "Brown" };
+      Element b3b { c1, caption = ">>", fgColor = white, bgColor = navy, selfHAlignment = right, selfVAlignment = left };
+
+   Bar r3 { this, bgColor = green, maxSize = { 1.0, 150 }, caption = "Line 2" };
+      Element b4 { r3, caption = "Fox.", bgColor = yellow };
+      Element b5 { r3, bgColor = aquamarine, maxSize = { .25, 50 } };
+      Element b6 { r3, bgColor = tomato, maxSize = { .5, 50 } };
+   Bar r4 { this, bgColor = blue, maxSize = { 1.0, 50 }, caption = "Line 3", fgColor = white };
+      Element b7 { r4, caption = "Left", bgColor = skyBlue };
+      Element b8 { r4, caption = "Address Bar", bgColor = teal, maxSize.w = 1.0 };
+      Element b9 { r4, caption = "Right", bgColor = maroon };
+}
diff --git a/autoLayout/tests/test2.ec b/autoLayout/tests/test2.ec
new file mode 100644 (file)
index 0000000..9f9cf71
--- /dev/null
@@ -0,0 +1,30 @@
+import "autoLayout"
+
+AutoLayoutForm form1 { contents = Elemental2 { }, clientSize = { 1024, 768 } };
+
+class Elemental2 : Col
+{
+   font = { "Verdana", 20, true };
+   bgColor = skyBlue;
+
+   Bar r1 { this };
+      Col c1 { r1, maxSize.w = 0.25, bgColor = blue };
+      Col c2 { r1, maxSize.w = 0.5, bgColor = red };
+      Col c3 { r1, maxSize.w = 0.25, bgColor = blue };
+
+   Bar r { this, bgColor = beige, minSize.h = 10, maxSize.h = 10 };
+
+   Bar r2 { this };
+      Col d1 { r2, maxSize.w = 0.25, bgColor = blue };
+      Col d11 { r2, maxSize.w = 0.5, caption = "Hello", bgColor = green };
+      Col d2 { r2, maxSize.w = 0.5, bgColor = red };
+      Col d3 { r2, maxSize.w = 0.25, bgColor = blue };
+      Col d4 { r2, maxSize.w = 0.25, bgColor = green };
+
+   Bar rr { this, bgColor = beige, minSize.h = 10, maxSize.h = 10 };
+
+   Bar r3 { this };
+      Col { r3, minSize.w = 30, maxSize.w = 0,  bgColor = blue };
+      Col { r3, maxSize.w = 1.0, caption = "Hello", bgColor = green };
+      Col { r3, minSize.w = 30, maxSize.w = 0, bgColor = red };
+}
diff --git a/autoLayout/tests/test3.ec b/autoLayout/tests/test3.ec
new file mode 100644 (file)
index 0000000..9347754
--- /dev/null
@@ -0,0 +1,12 @@
+import "autoLayout"
+
+AutoLayoutForm form1 { contents = Elemental3 { }, clientSize = { 1024, 768 } };
+
+class Elemental3 : Col
+{
+   bgColor = skyBlue;
+   Bar r2 { this, bgColor = blue };
+   // Bar r { this, bgColor = beige, minSize.h = 10, maxSize.h = 10 };
+   Bar r { this, bgColor = beige, minSize.h = 10, maxSize.h = 10 };
+   Bar r3 { this, bgColor = green };
+}
diff --git a/autoLayout/tests/test4.ec b/autoLayout/tests/test4.ec
new file mode 100644 (file)
index 0000000..2d1e507
--- /dev/null
@@ -0,0 +1,19 @@
+import "autoLayout"
+
+AutoLayoutForm form1 { contents = Elemental4 { }, clientSize = { 1024, 768 } };
+
+class Elemental4 : Col
+{
+   font = { "Verdana", 20, true };
+   bgColor = ivory;
+
+   Bar header { this, bgColor = blue };
+   Bar middle { this, bgColor = white };
+      Col col1 { middle, bgColor = lime };
+         Element e1 { col1, caption = "Foo", bgColor = gray, selfHAlignment = center, selfVAlignment = center };
+      Col col2 { middle, bgColor = skyBlue };
+         Element e2 { col2, caption = "Bar", bgColor = lightGray, selfHAlignment = center, selfVAlignment = center };
+      Col col3 { middle, bgColor = tomato };
+         Element e3 { col3, caption = "Third", bgColor = lightGray, selfHAlignment = center, selfVAlignment = center };
+   Bar footer { this, bgColor = red };
+}