X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FElmSharp.Wearable%2FElmSharp.Wearable%2FCircleSpinner.cs;h=295b2d30113cd0251a9bdfffe14605f85fd4d79d;hb=58283d6a09a7f531af61ae7b27b574603ef244df;hp=e66fa54dbd314b1daaf44a90a9cbc9592c5c9957;hpb=d35f817838598944501d697798af3aa47c919349;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs old mode 100644 new mode 100755 index e66fa54..295b2d3 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs +++ b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs @@ -15,26 +15,31 @@ */ using System; +using System.ComponentModel; using System.Diagnostics; namespace ElmSharp.Wearable { /// - /// The Circle Spinner is a widget to display and handle spinner value by rotary event + /// The Circle Spinner is a widget to display and handle the spinner value by the Rotary event. /// Inherits . /// + /// preview + [Obsolete("This has been deprecated in API12")] public class CircleSpinner : Spinner, IRotaryActionWidget { IntPtr _circleHandle; - double _angleRatio = 1.0; + double _angleRatio = -1.0; CircleSurface _surface; /// /// Creates and initializes a new instance of the Circle Spinner class. /// - /// The parent of new Circle Spinner instance + /// The parent of the new Circle Spinner instance. /// The surface for drawing circle features for this widget. + /// preview + [Obsolete("This has been deprecated in API12")] public CircleSpinner(EvasObject parent, CircleSurface surface) : base() { Debug.Assert(parent == null || surface == null || parent.IsRealized); @@ -43,34 +48,85 @@ namespace ElmSharp.Wearable } /// - /// Gets the handle for Circle Widget. + /// Creates and initializes a new instance of the Circle Spinner class. /// - public virtual IntPtr CircleHandle => RealHandle; + /// The parent of the new Circle Spinner instance. + /// preview + [Obsolete("It is not safe for guess circle surface from parent and create new surface by every new widget")] + [EditorBrowsable(EditorBrowsableState.Never)] + public CircleSpinner(EvasObject parent) : this(parent, CircleSurface.CreateCircleSurface(parent)) + { + ((IRotaryActionWidget)this).Activate(); + } /// - /// Gets the handle for Circle Surface used in this widget + /// Gets the handle for Circle widget. /// + /// preview + [Obsolete("This has been deprecated in API12")] + public virtual IntPtr CircleHandle => _circleHandle; + + /// + /// Gets the handle for the circle surface used in this widget. + /// + /// preview + [Obsolete("This has been deprecated in API12")] public virtual CircleSurface CircleSurface => _surface; /// /// Sets or gets the circle spinner angle per each spinner value. /// + /// preview + [Obsolete("Use Step")] + [EditorBrowsable(EditorBrowsableState.Never)] public double AngleRatio { get { + if (_angleRatio <= 0) + { + if (Maximum == Minimum) + { + return 0.0; + } + else + { + return 360 / (Maximum - Minimum); + } + } + return _angleRatio; } set { - _angleRatio = value; - Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio); + if (value > 0) + { + if (_angleRatio == value) return; + + _angleRatio = value; + + Interop.Eext.eext_circle_object_spinner_angle_set(CircleHandle, _angleRatio); + } } } /// + /// Sets or gets the disabled state of this widget. + /// + /// preview + [Obsolete("Use IsEnabled")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Disabled + { + get => !IsEnabled; + set => IsEnabled = !value; + } + + /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// + /// preview + [Obsolete("This has been deprecated in API12")] public override bool IsEnabled { get @@ -84,8 +140,13 @@ namespace ElmSharp.Wearable } /// - /// Sets or gets the line width of the marker + /// Sets or gets the line width of the marker. /// + /// + /// MarkerLineWidth is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner. + /// + /// preview + [Obsolete("MarkerLineWidth is obsolete as of version 6.0.0 and is no longer supported")] public int MarkerLineWidth { get @@ -99,8 +160,13 @@ namespace ElmSharp.Wearable } /// - /// Sets or gets the color of the marker + /// Sets or gets the color of the marker. /// + /// + /// MarkerColor is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner. + /// + /// preview + [Obsolete("MarkerColor is obsolete as of version 6.0.0 and is no longer supported")] public Color MarkerColor { get @@ -116,8 +182,13 @@ namespace ElmSharp.Wearable } /// - /// Sets or gets the radius at which the center of the marker lies + /// Sets or gets the radius at which the center of the marker lies. /// + /// + /// MarkerRadius is not supported on device or emulator which does not support marker in CircleDatetimeSelector and CircleSpinner. + /// + /// preview + [Obsolete("MarkerRadius is obsolete as of version 6.0.0 and is no longer supported")] public double MarkerRadius { get @@ -133,12 +204,14 @@ namespace ElmSharp.Wearable /// /// Creates a widget handle. /// - /// Parent EvasObject - /// Handle IntPtr + /// Parent EvasObject. + /// Handle IntPtr. + /// preview + [Obsolete("This has been deprecated in API12")] protected override IntPtr CreateHandle(EvasObject parent) { IntPtr handle = base.CreateHandle(parent); - _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? Handle : RealHandle, CircleSurface.Handle); + _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle == IntPtr.Zero ? handle : RealHandle, CircleSurface.Handle); return handle; } }