From 4df9dda0d8de5694cad322c7d03b1a81423763ba Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 1 Jun 2016 00:34:47 -0400 Subject: [PATCH] autoLayout: Added tests --- autoLayout/autoLayout/autoLayout.ec | 2 +- autoLayout/tests/test.epj | 53 +++++++++++++++++++++++++++++++++++++ autoLayout/tests/test1.ec | 25 +++++++++++++++++ autoLayout/tests/test2.ec | 30 +++++++++++++++++++++ autoLayout/tests/test3.ec | 12 +++++++++ autoLayout/tests/test4.ec | 19 +++++++++++++ 6 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 autoLayout/tests/test.epj create mode 100644 autoLayout/tests/test1.ec create mode 100644 autoLayout/tests/test2.ec create mode 100644 autoLayout/tests/test3.ec create mode 100644 autoLayout/tests/test4.ec diff --git a/autoLayout/autoLayout/autoLayout.ec b/autoLayout/autoLayout/autoLayout.ec index 894e795..c9824bc 100644 --- a/autoLayout/autoLayout/autoLayout.ec +++ b/autoLayout/autoLayout/autoLayout.ec @@ -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 index 0000000..32f9f95 --- /dev/null +++ b/autoLayout/tests/test.epj @@ -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 index 0000000..a18e8c8 --- /dev/null +++ b/autoLayout/tests/test1.ec @@ -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 index 0000000..9f9cf71 --- /dev/null +++ b/autoLayout/tests/test2.ec @@ -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 index 0000000..9347754 --- /dev/null +++ b/autoLayout/tests/test3.ec @@ -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 index 0000000..2d1e507 --- /dev/null +++ b/autoLayout/tests/test4.ec @@ -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 }; +} -- 1.8.3.1