2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 namespace ElmSharp.Test
22 public class ScrollerTest4 : TestCaseBase
24 public override string TestName => "ScrollerTest4";
25 public override string TestDescription => "To test basic operation of Scroller";
27 public override void Run(Window window)
29 //Conformant conformant = new Conformant(window);
31 Box outterBox = new Box(window)
41 var button = new Button(window)
47 button.Resize(200, 100);
48 button.Move(300, 100);
50 var button2 = new Button(window)
56 button2.Resize(200, 100);
57 button2.Move(300, 300);
59 var button3 = new Button(window)
65 button3.Resize(200, 100);
66 button3.Move(300, 500);
68 Scroller scroller = new Scroller(window);
70 scroller.Resize(200, 400);
71 scroller.Move(100, 600);
73 Box box = new Box(window)
81 scroller.SetContent(box);
83 var rnd = new Random();
84 for (int i = 0; i < 20; i++)
86 int r = rnd.Next(255);
87 int g = rnd.Next(255);
88 int b = rnd.Next(255);
89 Color color = Color.FromRgb(r, g, b);
90 var colorBox1 = new Label(window)
92 Text = "Label" + i.ToString(),
93 BackgroundColor = color,
97 box.PackEnd(colorBox1);
100 Scroller scroller2 = new Scroller(window);
102 scroller2.Resize(200, 400);
103 scroller2.Move(700, 600);
105 Box box2 = new Box(window)
110 box2.BackgroundColor = Color.White;
112 scroller2.SetContent(box2);
115 for (int i = 0; i < 20; i++)
117 int r = rnd.Next(255);
118 int g = rnd.Next(255);
119 int b = rnd.Next(255);
120 Color color = Color.FromRgb(r, g, b);
121 var colorBox2 = new Label(scroller2)
123 BackgroundColor = color,
128 box2.PackEnd(colorBox2);
131 //conformant.SetContent(outterBox);
132 //outterBox.PackEnd(button);
133 //outterBox.PackEnd(button2);
134 //outterBox.PackEnd(button3);
135 //outterBox.PackEnd(scroller);
136 //outterBox.PackEnd(scroller2);
138 //outterBox.SetLayoutCallback(() =>
140 // scroller.Move(100, 800);
141 // button.Move(300, 100);
142 // button2.Move(300, 300);
143 // button3.Move(300, 500);
144 // scroller2.Move(700, 800);