Merge "[Telephony] Sample App implementation."
[platform/core/csapi/tizenfx.git] / test / ElmSharp.Test / TC / LabelTest2.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 ElmSharp;
19
20 namespace ElmSharp.Test
21 {
22     class LabelTest2 : TestCaseBase
23     {
24         public override string TestName => "LabelTest2";
25         public override string TestDescription => "To test basic operation of Label";
26
27         public override void Run(Window window)
28         {
29             Background bg = new Background(window);
30             bg.Color = Color.White;
31             bg.Move(0, 0);
32             bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
33             bg.Show();
34
35             Label label1 = new Label(window);
36             label1.Text = "[default valign=top] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
37             label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'";
38             label1.Resize(650, 0);
39             var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
40             label1.Show();
41             label1.Resize(size.Width, size.Height);
42             label1.Move(0, 0);
43
44             Label label2 = new Label(window);
45             label2.Move(0, size.Height + 10);
46             label2.Text = "[default valign=middle] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
47             label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'";
48             label2.Resize(650, 0);
49             size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
50             label2.Show();
51             label2.Resize(size.Width, size.Height);
52
53             Label label3 = new Label(window);
54             label3.Move(0, label2.Geometry.Y + size.Height + 10);
55             label3.Text = "[default valign=bottom] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
56             label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'";
57             label3.Resize(650, 0);
58             size = label3.EdjeObject["elm.text"].TextBlockFormattedSize;
59             label3.Show();
60             label3.Resize(size.Width, size.Height);
61
62             Label label4 = new Label(window);
63             label4.Move(0, label3.Geometry.Y + size.Height + 10);
64             label4.Text = "<span color=#000000>[No TextStyle]</span>" +
65                 "<span color=#000000 valign=bottom>[bottom gyp]</span>, " +
66                 "<span color=#000000 valign=top>[top gyp]</span>, " +
67                 "<span color=#000000 valign=middle>[middle gyp]</span>";
68             label4.Resize(650, 0);
69             size = label4.EdjeObject["elm.text"].TextBlockFormattedSize;
70             label4.Show();
71             label4.Resize(size.Width, size.Height);
72
73             Label label5 = new Label(window);
74             label5.Move(0, label4.Geometry.Y + size.Height + 10);
75             label5.Text = "<span valign=top color=#000000 font_size=50>[top gyp]</span>";
76             label5.Resize(650, 0);
77             size = label5.EdjeObject["elm.text"].TextBlockFormattedSize;
78             label5.Show();
79             label5.Resize(size.Width, size.Height);
80         }
81
82     }
83 }