Merge "[Telephony] Sample App implementation."
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Test / TC / MultibuttonEntryTest3.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Collections.Generic;
19 using ElmSharp;
20
21 namespace ElmSharp.Test
22 {
23     class MultiButtonEntryTest3 : TestCaseBase
24     {
25         public override string TestName => "MultiButtonEntryTest3";
26         public override string TestDescription => "To test basic operation of MultiButtonEntry";
27
28         public override void Run(Window window)
29         {
30             Background bg = new Background(window);
31             bg.Color = Color.White;
32             bg.Move(0, 0);
33             bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
34             bg.Show();
35
36             MultiButtonEntry mbe = new MultiButtonEntry(window)
37             {
38                 IsEditable = true,
39                 IsExpanded = true,
40                 Text = "To: "
41             };
42             mbe.Append("Append1");
43             mbe.Append("Append2");
44             mbe.Append("Append3");
45             mbe.Append("Append4");
46             mbe.Append("Append5");
47             mbe.Append("Append6");
48             mbe.Append("Append7");
49             mbe.Append("Append8");
50             mbe.Append("Append9");
51             mbe.Append("Append10");
52             mbe.Append("Append11");
53             mbe.Append("Append12");
54
55             Label label1 = new Label(window)
56             {
57                 Text = "MultiButtonEntry Test",
58                 Color = Color.Blue
59             };
60
61             var createButton = new Button(window)
62             {
63                 Text = "Change the status of IsExpanded",
64                 AlignmentX = -1,
65                 WeightX = 1,
66             };
67
68             var deleteButton = new Button(window)
69             {
70                 Text = "Delete",
71                 AlignmentX = -1,
72                 WeightX = 1,
73             };
74
75             createButton.Clicked += (sender, e) =>
76             {
77                 mbe.IsExpanded = !mbe.IsExpanded;
78             };
79
80             deleteButton.Clicked += (sender, e) =>
81             {
82                 mbe.Unrealize();
83             };
84
85             label1.Resize(600, 100);
86             label1.Move(50, 50);
87             label1.Show();
88
89             mbe.Resize(600, 600);
90             mbe.Move(0, 100);
91             mbe.Show();
92
93             createButton.Resize(200, 100);
94             createButton.Move(50, 700);
95             createButton.Show();
96
97             deleteButton.Resize(200, 100);
98             deleteButton.Move(300, 700);
99             deleteButton.Show();
100         }
101     }
102 }