summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghyun Choi <sh4682.choi@samsung.com>2017-05-02 16:30:10 +0900
committerSeunghyun Choi <sh4682.choi@samsung.com>2017-05-02 16:30:21 +0900
commitacd3cdc5842a5421aa0a70354dbd61a2d8f7066d (patch)
tree07a080964273b3d1e3f897a5f4fc6611b4e5700d
parentb449cfb1b97fc9d0d3835be6e05445aca7b4c14d (diff)
downloadelm-sharp-acd3cdc5842a5421aa0a70354dbd61a2d8f7066d.tar.gz
elm-sharp-acd3cdc5842a5421aa0a70354dbd61a2d8f7066d.tar.bz2
elm-sharp-acd3cdc5842a5421aa0a70354dbd61a2d8f7066d.zip
[Slider] Add Property IndicatorVisibleMode
- Add IndicatorVisibleMode Property - Add TC in SliderTest1 Change-Id: I75bf93c0736183d2c1ff195feb221382de55149d Signed-off-by: Seunghyun Choi <sh4682.choi@samsung.com>
-rw-r--r--ElmSharp.Test/TC/SliderTest1.cs36
-rw-r--r--ElmSharp/ElmSharp/Slider.cs38
-rw-r--r--ElmSharp/Interop/Interop.Elementary.Slider.cs14
3 files changed, 87 insertions, 1 deletions
diff --git a/ElmSharp.Test/TC/SliderTest1.cs b/ElmSharp.Test/TC/SliderTest1.cs
index 9113836..c59b9a8 100644
--- a/ElmSharp.Test/TC/SliderTest1.cs
+++ b/ElmSharp.Test/TC/SliderTest1.cs
@@ -70,6 +70,38 @@ namespace ElmSharp.Test
}
};
+ Button btn2 = new Button(window)
+ {
+ AlignmentX = -1,
+ AlignmentY = 0,
+ WeightX = 1,
+ WeightY = 1,
+ Text = "Set IndicatorVisibleMode"
+ };
+ btn2.Clicked += (s, e) =>
+ {
+ if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default)
+ {
+ sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always;
+ btn2.Text = "Always";
+ }
+ else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always)
+ {
+ sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus;
+ btn2.Text = "OnFocus";
+ }
+ else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus)
+ {
+ sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None;
+ btn2.Text = "None";
+ }
+ else
+ {
+ sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default;
+ btn2.Text = "Default";
+ }
+ };
+
Label lb1 = new Label(window)
{
AlignmentX = -1,
@@ -80,11 +112,13 @@ namespace ElmSharp.Test
table.Pack(sld1, 1, 1, 2, 1);
table.Pack(btn, 1, 2, 2, 1);
- table.Pack(lb1, 1, 3, 2, 1);
+ table.Pack(btn2, 1, 3, 2, 1);
+ table.Pack(lb1, 1, 4, 2, 1);
sld1.Show();
btn.Show();
lb1.Show();
+ btn2.Show();
sld1.ValueChanged += (s, e) =>
{
diff --git a/ElmSharp/ElmSharp/Slider.cs b/ElmSharp/ElmSharp/Slider.cs
index 7bad50e..cf05a71 100644
--- a/ElmSharp/ElmSharp/Slider.cs
+++ b/ElmSharp/ElmSharp/Slider.cs
@@ -18,6 +18,29 @@ using System;
namespace ElmSharp
{
+ public enum SliderIndicatorVisibleMode
+ {
+ /// <summary>
+ /// show indicator on mouse down or change in slider value.
+ /// </summary>
+ Default,
+
+ /// <summary>
+ /// Always show the indicator.
+ /// </summary>
+ Always,
+
+ /// <summary>
+ /// Show the indicator on focus.
+ /// </summary>
+ OnFocus,
+
+ /// <summary>
+ /// Never show the indicator.
+ /// </summary>
+ None
+ }
+
/// <summary>
/// The Slider is a widget that adds a draggable slider widget for selecting the value of something within a range.
/// </summary>
@@ -283,6 +306,21 @@ namespace ElmSharp
}
/// <summary>
+ /// Sets or gets the visible mode of indicator.
+ /// </summary>
+ public SliderIndicatorVisibleMode IndicatorVisibleMode
+ {
+ get
+ {
+ return (SliderIndicatorVisibleMode)Interop.Elementary.elm_slider_indicator_visible_mode_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_slider_indicator_visible_mode_set(RealHandle, (Interop.Elementary.Elm_Slider_Indicator_Visible_Mode)value);
+ }
+ }
+
+ /// <summary>
/// Sets or gets whether to Show the indicator of slider on focus.
/// </summary>
public bool IsIndicatorFocusable
diff --git a/ElmSharp/Interop/Interop.Elementary.Slider.cs b/ElmSharp/Interop/Interop.Elementary.Slider.cs
index 074311c..92e4a3a 100644
--- a/ElmSharp/Interop/Interop.Elementary.Slider.cs
+++ b/ElmSharp/Interop/Interop.Elementary.Slider.cs
@@ -21,6 +21,14 @@ internal static partial class Interop
{
internal static partial class Elementary
{
+ internal enum Elm_Slider_Indicator_Visible_Mode
+ {
+ ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT, /* show indicator on mouse down or change in slider value */
+ ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /* Always show the indicator. */
+ ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /* Show the indicator on focus */
+ ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /* Never show the indicator */
+ }
+
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_slider_add(IntPtr parent);
@@ -31,6 +39,12 @@ internal static partial class Interop
internal static extern bool elm_slider_indicator_show_get(IntPtr obj);
[DllImport(Libraries.Elementary)]
+ internal static extern void elm_slider_indicator_visible_mode_set(IntPtr obj, Elm_Slider_Indicator_Visible_Mode mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern Elm_Slider_Indicator_Visible_Mode elm_slider_indicator_visible_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
internal static extern void elm_slider_indicator_show_on_focus_set(IntPtr obj, bool focus);
[DllImport(Libraries.Elementary)]