Add IsIndicatorFocusable property in Slider 49/126949/2
authorSeunghyun Choi <sh4682.choi@samsung.com>
Tue, 25 Apr 2017 10:30:29 +0000 (19:30 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Wed, 26 Apr 2017 01:02:47 +0000 (01:02 +0000)
 - need to TV UIComponents

Change-Id: Id2a84bb4185f5473935abe4bb23f00f4a4577303
Signed-off-by: Seunghyun Choi <sh4682.choi@samsung.com>
ElmSharp.Test/TC/SliderTest1.cs
ElmSharp/ElmSharp/Slider.cs [changed mode: 0755->0644]
ElmSharp/Interop/Interop.Elementary.Slider.cs

index 200d770..9113836 100644 (file)
@@ -46,7 +46,28 @@ namespace ElmSharp.Test
                 AlignmentX = -1,
                 AlignmentY = 0.5,
                 WeightX = 1,
-                WeightY = 1
+                WeightY = 1,
+                IsIndicatorFocusable = true
+            };
+
+            Button btn = new Button(window)
+            {
+                AlignmentX = -1,
+                AlignmentY = 0,
+                WeightX = 1,
+                WeightY = 1,
+                Text = "Set IsIndicatorFocusable"
+            };
+            btn.Clicked += (s, e) =>
+            {
+                if (sld1.IsIndicatorFocusable)
+                {
+                    sld1.IsIndicatorFocusable = false;
+                }
+                else
+                {
+                    sld1.IsIndicatorFocusable = true;
+                }
             };
 
             Label lb1 = new Label(window)
@@ -58,9 +79,11 @@ namespace ElmSharp.Test
             };
 
             table.Pack(sld1, 1, 1, 2, 1);
-            table.Pack(lb1, 1, 2, 2, 1);
+            table.Pack(btn, 1, 2, 2, 1);
+            table.Pack(lb1, 1, 3, 2, 1);
 
             sld1.Show();
+            btn.Show();
             lb1.Show();
 
             sld1.ValueChanged += (s, e) =>
@@ -70,4 +93,4 @@ namespace ElmSharp.Test
             };
         }
     }
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 3db4388..7bad50e
@@ -19,7 +19,7 @@ using System;
 namespace ElmSharp
 {
     /// <summary>
-    /// The Slider is a widget that adds a draggable \93slider\94 widget for selecting the value of something within a range.
+    /// The Slider is a widget that adds a draggable slider widget for selecting the value of something within a range.
     /// </summary>
     public class Slider : Layout
     {
@@ -282,6 +282,21 @@ namespace ElmSharp
             }
         }
 
+        /// <summary>
+        /// Sets or gets whether to Show the indicator of slider on focus.
+        /// </summary>
+        public bool IsIndicatorFocusable
+        {
+            get
+            {
+                return Interop.Elementary.elm_slider_indicator_show_on_focus_get(RealHandle);
+            }
+            set
+            {
+                Interop.Elementary.elm_slider_indicator_show_on_focus_set(RealHandle, value);
+            }
+        }
+
         protected override IntPtr CreateHandle(EvasObject parent)
         {
             IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
@@ -293,4 +308,4 @@ namespace ElmSharp
             return handle;
         }
     }
-}
+}
\ No newline at end of file
index 5dc88f4..074311c 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
@@ -31,10 +31,17 @@ 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_show_on_focus_set(IntPtr obj, bool focus);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern bool elm_slider_indicator_show_on_focus_get(IntPtr obj);
+
+        [DllImport(Libraries.Elementary)]
         internal static extern void elm_slider_indicator_format_set(IntPtr obj, string indicator);
 
         [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_indicator_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
         internal static extern IntPtr _elm_slider_indicator_format_get(IntPtr obj);
+
         internal static string elm_slider_indicator_format_get(IntPtr obj)
         {
             var text = _elm_slider_indicator_format_get(obj);
@@ -46,6 +53,7 @@ internal static partial class Interop
 
         [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_unit_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
         internal static extern IntPtr _elm_slider_unit_format_get(IntPtr obj);
+
         internal static string elm_slider_unit_format_get(IntPtr obj)
         {
             var text = _elm_slider_unit_format_get(obj);
@@ -94,4 +102,4 @@ internal static partial class Interop
         [DllImport(Libraries.Elementary)]
         internal static extern double elm_slider_step_get(IntPtr obj);
     }
-}
+}
\ No newline at end of file