summaryrefslogtreecommitdiff
path: root/ElmSharp.Test
diff options
context:
space:
mode:
authordarkleem <cdark.lim@samsung.com>2017-06-07 15:46:41 +0900
committerdarkleem <cdark.lim@samsung.com>2017-06-07 15:46:41 +0900
commitf9404df306b7ec899e131fcbb80027f0bfcb7e0b (patch)
treea80a5fd5ae57864b5cf9e7c0ef5f107fb351358f /ElmSharp.Test
parent2e64ba1ee3b6ff540e792d6ac53c3fef7e35a46c (diff)
downloadelm-sharp-f9404df306b7ec899e131fcbb80027f0bfcb7e0b.tar.gz
elm-sharp-f9404df306b7ec899e131fcbb80027f0bfcb7e0b.tar.bz2
elm-sharp-f9404df306b7ec899e131fcbb80027f0bfcb7e0b.zip
Add evasMap TC
- TASK=TCAPI-2217 Signed-off-by: darkleem <cdark.lim@samsung.com> Change-Id: I2fbee1ba3261301807cd50abadc5d327a85d0c77
Diffstat (limited to 'ElmSharp.Test')
-rwxr-xr-xElmSharp.Test/ElmSharp.Test.csproj1
-rw-r--r--ElmSharp.Test/TC/EvasMapTest2.cs131
2 files changed, 132 insertions, 0 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj
index 9e0b6cf..c40186b 100755
--- a/ElmSharp.Test/ElmSharp.Test.csproj
+++ b/ElmSharp.Test/ElmSharp.Test.csproj
@@ -46,6 +46,7 @@
<Compile Include="TC\BackgroundTest2.cs" />
<Compile Include="TC\BackgroundTest3.cs" />
<Compile Include="TC\EcoreTimerTest1.cs" />
+ <Compile Include="TC\EvasMapTest2.cs" />
<Compile Include="TC\GenListTest10.cs" />
<Compile Include="TC\LabelTest4.cs" />
<Compile Include="TC\Log.cs" />
diff --git a/ElmSharp.Test/TC/EvasMapTest2.cs b/ElmSharp.Test/TC/EvasMapTest2.cs
new file mode 100644
index 0000000..17d411e
--- /dev/null
+++ b/ElmSharp.Test/TC/EvasMapTest2.cs
@@ -0,0 +1,131 @@
+´╗┐using System;
+using ElmSharp;
+
+namespace ElmSharp.Test
+{
+ class EvasMapTest2 : TestCaseBase
+ {
+ public override string TestName => "EvasMapTest2";
+ public override string TestDescription => "Test EvasMap on different levels of hierarchy";
+
+ public override void Run(Window window)
+ {
+ var box = new Box(window)
+ {
+ IsHorizontal = false,
+ };
+ box.SetAlignment(-1.0, -1.0); // fill
+ box.SetWeight(1.0, 1.0); // expand
+ box.Show();
+
+ var group = new Box(box)
+ {
+ IsHorizontal = true,
+ BackgroundColor = Color.White,
+ };
+ group.Show();
+
+ var x = new Label(group)
+ {
+ Text = "X",
+ };
+ x.Show();
+
+ var y = new Label(group)
+ {
+ Text = "Y",
+ };
+ y.Show();
+
+ var z = new Label(group)
+ {
+ Text = "Z",
+ };
+ z.Show();
+ group.PackEnd(x);
+ group.PackEnd(y);
+ group.PackEnd(z);
+
+ var top = new Rectangle(box)
+ {
+ Color = Color.Red,
+ };
+ top.SetAlignment(-1.0, -1.0); // fill
+ top.SetWeight(1.0, 1.0); // expand
+ top.Show();
+
+ var bottom = new Rectangle(box)
+ {
+ Color = Color.Green,
+ };
+ bottom.SetAlignment(-1.0, -1.0); // fill
+ bottom.SetWeight(1.0, 1.0); // expand
+ bottom.Show();
+
+ double angle = 0.0;
+
+ var reset = new Button(box)
+ {
+ Text = "Reset",
+ AlignmentX = -1.0,
+ WeightX = 1.0,
+ };
+ reset.Show();
+
+ reset.Clicked += (object sender, EventArgs e) =>
+ {
+ group.IsMapEnabled = false;
+ x.IsMapEnabled = false;
+ angle = 0.0;
+ };
+
+ var zoom = new Button(box)
+ {
+ Text = "Zoom group",
+ AlignmentX = -1.0,
+ WeightX = 1.0,
+ };
+ zoom.Show();
+
+ zoom.Clicked += (object sender, EventArgs e) =>
+ {
+ var map = new EvasMap(4);
+ var g = group.Geometry;
+ map.PopulatePoints(g, 0);
+ map.Zoom(3.0, 3.0, g.X + g.Width / 2, g.Y + g.Height / 2);
+ group.EvasMap = map;
+ group.IsMapEnabled = true;
+ };
+
+ var rotate = new Button(box)
+ {
+ Text = "Rotate X",
+ AlignmentX = -1.0,
+ WeightX = 1.0,
+ };
+ rotate.Show();
+
+ rotate.Clicked += (object sender, EventArgs e) =>
+ {
+ angle += 5.0;
+
+ var map = new EvasMap(4);
+ var g = x.Geometry;
+ map.PopulatePoints(g, 0);
+ map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0);
+ x.EvasMap = map;
+ x.IsMapEnabled = true;
+ };
+
+ box.PackEnd(top);
+ box.PackEnd(group);
+ box.PackEnd(bottom);
+ box.PackEnd(reset);
+ box.PackEnd(zoom);
+ box.PackEnd(rotate);
+
+ box.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
+ box.Move(0, 0);
+ }
+ }
+} \ No newline at end of file