From: Seungkeun Lee Date: Thu, 27 Oct 2016 07:08:10 +0000 (+0900) Subject: Add Clipper TC X-Git-Tag: submit/trunk/20170823.075128~110^2~237^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=186b71a5d1993cba6f573e275de8c78310e450fe;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add Clipper TC - Clipper was blend with others widgets Change-Id: I4d7fa9cca866eacbe5a8d6de15dbca1c4d568cc3 --- diff --git a/test/ElmSharp.Test/ElmSharp.Test.csproj b/test/ElmSharp.Test/ElmSharp.Test.csproj index 977d0d3..8d9dedf 100644 --- a/test/ElmSharp.Test/ElmSharp.Test.csproj +++ b/test/ElmSharp.Test/ElmSharp.Test.csproj @@ -48,6 +48,7 @@ + @@ -177,4 +178,4 @@ - + \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/ClipperTest1.cs b/test/ElmSharp.Test/TC/ClipperTest1.cs new file mode 100644 index 0000000..af9cc76 --- /dev/null +++ b/test/ElmSharp.Test/TC/ClipperTest1.cs @@ -0,0 +1,73 @@ +using System; +using ElmSharp; + +namespace ElmSharp.Test +{ + public class ClipperTest1 : TestCaseBase + { + public override string TestName => "ClipperTest1"; + public override string TestDescription => "ClipperTest1 test"; + + public override void Run(Window window) + { + Conformant conformant = new Conformant(window); + conformant.Show(); + + Naviframe navi = new Naviframe(window) + { + PreserveContentOnPop = true, + DefaultBackButtonEnabled = true + }; + + Scroller scroller = new Scroller(window) + { + AlignmentX = -1, + AlignmentY = -1, + WeightX = 1, + WeightY = 1, + ScrollBlock = ScrollBlock.None, + }; + scroller.Show(); + Box container = new Box(window); + scroller.SetContent(container); + + var rect1 = new Rectangle(window) + { + AlignmentX = -1, + WeightX = 1, + Color = Color.Blue, + MinimumHeight = 500 + }; + rect1.Show(); + + var clipper = new Rectangle(window); + clipper.Color = new ElmSharp.Color(200, 200, 200, 200); + clipper.Geometry = rect1.Geometry; + rect1.Moved += (s, e) => + { + clipper.Geometry = ((Rectangle)s).Geometry; + }; + rect1.SetClip(clipper); + clipper.Show(); + container.PackEnd(rect1); + + Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon }; + for (int i = 0; i < 6; i++) + { + var rect = new Rectangle(window) + { + AlignmentX = -1, + WeightX = 1, + Color = colors[i], + MinimumHeight = 500 + }; + rect.Show(); + container.PackEnd(rect); + } + + navi.Push(scroller, "Scroll Page"); + navi.Show(); + conformant.SetContent(navi); + } + } +}