summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2016-10-31 12:53:48 +0900
committerGerrit Code Review <gerrit@s001>2016-10-31 12:53:48 +0900
commitdc68b2b14eb877eac56380677724c84436000cdb (patch)
tree2054c7320937c4adfad965dde9ab519026e83274
parent7f15b8af3b17f40a28a43a96448ac6b92f456ceb (diff)
parentf7b0daf02462b19d7a04be275035165ffd547555 (diff)
downloadelm-sharp-dc68b2b14eb877eac56380677724c84436000cdb.tar.gz
elm-sharp-dc68b2b14eb877eac56380677724c84436000cdb.tar.bz2
elm-sharp-dc68b2b14eb877eac56380677724c84436000cdb.zip
Merge "Add Clipper TC" into devel/dotnet
-rw-r--r--ElmSharp.Test/ElmSharp.Test.csproj3
-rw-r--r--ElmSharp.Test/TC/ClipperTest1.cs73
2 files changed, 75 insertions, 1 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj
index 977d0d3..8d9dedf 100644
--- a/ElmSharp.Test/ElmSharp.Test.csproj
+++ b/ElmSharp.Test/ElmSharp.Test.csproj
@@ -48,6 +48,7 @@
<Compile Include="TC\ButtonTest1.cs" />
<Compile Include="TC\CalendarTest1.cs" />
<Compile Include="TC\CheckTest1.cs" />
+ <Compile Include="TC\ClipperTest1.cs" />
<Compile Include="TC\ColorSelectorTest1.cs" />
<Compile Include="TC\ContextPopupTest1.cs" />
<Compile Include="TC\DateTimeSelectorTest1.cs" />
@@ -177,4 +178,4 @@
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
-</Project>
+</Project> \ No newline at end of file
diff --git a/ElmSharp.Test/TC/ClipperTest1.cs b/ElmSharp.Test/TC/ClipperTest1.cs
new file mode 100644
index 0000000..af9cc76
--- /dev/null
+++ b/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);
+ }
+ }
+}