diff options
author | jh5.cho <jh5.cho@samsung.com> | 2016-12-02 11:04:35 +0900 |
---|---|---|
committer | jh5.cho <jh5.cho@samsung.com> | 2016-12-02 11:34:01 +0900 |
commit | 9bba3fa733eed84630f45146d36392945fd0e6c6 (patch) | |
tree | a7c9c8a79f1295e0905290d1e114bdf2fba11a16 /ElmSharp.Test | |
parent | 04db1f96a7a37953f23c56632c7caf6175808538 (diff) | |
download | elm-sharp-9bba3fa733eed84630f45146d36392945fd0e6c6.tar.gz elm-sharp-9bba3fa733eed84630f45146d36392945fd0e6c6.tar.bz2 elm-sharp-9bba3fa733eed84630f45146d36392945fd0e6c6.zip |
Add EvasMapTest1 as TC
Change-Id: I5c28989396652538f911b6a76465cf7f8a9c3519
Diffstat (limited to 'ElmSharp.Test')
-rwxr-xr-x | ElmSharp.Test/ElmSharp.Test.csproj | 1 | ||||
-rwxr-xr-x | ElmSharp.Test/TC/EvasMapTest1.cs | 113 |
2 files changed, 114 insertions, 0 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj index f703a51..22fb426 100755 --- a/ElmSharp.Test/ElmSharp.Test.csproj +++ b/ElmSharp.Test/ElmSharp.Test.csproj @@ -52,6 +52,7 @@ <Compile Include="TC\ColorSelectorTest1.cs" /> <Compile Include="TC\ContextPopupTest1.cs" /> <Compile Include="TC\DateTimeSelectorTest1.cs" /> + <Compile Include="TC\EvasMapTest1.cs" /> <Compile Include="TC\EntryTest1.cs" /> <Compile Include="TC\GenGridTest1.cs" /> <Compile Include="TC\GenGridTest2.cs" /> diff --git a/ElmSharp.Test/TC/EvasMapTest1.cs b/ElmSharp.Test/TC/EvasMapTest1.cs new file mode 100755 index 0000000..498dd16 --- /dev/null +++ b/ElmSharp.Test/TC/EvasMapTest1.cs @@ -0,0 +1,113 @@ +using System; +using ElmSharp; + +namespace ElmSharp.Test +{ + class EvasMapTest1 : TestCaseBase + { + public override string TestName => "EvasMapTest1"; + 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); + box.SetWeight(1.0, 1.0); + box.Show(); + + var text = new Label(box) + { + Text = "<span color=#ffffff font_size=30>Target</span>", + AlignmentX = -1.0, + AlignmentY = -1.0, + WeightX = 1.0, + WeightY = 1.0, + }; + text.Show(); + + var textBox = new Box(box) + { + AlignmentX = -1.0, + WeightX = 1.0, + WeightY = 0.7, + }; + textBox.PackEnd(text); + textBox.Show(); + + double angle = 0.0; + + var reset = new Button(box) + { + Text = "Reset", + AlignmentX = -1.0, + WeightX = 1.0, + WeightY = 0.1, + }; + reset.Show(); + + double zx = 1.0; + double zy = 1.0; + reset.Clicked += (object sender, EventArgs e) => + { + text.IsMapEnabled = false; + angle = 0.0; + zx = 1.0; + zy = 1.0; + }; + + var zoom = new Button(box) + { + Text = "Zoom Target", + AlignmentX = -1.0, + WeightX = 1.0, + WeightY = 0.1, + }; + zoom.Show(); + + zoom.Clicked += (object sender, EventArgs e) => + { + zx += 0.1; + zy += 0.1; + var map = new EvasMap(4); + var g = text.Geometry; + map.PopulatePoints(g, 0); + map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); + map.Zoom(zx, zy, g.X, g.Y); + text.EvasMap = map; + text.IsMapEnabled = true; + }; + + var rotate = new Button(box) + { + Text = "Rotate Target", + AlignmentX = -1.0, + WeightX = 1.0, + WeightY = 0.1, + }; + rotate.Show(); + + rotate.Clicked += (object sender, EventArgs e) => + { + angle += 5.0; + var map = new EvasMap(4); + var g = text.Geometry; + map.PopulatePoints(g, 0); + map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); + map.Zoom(zx, zy, g.X, g.Y); + text.EvasMap = map; + text.IsMapEnabled = true; + }; + + box.PackEnd(textBox); + 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 |