コード例 #1
0
 internal override void ListenMouseUp(object sender, UIMouseUpEventArgs e)
 {
     if (_ownerBeh.HasMouseUp)
     {
         _ownerBeh.InvokeMouseUp((S)sender, _state, e);
     }
 }
コード例 #2
0
        void IEventPortal.PortalMouseUp(UIMouseUpEventArgs e)
        {
            //find hit svg graphics....
            VgHitChain hitChain = GetFreeHitChain();

            hitChain.SetRootGlobalPosition(e.X, e.Y);
            //1. hit test
            HitTestCore(this.SvgRoot.SvgDoc.Root, hitChain, e.X, e.Y);
            SetEventOrigin(e, hitChain);
            //2. propagate event  portal
            ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) =>
            {
                portal.PortalMouseUp(e);
                return(true);
            });
            if (!e.CancelBubbling)
            {
                //2. propagate events
                ForEachEventListenerBubbleUp(e, hitChain, () =>
                {
                    e.CurrentContextElement.ListenMouseUp(e);
                    return(true);
                });
            }

            e.CancelBubbling = true;
            ReleaseHitChain(hitChain);
        }
コード例 #3
0
        void IEventPortal.PortalMouseUp(UIMouseUpEventArgs e)
        {
            ////find hit svg graphics....
            //VgHitChain hitChain = GetFreeHitChain();
            //hitChain.SetRootGlobalPosition(e.X, e.Y);
            ////1. hit test
            //HitTestCore(this.SvgRoot.SvgDoc.Root, hitChain, e.X, e.Y);
            //SetEventOrigin(e, hitChain);
            ////2. propagate event  portal
            //ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) =>
            //{
            //    portal.PortalMouseUp(e);
            //    return true;
            //});
            //if (!e.CancelBubbling)
            //{
            //    //2. propagate events
            //    ForEachEventListenerBubbleUp(e, hitChain, () =>
            //    {
            //        e.CurrentContextElement.ListenMouseUp(e);
            //        return true;
            //    });
            //}

            //e.CancelBubbling = true;
            //ReleaseHitChain(hitChain);
        }
コード例 #4
0
        public virtual void HandleDragEnd(UIMouseUpEventArgs e)
        {
            _isDragBegin = false;

            _editSession.StartSelectIfNoSelection();
            _editSession.SetCaretPos(e.X, e.Y);
            _editSession.EndSelect();
            //this.InvalidateGraphics();
            InvalidateGraphicOfCurrentSelectionArea();
        }
コード例 #5
0
        public TopWindowEventRoot(RootGraphic rootgfx, TopWindowRenderBox topRenderElement)
        {
            _mouseDownEventArgs = new UIMouseDownEventArgs();
            _mouseMoveEventArgs = new UIMouseMoveEventArgs();
            _mouseUpEventArgs   = new UIMouseUpEventArgs();
            _wheelEventArgs     = new UIMouseWheelEventArgs();


            _topWinBoxEventPortal = new RenderElementEventPortal(topRenderElement);
#if DEBUG
            _topWinBoxEventPortal.dbugRootGraphics = (MyRootGraphic)rootgfx;
#endif
            _iTopBoxEventPortal = _topWinBoxEventPortal;
            _rootgfx            = rootgfx;

            _hoverMonitoringTask          = new UIHoverMonitorTask();
            _hoverMonitoringTask.Interval = 100;//ms
            _hoverMonitoringTask.Enabled  = true;
            UIPlatform.RegisterTimerTask(_hoverMonitoringTask);
        }
コード例 #6
0
        void IEventPortal.PortalMouseUp(UIMouseUpEventArgs e)
        {
#if DEBUG
            if (this.dbugRootGraphics != null && this.dbugRootGraphics.dbugEnableGraphicInvalidateTrace)
            {
                this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================");
                this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("MOUSEUP");
                this.dbugRootGraphics.dbugGraphicInvalidateTracer.WriteInfo("================");
            }
#endif

            HitChain hitPointChain = GetFreeHitChain();
#if DEBUG
            _dbugHitChainPhase = dbugHitChainPhase.MouseUp;
#endif

            _mousePressMonitor.Reset();
            HitTestCoreWithPrevChainHint(hitPointChain, _previousChain, e.X, e.Y);

            if (hitPointChain.Count > 0)
            {
                SetEventOrigin(e, hitPointChain);
                //---------------------------------------------------------------
                ForEachOnlyEventPortalBubbleUp(e, hitPointChain, (e1, portal) =>
                {
                    //please ensure=> no local var/pararmeter capture inside lambda
                    portal.PortalMouseUp(e1);
                    return(true);
                });
                //---------------------------------------------------------------
                if (!e.CancelBubbling)
                {
                    ForEachEventListenerBubbleUp(e, hitPointChain, (e1, listener) =>
                    {
                        //please ensure=> no local var/pararmeter capture inside lambda
                        if (listener.BypassAllMouseEvents)
                        {
                            return(false);
                        }
                        listener.ListenMouseUp(e1);

                        //return true to stop this loop (no further bubble up)
                        //return false to bubble this to upper control
                        //click or double click
                        if (e1.CurrentContextElement == _currentMouseDown)
                        {
                            if (e.IsAlsoDoubleClick)
                            {
                                listener.ListenMouseDoubleClick(e);
                            }
                            else
                            {
                                listener.ListenMouseClick(e);
                            }
                        }

                        return(e1.CancelBubbling || !listener.BypassAllMouseEvents);
                    });
                }
            }
            SwapHitChain(hitPointChain);
            e.StopPropagation();
        }
