From 0f5a8aaa14ccf06aee1069ef585d83b8506dd099 Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 9 May 2017 18:26:48 +0100 Subject: [PATCH] Added scrollMode property to ScrollView to simplify Rulers The rulers are hard to use and understand, and require overriding classes in the public API. This makes binding to C# require too much effort, and pulls too many classes into C# that otherwise don't need to be there. Have instead added a devel property to enable the simplification of setting up rulers - the new property map will be used internally to create either DefaultRuler or FixedRuler, depending on the settings. This makes it very easy to bind to C#. Change-Id: I5932cd32487bae77b8c41ebd35e35f6bc879be33 --- .../src/dali-toolkit/utc-Dali-ScrollView.cpp | 272 ++++++++++++++++-- build/tizen/dali-toolkit/Makefile.am | 2 + .../scrollable/scroll-view/scroll-mode.h | 84 ++++++ .../scroll-view/scroll-view-devel.h | 72 +++++ dali-toolkit/devel-api/file.list | 4 + .../scroll-view/scroll-view-impl.cpp | 96 +++++++ .../scrollable/scroll-view/scroll-view-impl.h | 7 + .../dali-sharp/dali-bindings/dali_wrap.cpp | 10 + plugins/dali-sharp/examples/scroll-view.cs | 12 +- .../sharp/internal/DaliEnumConstants.cs | 10 + .../sharp/internal/NDalicPINVOKE.cs | 13 +- .../dali-sharp/sharp/internal/ScrollView.cs | 92 +++--- 12 files changed, 595 insertions(+), 79 deletions(-) create mode 100644 dali-toolkit/devel-api/controls/scrollable/scroll-view/scroll-mode.h create mode 100644 dali-toolkit/devel-api/controls/scrollable/scroll-view/scroll-view-devel.h diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index 1a88abb58a..55a9ff6a30 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include using namespace Dali; using namespace Toolkit; @@ -277,6 +279,37 @@ float TestAlphaFunction(float progress) return std::min( progress * 2.0f, 1.0f ); } +static Vector2 PerformGestureDiagonalSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames, bool finish = true) +{ + gOnScrollStartCalled = false; + gOnScrollUpdateCalled = false; + gOnScrollCompleteCalled = false; + gOnSnapStartCalled = false; + + // Now do a pan starting from (start) and heading (direction) + Vector2 pos(start); + SendPan(application, Gesture::Possible, pos); + SendPan(application, Gesture::Started, pos); + Wait(application); + + for(int i = 0;i + +namespace Dali +{ + +namespace Toolkit +{ + +namespace DevelScrollView +{ + +namespace Property +{ + +enum +{ + // Event side properties + + WRAP_ENABLED = Dali::Toolkit::ScrollView::Property::WRAP_ENABLED, + PANNING_ENABLED = Dali::Toolkit::ScrollView::Property::PANNING_ENABLED, + AXIS_AUTO_LOCK_ENABLED = Dali::Toolkit::ScrollView::Property::AXIS_AUTO_LOCK_ENABLED, + WHEEL_SCROLL_DISTANCE_STEP = Dali::Toolkit::ScrollView::Property::WHEEL_SCROLL_DISTANCE_STEP, + + /** + * @brief The scroll mode + * @details Name "scrollMode", type Property::MAP + * The scroll mode map is a frontend for the Ruler helper class, containing the following keys: + * + * | %Property Name | Type | Required | Description | + * |----------------------|----------|----------|---------------------------------------------------------------------------------------------------------------------------------------| + * | xAxisScrollEnabled | BOOLEAN | No | True if the content can be scrolled in X axis or false if not. | + * | xAxisSnapToInterval | FLOAT | No | When set, causes scroll view to snap to multiples of the value of the interval in the X axis while flicking. (by default no snapping) | + * | xAxisScrollBoundary | FLOAT | No | When set, causes scroll view unable to scroll beyond the value of the boundary in the X axis (by default no boundary) | + * | yAxisScrollEnabled | BOOLEAN | No | True if the content can be scrolled in Y axis or false if not. | + * | yAxisSnapToInterval | FLOAT | No | When set, causes scroll view to snap to multiples of the value of the interval in the Y axis while flicking. (by default no snapping) | + * | yAxisScrollBoundary | FLOAT | No | When set, causes scroll view unable to scroll beyond the value of the boundary in the Y axis (by default no boundary) | + * + * Alternatively, one can use the keys defined in the Dali::Toolkit::ScrollMode::Type enumeration. + */ + SCROLL_MODE = WHEEL_SCROLL_DISTANCE_STEP + 1, +}; + +} // namespace Property + +} // namespace DevelScrollView + +} // namespace Toolkit + +} // namespace Dali + +#endif // DALI_TOOLKIT_SCROLL_VIEW_DEVEL_H diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list index fca2972192..fa85816200 100644 --- a/dali-toolkit/devel-api/file.list +++ b/dali-toolkit/devel-api/file.list @@ -118,6 +118,10 @@ devel_api_scripting_header_files = \ $(devel_api_src_dir)/scripting/script.h \ $(devel_api_src_dir)/scripting/script-plugin.h +devel_api_scroll_view_header_files = \ + $(devel_api_src_dir)/controls/scrollable/scroll-view/scroll-mode.h \ + $(devel_api_src_dir)/controls/scrollable/scroll-view/scroll-view-devel.h + devel_api_shader_effects_header_files = \ $(devel_api_src_dir)/shader-effects/alpha-discard-effect.h \ $(devel_api_src_dir)/shader-effects/dissolve-effect.h \ diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 9c05d79751..9784415483 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -28,12 +28,15 @@ #include #include #include +#include #include // INTERNAL INCLUDES #include #include #include +#include +#include #include #include @@ -250,6 +253,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, ScrollView, "wrapEnabled", B DALI_PROPERTY_REGISTRATION( Toolkit, ScrollView, "panningEnabled", BOOLEAN, PANNING_ENABLED ) DALI_PROPERTY_REGISTRATION( Toolkit, ScrollView, "axisAutoLockEnabled", BOOLEAN, AXIS_AUTO_LOCK_ENABLED ) DALI_PROPERTY_REGISTRATION( Toolkit, ScrollView, "wheelScrollDistanceStep", VECTOR2, WHEEL_SCROLL_DISTANCE_STEP ) +DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrollMode", MAP, SCROLL_MODE ) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrollPosition", VECTOR2, SCROLL_POSITION) DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrollPrePosition", VECTOR2, SCROLL_PRE_POSITION) @@ -2906,6 +2910,14 @@ void ScrollView::SetProperty( BaseObject* object, Property::Index index, const P scrollViewImpl.SetWheelScrollDistanceStep( value.Get() ); break; } + case Toolkit::DevelScrollView::Property::SCROLL_MODE: + { + Property::Map* map = value.GetMap(); + if( map ) + { + scrollViewImpl.SetScrollMode( *map ); + } + } } } } @@ -2947,6 +2959,90 @@ Property::Value ScrollView::GetProperty( BaseObject* object, Property::Index ind return value; } +void ScrollView::SetScrollMode( const Property::Map& scrollModeMap ) +{ + Toolkit::RulerPtr rulerX, rulerY; + + // Check the scroll mode in the X axis + bool xAxisScrollEnabled = true; + Property::Value* valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::X_AXIS_SCROLL_ENABLED, "xAxisScrollEnabled" ); + if( valuePtr && valuePtr->GetType() == Property::BOOLEAN ) + { + valuePtr->Get( xAxisScrollEnabled ); + } + + if( !xAxisScrollEnabled ) + { + // Default ruler and disabled + rulerX = new Toolkit::DefaultRuler(); + rulerX->Disable(); + } + else + { + valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::X_AXIS_SNAP_TO_INTERVAL, "xAxisSnapToInterval" ); + float xAxisSnapToInterval = 0.0f; + if( valuePtr && valuePtr->Get( xAxisSnapToInterval ) ) + { + // Fixed ruler and enabled + rulerX = new Toolkit::FixedRuler( xAxisSnapToInterval ); + } + else + { + // Default ruler and enabled + rulerX = new Toolkit::DefaultRuler(); + } + + valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::X_AXIS_SCROLL_BOUNDARY, "xAxisScrollBoundary" ); + float xAxisScrollBoundary = 0.0f; + if( valuePtr && valuePtr->Get( xAxisScrollBoundary ) ) + { + // By default ruler domain is disabled unless set + rulerX->SetDomain( Toolkit::RulerDomain( 0, xAxisScrollBoundary, true ) ); + } + } + + // Check the scroll mode in the Y axis + bool yAxisScrollEnabled = true; + valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::Y_AXIS_SCROLL_ENABLED, "yAxisScrollEnabled" ); + if( valuePtr && valuePtr->GetType() == Property::BOOLEAN ) + { + valuePtr->Get( yAxisScrollEnabled ); + } + + if( !yAxisScrollEnabled ) + { + // Default ruler and disabled + rulerY = new Toolkit::DefaultRuler(); + rulerY->Disable(); + } + else + { + valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, "yAxisSnapToInterval" ); + float yAxisSnapToInterval = 0.0f; + if( valuePtr && valuePtr->Get( yAxisSnapToInterval ) ) + { + // Fixed ruler and enabled + rulerY = new Toolkit::FixedRuler(yAxisSnapToInterval); + } + else + { + // Default ruler and enabled + rulerY = new Toolkit::DefaultRuler(); + } + + valuePtr = scrollModeMap.Find( Toolkit::ScrollMode::Y_AXIS_SCROLL_BOUNDARY, "yAxisScrollBoundary" ); + float yAxisScrollBoundary = 0.0f; + if( valuePtr && valuePtr->Get( yAxisScrollBoundary ) ) + { + // By default ruler domain is disabled unless set + rulerY->SetDomain( Toolkit::RulerDomain( 0, yAxisScrollBoundary, true ) ); + } + } + + SetRulerX(rulerX); + SetRulerY(rulerY); +} + } // namespace Internal } // namespace Toolkit diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h index 485d5087c5..ab5f862f67 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h @@ -859,6 +859,13 @@ private: */ void OnScrollUpdateNotification(Dali::PropertyNotification& source); + /** + * Set up default rulers using a property map + * @param[in] scrollModeMap A map defining the characteristics of X and Y scrolling + * using either FixedRuler or DefaultRuler. + */ + void SetScrollMode( const Property::Map& scrollModeMap ); + private: // Undefined diff --git a/plugins/dali-sharp/dali-bindings/dali_wrap.cpp b/plugins/dali-sharp/dali-bindings/dali_wrap.cpp index 5ec44c6fcb..cfe74dc070 100644 --- a/plugins/dali-sharp/dali-bindings/dali_wrap.cpp +++ b/plugins/dali-sharp/dali-bindings/dali_wrap.cpp @@ -453,6 +453,7 @@ SWIGINTERN void SWIG_CSharpException(int code, const char *msg) { #include #include #include +#include #include #include @@ -72853,6 +72854,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_Dali_ScrollView_Property_WHEEL_SCROLL_DISTANCE } +SWIGEXPORT int SWIGSTDCALL CSharp_Dali_ScrollView_Property_SCROLL_MODE_get() { + int jresult ; + int result; + + result = (int)Dali::Toolkit::DevelScrollView::Property::SCROLL_MODE; + jresult = (int)result; + return jresult; +} + SWIGEXPORT int SWIGSTDCALL CSharp_Dali_ScrollView_Property_SCROLL_POSITION_get() { int jresult ; int result; diff --git a/plugins/dali-sharp/examples/scroll-view.cs b/plugins/dali-sharp/examples/scroll-view.cs index 3199857b53..af93924182 100755 --- a/plugins/dali-sharp/examples/scroll-view.cs +++ b/plugins/dali-sharp/examples/scroll-view.cs @@ -95,12 +95,12 @@ namespace MyCSharpExample // Set scroll view to have 3 pages in X axis and allow page snapping, // and also disable scrolling in Y axis. - RulerPtr scrollRulerX = new RulerPtr(new FixedRuler(windowSize.Width)); - RulerPtr scrollRulerY = new RulerPtr(new DefaultRuler()); - scrollRulerX.SetDomain(new RulerDomain(0.0f, windowSize.Width * pageColumns, true)); - scrollRulerY.Disable(); - _scrollView.SetRulerX(scrollRulerX); - _scrollView.SetRulerY(scrollRulerY); + Property.Map rulerMap = new Property.Map(); + rulerMap.Add((int)Dali.Constants.ScrollModeType.XAxisScrollEnabled, new Property.Value(true)); + rulerMap.Add((int)Dali.Constants.ScrollModeType.XAxisSnapToInterval, new Property.Value(windowSize.Width)); + rulerMap.Add((int)Dali.Constants.ScrollModeType.XAxisScrollBoundary, new Property.Value(windowSize.Width * pageColumns ) ); + rulerMap.Add((int)Dali.Constants.ScrollModeType.YAxisScrollEnabled, new Property.Value( false ) ); + _scrollView.ScrollMode = rulerMap; // Create a horizontal scroll bar in the bottom of scroll view (which is optional) _scrollBar = new ScrollBar(); diff --git a/plugins/dali-sharp/sharp/internal/DaliEnumConstants.cs b/plugins/dali-sharp/sharp/internal/DaliEnumConstants.cs index cf7958b758..305e7bfc23 100755 --- a/plugins/dali-sharp/sharp/internal/DaliEnumConstants.cs +++ b/plugins/dali-sharp/sharp/internal/DaliEnumConstants.cs @@ -19,6 +19,16 @@ namespace Dali { namespace Constants { + public enum ScrollModeType + { + XAxisScrollEnabled, + XAxisSnapToInterval, + XAxisScrollBoundary, + YAxisScrollEnabled, + YAxisSnapToInterval, + YAxisScrollBoundary + } + public enum TextureType { Texture2D = Dali.TextureType.TEXTURE_2D, ///< One 2D image @SINCE_1_1.43 diff --git a/plugins/dali-sharp/sharp/internal/NDalicPINVOKE.cs b/plugins/dali-sharp/sharp/internal/NDalicPINVOKE.cs index 0fd09c4d6a..08a7dfd503 100644 --- a/plugins/dali-sharp/sharp/internal/NDalicPINVOKE.cs +++ b/plugins/dali-sharp/sharp/internal/NDalicPINVOKE.cs @@ -37,14 +37,14 @@ class NDalicPINVOKE { public static extern void SWIGRegisterExceptionCallbacks_NDalic( ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, - ExceptionDelegate divideByZeroDelegate, - ExceptionDelegate indexOutOfRangeDelegate, + ExceptionDelegate divideByZeroDelegate, + ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, - ExceptionDelegate outOfMemoryDelegate, - ExceptionDelegate overflowDelegate, + ExceptionDelegate outOfMemoryDelegate, + ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate); [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_NDalic")] @@ -136,7 +136,7 @@ class NDalicPINVOKE { if (pendingException != null) pending = true; return pending; - } + } } public static void Set(global::System.Exception e) { @@ -8318,6 +8318,9 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_ScrollView_Property_WHEEL_SCROLL_DISTANCE_STEP_get")] public static extern int ScrollView_Property_WHEEL_SCROLL_DISTANCE_STEP_get(); + [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_ScrollView_Property_SCROLL_MODE_get")] + public static extern int ScrollView_Property_SCROLL_MODE_get(); + [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_ScrollView_Property_SCROLL_POSITION_get")] public static extern int ScrollView_Property_SCROLL_POSITION_get(); diff --git a/plugins/dali-sharp/sharp/internal/ScrollView.cs b/plugins/dali-sharp/sharp/internal/ScrollView.cs index 3ccaaa234f..b67bbb25ee 100644 --- a/plugins/dali-sharp/sharp/internal/ScrollView.cs +++ b/plugins/dali-sharp/sharp/internal/ScrollView.cs @@ -153,20 +153,20 @@ public class SnapStartedEventArgs : EventArgs public class ClampEvent : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - + internal ClampEvent(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ClampEvent obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - + ~ClampEvent() { Dispose(); } - + public virtual void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { @@ -179,68 +179,68 @@ public class SnapStartedEventArgs : EventArgs global::System.GC.SuppressFinalize(this); } } - + public ClampState2D scale { set { NDalicPINVOKE.ScrollView_ClampEvent_scale_set(swigCPtr, ClampState2D.getCPtr(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { global::System.IntPtr cPtr = NDalicPINVOKE.ScrollView_ClampEvent_scale_get(swigCPtr); ClampState2D ret = (cPtr == global::System.IntPtr.Zero) ? null : new ClampState2D(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public ClampState2D position { set { NDalicPINVOKE.ScrollView_ClampEvent_position_set(swigCPtr, ClampState2D.getCPtr(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { global::System.IntPtr cPtr = NDalicPINVOKE.ScrollView_ClampEvent_position_get(swigCPtr); ClampState2D ret = (cPtr == global::System.IntPtr.Zero) ? null : new ClampState2D(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public ClampState rotation { set { NDalicPINVOKE.ScrollView_ClampEvent_rotation_set(swigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { ClampState ret = (ClampState)NDalicPINVOKE.ScrollView_ClampEvent_rotation_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public ClampEvent() : this(NDalicPINVOKE.new_ScrollView_ClampEvent(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - + } public class SnapEvent : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - + internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - + ~SnapEvent() { Dispose(); } - + public virtual void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { @@ -253,73 +253,73 @@ public class SnapStartedEventArgs : EventArgs global::System.GC.SuppressFinalize(this); } } - + public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) { SnapEvent ret = new SnapEvent(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - + public SnapType type { set { NDalicPINVOKE.ScrollView_SnapEvent_type_set(swigCPtr, (int)value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { SnapType ret = (SnapType)NDalicPINVOKE.ScrollView_SnapEvent_type_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public Vector2 position { set { NDalicPINVOKE.ScrollView_SnapEvent_position_set(swigCPtr, Vector2.getCPtr(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { global::System.IntPtr cPtr = NDalicPINVOKE.ScrollView_SnapEvent_position_get(swigCPtr); Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public float duration { set { NDalicPINVOKE.ScrollView_SnapEvent_duration_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + } get { float ret = NDalicPINVOKE.ScrollView_SnapEvent_duration_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + } } - + public SnapEvent() : this(NDalicPINVOKE.new_ScrollView_SnapEvent(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - + } public class Property : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - + internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - + ~Property() { Dispose(); } - + public virtual void Dispose() { lock(this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { @@ -332,15 +332,17 @@ public class SnapStartedEventArgs : EventArgs global::System.GC.SuppressFinalize(this); } } - + public Property() : this(NDalicPINVOKE.new_ScrollView_Property(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - + public static readonly int WRAP_ENABLED = NDalicPINVOKE.ScrollView_Property_WRAP_ENABLED_get(); public static readonly int PANNING_ENABLED = NDalicPINVOKE.ScrollView_Property_PANNING_ENABLED_get(); public static readonly int AXIS_AUTO_LOCK_ENABLED = NDalicPINVOKE.ScrollView_Property_AXIS_AUTO_LOCK_ENABLED_get(); public static readonly int WHEEL_SCROLL_DISTANCE_STEP = NDalicPINVOKE.ScrollView_Property_WHEEL_SCROLL_DISTANCE_STEP_get(); + public static readonly int SCROLL_MODE = NDalicPINVOKE.ScrollView_Property_SCROLL_MODE_get(); + public static readonly int SCROLL_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_get(); public static readonly int SCROLL_PRE_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_get(); public static readonly int SCROLL_PRE_POSITION_X = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_X_get(); @@ -362,7 +364,7 @@ public class SnapStartedEventArgs : EventArgs public static readonly int SCROLL_DOMAIN_OFFSET = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_OFFSET_get(); public static readonly int SCROLL_POSITION_DELTA = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_DELTA_get(); public static readonly int START_PAGE_POSITION = NDalicPINVOKE.ScrollView_Property_START_PAGE_POSITION_get(); - + } public ScrollView () : this (NDalicPINVOKE.ScrollView_New(), true) { @@ -921,6 +923,20 @@ public class SnapStartedEventArgs : EventArgs } } + public Dali.Property.Map ScrollMode + { + get + { + Dali.Property.Value value = GetProperty( ScrollView.Property.SCROLL_MODE ); + Dali.Property.Map map = new Dali.Property.Map(); + value.Get( map ); + return map; + } + set + { + SetProperty( ScrollView.Property.SCROLL_MODE, new Dali.Property.Value( value ) ); + } + } } } -- 2.34.1