From 690dd19500ac07354cb68c8f1d947f32ca34907e Mon Sep 17 00:00:00 2001 From: "pius.lee" Date: Thu, 12 Oct 2017 22:23:15 +0900 Subject: [PATCH] [ElmSharp] Add Scroller Policy and Bounce to Entry Change-Id: I4ea410ca2947331192e2ea1809120252e1a4181b --- src/ElmSharp/ElmSharp/Entry.cs | 88 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/ElmSharp/ElmSharp/Entry.cs b/src/ElmSharp/ElmSharp/Entry.cs index 65777ef..92f57b5 100755 --- a/src/ElmSharp/ElmSharp/Entry.cs +++ b/src/ElmSharp/ElmSharp/Entry.cs @@ -788,6 +788,94 @@ namespace ElmSharp } /// + /// Sets or gets the value of HorizontalScrollBarVisiblePolicy + /// + /// + /// 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. + /// + public virtual 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); + } + } + + /// + /// Sets or gets the value of VerticalScrollBarVisiblePolicy + /// + /// + /// 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. + /// + public virtual 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); + } + } + + /// + /// Sets or gets the vertical bounce behaviour. + /// When scrolling, the scroller may "bounce" when reaching an edge of the content object. + /// This is a visual way to indicate the end has been reached. + /// This is enabled by default for both axis. + /// This API will set if it is enabled for the given axis with the boolean parameters for each axis. + /// + public bool VerticalBounce + { + get + { + bool v, h; + Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v); + return v; + } + set + { + bool h = HorizontalBounce; + Interop.Elementary.elm_scroller_bounce_set(RealHandle, h, value); + } + } + + /// + /// Sets or gets the horizontal bounce behaviour. + /// When scrolling, the scroller may "bounce" when reaching an edge of the content object. + /// This is a visual way to indicate the end has been reached. + /// This is enabled by default for both axis. + /// This API will set if it is enabled for the given axis with the boolean parameters for each axis. + /// + public bool HorizontalBounce + { + get + { + bool v, h; + Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v); + return h; + } + set + { + bool v = VerticalBounce; + Interop.Elementary.elm_scroller_bounce_set(RealHandle, value, v); + } + } + + /// /// Inserts the given text into the entry at the current cursor position. /// /// -- 2.7.4