X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2Fmanual%2Fcsharp%2FView.cs;h=fbc408fc1ce5ee90aa5313d3c2451fac16852912;hp=1b4fbec5cae1a92a968bf7c2bbf8be0ea6cc5e2d;hb=6eaaeda7321c0c06f561687350a7494d3895290e;hpb=50a6c0040f45569ffa098042607582015fb1b137 diff --git a/plugins/dali-swig/manual/csharp/View.cs b/plugins/dali-swig/manual/csharp/View.cs index 1b4fbec..fbc408f 100644 --- a/plugins/dali-swig/manual/csharp/View.cs +++ b/plugins/dali-swig/manual/csharp/View.cs @@ -28,6 +28,9 @@ public class View : CustomActor { // Register this instance of view in the view registry. ViewRegistry.RegisterView(this); + + // By default, we do not want the position to use the anchor point + this.PositionUsesAnchorPoint = false; } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) { @@ -910,6 +913,10 @@ public class View : CustomActor { public static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get(); public static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get(); public static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get(); + public static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get(); + public static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get(); + public static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get(); + public static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); public Property() : this(NDalicPINVOKE.new_View_Property(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -992,6 +999,23 @@ public class View : CustomActor { return (T)( ViewRegistry.GetViewFromActor( actor ) ); } + private View ConvertIdToView(uint id) + { + Actor actor = null; + + if (Parent) + { + actor = Parent.FindChildById(id); + } + + if (!actor) + { + actor = Stage.Instance.GetRootLayer().FindChildById(id); + } + + return View.DownCast(actor); + } + public void SetKeyInputFocus() { NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1228,6 +1252,62 @@ public class View : CustomActor { } } + private int LeftFocusableActorId + { + get + { + int temp = 0; + GetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get( ref temp ); + return temp; + } + set + { + SetProperty( View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) ); + } + } + + private int RightFocusableActorId + { + get + { + int temp = 0; + GetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get( ref temp ); + return temp; + } + set + { + SetProperty( View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) ); + } + } + + private int UpFocusableActorId + { + get + { + int temp = 0; + GetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID).Get( ref temp ); + return temp; + } + set + { + SetProperty( View.Property.UP_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) ); + } + } + + private int DownFocusableActorId + { + get + { + int temp = 0; + GetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get( ref temp ); + return temp; + } + set + { + SetProperty( View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Dali.Property.Value( value ) ); + } + } + public float Flex { get @@ -1339,6 +1419,98 @@ public class View : CustomActor { SetProperty( TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Dali.Property.Value( value ) ); } } + + /** + * @brief The left focusable view. + * @note This will return NULL if not set. + * This will also return NULL if the specified left focusable view is not on stage. + * + */ + public View LeftFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + if (LeftFocusableActorId >= 0) + { + return ConvertIdToView((uint)LeftFocusableActorId); + } + return null; + } + set + { + LeftFocusableActorId = (int)value.GetId(); + } + } + + /** + * @brief The right focusable view. + * @note This will return NULL if not set. + * This will also return NULL if the specified right focusable view is not on stage. + * + */ + public View RightFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + if (RightFocusableActorId >= 0) + { + return ConvertIdToView((uint)RightFocusableActorId); + } + return null; + } + set + { + RightFocusableActorId = (int)value.GetId(); + } + } + + /** + * @brief The up focusable view. + * @note This will return NULL if not set. + * This will also return NULL if the specified up focusable view is not on stage. + * + */ + public View UpFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + if (UpFocusableActorId >= 0) + { + return ConvertIdToView((uint)UpFocusableActorId); + } + return null; + } + set + { + UpFocusableActorId = (int)value.GetId(); + } + } + + /** + * @brief The down focusable view. + * @note This will return NULL if not set. + * This will also return NULL if the specified down focusable view is not on stage. + * + */ + public View DownFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + if (DownFocusableActorId >= 0) + { + return ConvertIdToView((uint)DownFocusableActorId); + } + return null; + } + set + { + DownFocusableActorId = (int)value.GetId(); + } + } } }