Add ScrollBarVisiblePolicy to GenGrid 76/123576/1
authorSungHyun Min <shyun.min@samsung.com>
Thu, 6 Apr 2017 06:47:24 +0000 (15:47 +0900)
committerSungHyun Min <shyun.min@samsung.com>
Thu, 6 Apr 2017 06:49:40 +0000 (15:49 +0900)
Change-Id: Ieb6d6569e82864cf4b2d929dbdb229f4dbda4649
Signed-off-by: SungHyun Min <shyun.min@samsung.com>
ElmSharp.Test/TC/GenGridTest1.cs
ElmSharp/ElmSharp/GenGrid.cs [changed mode: 0755->0644]

index ac1c309..cbfc18e 100644 (file)
@@ -38,6 +38,8 @@ namespace ElmSharp.Test
                 ItemAlignmentY = -1,
                 ItemWidth = window.ScreenSize.Width / 3,
                 ItemHeight = window.ScreenSize.Width / 3,
+                HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible,
+                VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible
             };
 
             GenItemClass defaultClass = new GenItemClass("default")
@@ -61,7 +63,6 @@ namespace ElmSharp.Test
                     }
                     return null;
                 }
-
             };
 
             var rnd = new Random();
@@ -82,4 +83,4 @@ namespace ElmSharp.Test
             Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));
         }
     }
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 2d22658..c1aeeed
@@ -29,14 +29,17 @@ namespace ElmSharp
         /// Any further clicks will do nothing, unless you set Always select mode.
         /// </summary>
         Default = 0,
+
         /// <summary>
         /// This means that, even if selected, every click will make the selected callbacks be called.
         /// </summary>
         Always,
+
         /// <summary>
         /// This will turn off the ability to select the item entirely and they will neither appear selected nor call selected callback functions.
         /// </summary>
         None,
+
         /// <summary>
         /// This will apply no-finger-size rule with DisplayOnly.
         /// No-finger-size rule makes an item can be smaller than lower limit.
@@ -236,7 +239,6 @@ namespace ElmSharp
             {
                 int height = ItemHeight;
                 Interop.Elementary.elm_gengrid_item_size_set(RealHandle, value, height);
-
             }
         }
 
@@ -313,6 +315,50 @@ namespace ElmSharp
         }
 
         /// <summary>
+        /// Sets or gets the value of HorizontalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, out policy, IntPtr.Zero);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)value, (int)v);
+            }
+        }
+
+        /// <summary>
+        /// Sets or gets the value of VerticalScrollBarVisiblePolicy
+        /// </summary>
+        /// <remarks>
+        /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden.
+        /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off.
+        /// </remarks>
+        public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy
+        {
+            get
+            {
+                int policy;
+                Interop.Elementary.elm_scroller_policy_get(RealHandle, IntPtr.Zero, out policy);
+                return (ScrollBarVisiblePolicy)policy;
+            }
+            set
+            {
+                ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy;
+                Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)h, (int)value);
+            }
+        }
+
+        /// <summary>
         /// Appends a new item to a given gengrid widget. This adds an item to the end of the gengrid.
         /// </summary>
         /// <param name="itemClass">The itemClass defines how to display the data.</param>
@@ -457,4 +503,4 @@ namespace ElmSharp
             _children.Remove((GenGridItem)sender);
         }
     }
-}
+}
\ No newline at end of file