<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" />
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();
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();
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();
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);
--- /dev/null
+/*
+ * 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);
+ }
+ }
+}
}
/// <summary>
+ /// Sets or gets the style of the label text.
+ /// </summary>
+ /// <remarks>
+ /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Avalilable since Tizen_4.0.
+ /// </remarks>
+ ///
+ public string TextStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_label_text_style_user_peek(RealHandle);
+ }
+ set
+ {
+ if (!string.IsNullOrEmpty(value))
+ {
+ Interop.Elementary.elm_label_text_style_user_pop(RealHandle);
+ }
+ else
+ {
+ Interop.Elementary.elm_label_text_style_user_push(RealHandle, value);
+ }
+ }
+ }
+
+ /// <summary>
/// Start slide effect.
/// </summary>
public void PlaySlide()
}
/// <summary>
+ /// Sets the vertical text alignment of layout's text part
+ /// </summary>
+ /// <remarks>
+ /// API, elm_layout_text_valign_set, is an internal API only in Tizen. Avalilable since Tizen_4.0.
+ /// </remarks>
+ public virtual void SetVerticalTextAlignment(string part, double valign)
+ {
+ Interop.Elementary.elm_layout_text_valign_set(RealHandle, part, valign);
+ }
+
+ /// <summary>
+ /// Gets the vertical text alignment of layout's text part
+ /// </summary>
+ /// <remarks>
+ /// API, elm_layout_text_valign_get, is internal API only in Tizen. Avalilable since Tizen_4.0.
+ /// </remarks>
+ public virtual double GetVerticalTextAlignment(string part)
+ {
+ return Interop.Elementary.elm_layout_text_valign_get(RealHandle, part);
+ }
+
+ /// <summary>
/// Sets the content at a part of a given container widget.
/// </summary>
/// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param>
[DllImport(Libraries.Elementary)]
internal static extern bool elm_label_ellipsis_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_label_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_label_text_style_user_peek(IntPtr obj);
+ internal static string elm_label_text_style_user_peek(IntPtr obj)
+ {
+ var text = _elm_label_text_style_user_peek(obj);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_text_style_user_push(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_label_text_style_user_pop(IntPtr obj);
}
}
\ No newline at end of file
internal static extern string elm_layout_data_get(IntPtr obj, string key);
[DllImport(Libraries.Elementary)]
+ internal static extern void elm_layout_text_valign_set(IntPtr obj, string part, double valign);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern double elm_layout_text_valign_get(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_notify_add(IntPtr obj);
[DllImport(Libraries.Elementary)]