コード例 #7
0
ファイル: UIEventArgs.cs プロジェクト: brezza92/PixelFarm
 public static void SetMouseDoubleClick(this UIMouseUpEventArgs e, bool isAlsoDoubleClick)
 {
     e.IsAlsoDoubleClick = isAlsoDoubleClick;
 }
コード例 #8
0
ファイル: GLESAppModule.cs プロジェクト: brezza92/PixelFarm
 protected override void OnMouseUp(UIMouseUpEventArgs e)
 {
     _demoBase.MouseUp(e.X, e.Y);
     base.OnMouseUp(e);
 }
コード例 #9
0
 void IEventListener.ListenMouseUp(UIMouseUpEventArgs e)
 {
     //1. mouse up
     OnMouseUp(e);
 }
コード例 #10
0
 internal void InvokeMouseUp(S sender, T state, UIMouseUpEventArgs e)
 {
     MouseUp?.Invoke(new SenderInfo(sender, state), e);
 }
コード例 #11
0
 public override void HandleDragEnd(UIMouseUpEventArgs e)
 {
     SetCaretVisible(true);
     GetRoot().CaretStopBlink();
     base.HandleDragEnd(e);
 }
コード例 #12
0
 void IEventListener.ListenMouseUp(UIMouseUpEventArgs e)
 {
     MouseUp?.Invoke(this, e);
 }
コード例 #13
0
ファイル: UIEventArgs.cs プロジェクト: brezza92/PixelFarm
 public static void SetIsDragging(this UIMouseUpEventArgs e, bool isDragging) => e.IsDragging   = isDragging;
コード例 #14
0
        public void MouseUp(UIMouseUpEventArgs e, CssBox startAt)
        {
            if (!_isBinded)
            {
                return;
            }
            if (startAt == null)
            {
                return;
            }
            //----------------------------------------------------

            DateTime snapMouseUpTime   = DateTime.Now;
            TimeSpan timediff          = snapMouseUpTime - _lastimeMouseUp;
            bool     isAlsoDoubleClick = timediff.Milliseconds < DOUBLE_CLICK_SENSE;

            _lastimeMouseUp = snapMouseUpTime;
            //-----------------------------------------
            CssBoxHitChain hitChain = GetFreeHitChain();

#if DEBUG
            hitChain.debugEventPhase = CssBoxHitChain.dbugEventPhase.MouseUp;
#endif
            hitChain.SetRootGlobalPosition(e.X, e.Y);
            //1. prob hit chain only
            BoxHitUtils.HitTest(startAt, e.X, e.Y, hitChain);
            SetEventOrigin(e, hitChain);
            //2. invoke css event and script event
            ForEachOnlyEventPortalBubbleUp(e, hitChain, (portal) =>
            {
                portal.PortalMouseUp(e);
                return(true);
            });
            if (!e.CancelBubbling)
            {
                ForEachEventListenerBubbleUp(e, hitChain, () =>
                {
                    e.CurrentContextElement.ListenMouseUp(e);
                    return(e.CancelBubbling);
                });
            }

            if (!e.IsCanceled)
            {
                //--------------------
                //click or double click
                //--------------------
                if (isAlsoDoubleClick)
                {
                    ForEachEventListenerBubbleUp(e, hitChain, () =>
                    {
                        e.CurrentContextElement.ListenMouseDoubleClick(e);
                        return(e.CancelBubbling);
                    });
                }
                else
                {
                    ForEachEventListenerBubbleUp(e, hitChain, () =>
                    {
                        e.CurrentContextElement.ListenMouseClick(e);
                        return(e.CancelBubbling);
                    });
                }
            }

            ReleaseHitChain(hitChain);
            if (_latestMouseDownChain != null)
            {
                _latestMouseDownChain.Clear();
                //Console.WriteLine(dbugNN++);
                _latestMouseDownChain = null;
            }
        }
コード例 #15
0
 void IEventListener.ListenMouseUp(UIMouseUpEventArgs e)
 {
     OnMouseUp(e);
     _externalEventListener?.ListenMouseUp(e);
 }
コード例 #16
0
 protected override void OnMouseUp(UIMouseUpEventArgs e)
 {
 }
コード例 #17
0
 internal abstract void ListenMouseUp(object sender, UIMouseUpEventArgs e);
コード例 #18
0
 //int dbugNN = 0;
 public void MouseUp(UIMouseUpEventArgs e)
 {
     MouseUp(e, _htmlVisualRoot.RootCssBox);
 }
コード例 #19
0
 protected override void OnMouseUp(UIMouseUpEventArgs e)
 {
     _isMouseDown = false;
     base.OnMouseUp(e);
 }