コード例 #1
0
        internal void LowerBelow(Layer target)
        {
            var parentChildren = window?.LayersChildren;

            if (parentChildren != null)
            {
                int currentIndex = parentChildren.IndexOf(this);
                int targetIndex  = parentChildren.IndexOf(target);

                if (currentIndex < 0 || targetIndex < 0 ||
                    currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
                {
                    NUILog.Error("index should be bigger than 0 and less than children of layer count");
                    return;
                }

                // If the currentIndex is not already the 0th index and the target has the same parent.
                if ((currentIndex != 0) && (targetIndex != -1) &&
                    (currentIndex > targetIndex))
                {
                    parentChildren.Remove(this);
                    parentChildren.Insert(targetIndex, this);

                    Interop.Layer.MoveBelow(SwigCPtr, Layer.getCPtr(target));
                    if (NDalicPINVOKE.SWIGPendingException.Pending)
                    {
                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                    }
                }
            }
        }
コード例 #2
0
        internal void RaiseAbove(Layer target)
        {
            var parentChildren = Window.Instance.LayersChildren;

            if (parentChildren != null)
            {
                int currentIndex = parentChildren.IndexOf(this);
                int targetIndex  = parentChildren.IndexOf(target);

                if (currentIndex < 0 || targetIndex < 0 ||
                    currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
                {
                    NUILog.Error("index should be bigger than 0 and less than children of layer count");
                    return;
                }

                // If the currentIndex is less than the target index and the target has the same parent.
                if (currentIndex < targetIndex)
                {
                    parentChildren.Remove(this);
                    parentChildren.Insert(targetIndex, this);

                    Interop.Layer.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
                    if (NDalicPINVOKE.SWIGPendingException.Pending)
                    {
                        throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                    }
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Moves the layer directly below the given layer.<br />
 /// After the call, this layer's depth will be immediately below target.<br />
 /// </summary>
 /// <param name="target">The layer to get below of.</param>
 /// <since_tizen> 3 </since_tizen>
 public void MoveBelow(Layer target)
 {
     Interop.Layer.MoveBelow(SwigCPtr, Layer.getCPtr(target));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #4
0
ファイル: Layer.cs プロジェクト: wiertel/TizenFX
 /// <summary>
 /// Moves the layer directly above the given layer.<br />
 /// After the call, this layer's depth will be immediately above target.<br />
 /// </summary>
 /// <param name="target">The layer to get on top of.</param>
 /// <since_tizen> 3 </since_tizen>
 public void MoveAbove(Layer target)
 {
     NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #5
0
ファイル: Layer.cs プロジェクト: prjung/TizenFX
 internal void LowerBelow(Layer target)
 {
     NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #6
0
ファイル: Layer.cs プロジェクト: prjung/TizenFX
 internal void RaiseAbove(Layer target)
 {
     NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #7
0
        /// <summary>
        /// Lowers the layer to the bottom.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        public void LowerToBottom()
        {
            var parentChildren = window?.LayersChildren;

            if (parentChildren != null)
            {
                parentChildren.Remove(this);
                parentChildren.Insert(0, this);

                Interop.Layer.LowerToBottom(SwigCPtr);

                if (window.IsBorderEnabled)
                {
                    Layer bottomLayer = window.GetBorderWindowBottomLayer();
                    parentChildren.Remove(bottomLayer);
                    parentChildren.Insert(0, bottomLayer);
                    Interop.Layer.LowerToBottom(Layer.getCPtr(bottomLayer));
                }
                if (NDalicPINVOKE.SWIGPendingException.Pending)
                {
                    throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                }
            }
        }
コード例 #8
0
ファイル: LayoutItem.cs プロジェクト: hyotaekshim/TizenFX
        private bool SetFrame(float left, float top, float right, float bottom, bool independent)
        {
            bool changed = false;

            if (_layoutPositionData.Left != left ||
                _layoutPositionData.Right != right ||
                _layoutPositionData.Top != top ||
                _layoutPositionData.Bottom != bottom)
            {
                changed = true;

                float oldWidth    = _layoutPositionData.Right - _layoutPositionData.Left;
                float oldHeight   = _layoutPositionData.Bottom - _layoutPositionData.Top;
                float newWidth    = right - left;
                float newHeight   = bottom - top;
                bool  sizeChanged = (newWidth != oldWidth) || (newHeight != oldHeight);

                // Set condition to layout changed as currently unspecified. Add, Remove would have specified a condition.
                if (ConditionForAnimation.Equals(TransitionCondition.Unspecified))
                {
                    ConditionForAnimation = TransitionCondition.LayoutChanged;
                }

                // Store new layout position data
                _layoutPositionData = new LayoutData(this, ConditionForAnimation, left, top, right, bottom);

                Debug.WriteLineIf(LayoutDebugFrameData, "LayoutItem FramePositionData View:" + _layoutPositionData.Item.Owner.Name +
                                  " left:" + _layoutPositionData.Left +
                                  " top:" + _layoutPositionData.Top +
                                  " right:" + _layoutPositionData.Right +
                                  " bottom:" + _layoutPositionData.Bottom);

                Container onwerContainer = Owner.GetParent();
                View      onwerView      = onwerContainer is Layer ? new View(Layer.getCPtr(onwerContainer).Handle, false) : onwerContainer as View;

                if (onwerView != null && onwerView.Layout != null && onwerView.Layout.LayoutWithTransition)
                {
                    NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(_layoutPositionData);
                }
                else
                {
                    if (Owner.Position != null)
                    {
                        if (independent)
                        {
                            // If height or width specification is not explicitly defined,
                            // the size of the owner view must be reset even the ExcludeLayouting is true.
                            if (Owner.HeightSpecification < 0 || Owner.WidthSpecification < 0)
                            {
                                Owner.SetSize(right - left, bottom - top);
                            }
                        }
                        else
                        {
                            Owner.SetSize(right - left, bottom - top);
                            Owner.SetPosition(left, top);
                        }
                    }
                }

                // Reset condition for animation ready for next transition when required.
                ConditionForAnimation = TransitionCondition.Unspecified;
            }

            return(changed);
        }
コード例 #9
0
ファイル: WindowEvent.cs プロジェクト: grzelewski/TizenFX
        private WheelSignal WheelEventSignal()
        {
            WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
コード例 #10
0
ファイル: WindowEvent.cs プロジェクト: grzelewski/TizenFX
        internal TouchDataSignal TouchDataSignal()
        {
            TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }