Exemplo n.º 1
0
 public Mouse2DEventArgs(RoutedEvent routedEvent, object source, HitTest2DResult hitTestResult, System.Windows.Point position, Viewport3DX viewport = null, InputEventArgs inputArgs = null)
     : base(routedEvent, source)
 {
     this.HitTest2DResult = hitTestResult;
     this.Position        = position;
     this.Viewport        = viewport;
     InputArgs            = inputArgs;
 }
Exemplo n.º 2
0
            //protected override void OnRender(RenderContext2D context)
            //{
            //    base.OnRender(context);
            //    if (content != null)
            //    {
            //        content.Render(context);
            //    }
            //}

            protected override bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult)
            {
                if (content != null)
                {
                    return(content.HitTest(mousePoint, out hitResult));
                }
                else
                {
                    hitResult = null;
                    return(false);
                }
            }
Exemplo n.º 3
0
 protected override bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     if (Content != null && LayoutBoundWithTransform.Contains(mousePoint))
     {
         return(Content.HitTest(mousePoint, out hitResult));
     }
     else
     {
         hitResult = null;
         return(false);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Hits the test.
 /// </summary>
 /// <param name="mousePoint">The mouse point.</param>
 /// <param name="hitResult">The hit result.</param>
 /// <returns></returns>
 public bool HitTest(Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     if (CanHitTest())
     {
         return(OnHitTest(ref mousePoint, out hitResult));
     }
     else
     {
         hitResult = null;
         return(false);
     }
 }
Exemplo n.º 5
0
 protected override bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     hitResult = null;
     if (LayoutBoundWithTransform.Contains(mousePoint))
     {
         hitResult = new HitTest2DResult(this);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 6
0
 protected override bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     hitResult = null;
     if (LayoutBoundWithTransform.Contains(mousePoint))
     {
         foreach (var item in Items.Reverse())
         {
             if (item.HitTest(mousePoint, out hitResult))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 7
0
            /// <summary>
            /// Hits the test.
            /// </summary>
            /// <param name="mousePoint">The mouse point.</param>
            /// <param name="hitResult">The hit result.</param>
            /// <returns></returns>
            public bool HitTest(Vector2 mousePoint, out HitTest2DResult hitResult)
            {
                if (Parent == null)
                {
                    mousePoint *= DpiScale;
                }

                if (CanHitTest())
                {
                    return(OnHitTest(ref mousePoint, out hitResult));
                }
                else
                {
                    hitResult = null;
                    return(false);
                }
            }
Exemplo n.º 8
0
 /// <summary>
 /// Called when [hit test].
 /// </summary>
 /// <param name="mousePoint">The mouse point.</param>
 /// <param name="hitResult">The hit result.</param>
 /// <returns></returns>
 protected override bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     hitResult = null;
     if (!EnableMover)
     {
         return(false);
     }
     if (LayoutBoundWithTransform.Contains(mousePoint))
     {
         foreach (var b in Buttons)
         {
             b.Visibility = System.Windows.Visibility.Visible;
         }
         return(base.OnHitTest(ref mousePoint, out hitResult));
     }
     else
     {
         foreach (var b in Buttons)
         {
             b.Visibility = System.Windows.Visibility.Hidden;
         }
         return(false);
     }
 }
Exemplo n.º 9
0
 protected override bool OnHitTest(ref global::SharpDX.Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     hitResult = null;
     return(false);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Called when [hit test].
 /// </summary>
 /// <param name="mousePoint">The mouse point.</param>
 /// <param name="hitResult">The hit result.</param>
 /// <returns></returns>
 protected abstract bool OnHitTest(ref Vector2 mousePoint, out HitTest2DResult hitResult);
Exemplo n.º 11
0
 public virtual bool HitTest(Vector2 mousePoint, out HitTest2DResult hitResult)
 {
     return(SceneNode.HitTest(mousePoint, out hitResult));
 }