summaryrefslogtreecommitdiff
path: root/ElmSharp.Test
diff options
context:
space:
mode:
Diffstat (limited to 'ElmSharp.Test')
-rwxr-xr-xElmSharp.Test/ElmSharp.Test.csproj1
-rw-r--r--ElmSharp.Test/TC/LabelTest2.cs6
-rw-r--r--ElmSharp.Test/TC/LabelTest3.cs6
-rw-r--r--ElmSharp.Test/TC/LabelValignTest1.cs126
4 files changed, 132 insertions, 7 deletions
diff --git a/ElmSharp.Test/ElmSharp.Test.csproj b/ElmSharp.Test/ElmSharp.Test.csproj
index e450ad8..9014a3e 100755
--- a/ElmSharp.Test/ElmSharp.Test.csproj
+++ b/ElmSharp.Test/ElmSharp.Test.csproj
@@ -96,6 +96,7 @@
<Compile Include="TC\IndexTest1.cs" />
<Compile Include="TC\IndexTest2.cs" />
<Compile Include="TC\LabelTest1.cs" />
+ <Compile Include="TC\LabelValignTest1.cs" />
<Compile Include="TC\ListTest1.cs" />
<Compile Include="TC\NaviframeTest1.cs" />
<Compile Include="TC\NaviframeTest2.cs" />
diff --git a/ElmSharp.Test/TC/LabelTest2.cs b/ElmSharp.Test/TC/LabelTest2.cs
index 5d837d6..25a2b56 100644
--- a/ElmSharp.Test/TC/LabelTest2.cs
+++ b/ElmSharp.Test/TC/LabelTest2.cs
@@ -34,7 +34,7 @@ namespace ElmSharp.Test
Label label1 = new Label(window);
label1.Text = "[default valign=top] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
- label1.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'";
+ label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'";
label1.Resize(650, 0);
var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
label1.Show();
@@ -44,7 +44,7 @@ namespace ElmSharp.Test
Label label2 = new Label(window);
label2.Move(0, size.Height + 10);
label2.Text = "[default valign=middle] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
- label2.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'";
+ label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'";
label2.Resize(650, 0);
size = label2.EdjeObject["elm.text"].TextBlockFormattedSize;
label2.Show();
@@ -53,7 +53,7 @@ namespace ElmSharp.Test
Label label3 = new Label(window);
label3.Move(0, label2.Geometry.Y + size.Height + 10);
label3.Text = "[default valign=bottom] gyj <span valign=bottom>[bottom gyp]</span>, <span valign=top>[top gyp]</span>, <span valign=middle>[middle gyp]</span>";
- label3.EdjeObject["elm.text"].TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'";
+ label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'";
label3.Resize(650, 0);
size = label3.EdjeObject["elm.text"].TextBlockFormattedSize;
label3.Show();
diff --git a/ElmSharp.Test/TC/LabelTest3.cs b/ElmSharp.Test/TC/LabelTest3.cs
index 55374cc..eaf5aeb 100644
--- a/ElmSharp.Test/TC/LabelTest3.cs
+++ b/ElmSharp.Test/TC/LabelTest3.cs
@@ -57,16 +57,14 @@ namespace ElmSharp.Test
label1.Text = "Jo Ann Buckner";
- label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'";
- label1.EdjeObject.EmitSignal("elm,state,text,visible", "elm");
+ label1.TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'";
label1.Show();
label1.Resize(100000, 0);
size = label1.EdjeObject["elm.text"].TextBlockFormattedSize;
label1.Geometry = new Rect(55, 213, size.Width, size.Height);
label2.Text = "Customer Success Engineer";
- label2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'";
- label2.EdjeObject.EmitSignal("elm,state,text,visible", "elm");
+ label2.TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'";
label2.Show();
label2.Resize(100000, 0);
diff --git a/ElmSharp.Test/TC/LabelValignTest1.cs b/ElmSharp.Test/TC/LabelValignTest1.cs
new file mode 100644
index 0000000..a104a82
--- /dev/null
+++ b/ElmSharp.Test/TC/LabelValignTest1.cs
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using ElmSharp;
+using System.Collections.Generic;
+
+namespace ElmSharp.Test
+{
+ public class LabelValignTest1 : TestCaseBase
+ {
+ public override string TestName => "LabelValignTest1";
+ public override string TestDescription => "To test Vertical align of Label";
+
+ public override void Run(Window window)
+ {
+ Background bg = new Background(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ Color = Color.White
+ };
+ bg.Show();
+ window.AddResizeObject(bg);
+
+ Conformant conformant = new Conformant(window);
+ conformant.Show();
+ Box box = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ box.Show();
+ conformant.SetContent(box);
+
+ Box labelBox = new Box(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1,
+ MinimumHeight = 400,
+ BackgroundColor = Color.Blue,
+ };
+ labelBox.Show();
+
+
+
+ Label label1 = new Label(window)
+ {
+ Text = "Align Test",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ WeightY = 1
+ };
+ label1.TextStyle = "DEFAULT = 'color=#000000FF font_size=100 align=center wrap=word'";
+ label1.Show();
+ labelBox.PackEnd(label1);
+
+ Button top = new Button(window)
+ {
+ Text = "Top",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+
+ Button middle = new Button(window)
+ {
+ Text = "Middle",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+ Button bottom = new Button(window)
+ {
+ Text = "bottom",
+ AlignmentX = -1,
+ AlignmentY = -1,
+ WeightX = 1,
+ };
+
+ top.Clicked += (s, e) =>
+ {
+ label1.SetPartValign("elm.text", 0);
+ };
+
+ middle.Clicked += (s, e) =>
+ {
+ label1.SetPartValign("elm.text", 0.5);
+ };
+
+ bottom.Clicked += (s, e) =>
+ {
+ label1.SetPartValign("elm.text", 1.0);
+ };
+
+ top.Show();
+ labelBox.Show();
+ middle.Show();
+ bottom.Show();
+ box.PackEnd(labelBox);
+ box.PackEnd(top);
+ box.PackEnd(middle);
+ box.PackEnd(bottom);
+ }
+ }
+}