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 class LabelTest2 : TestCaseBase
24 public override string TestName => "LabelTest2";
25 public override string TestDescription => "To test basic operation of Label";
27 public override void Run(Window window)
29 Background bg = new Background(window);
30 bg.Color = Color.White;
32 bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height);
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;
41 label1.Resize(size.Width, size.Height);
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;
51 label2.Resize(size.Width, size.Height);
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;
60 label3.Resize(size.Width, size.Height);
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;
71 label4.Resize(size.Width, size.Height);
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;
79 label5.Resize(size.Width, size.Height);