internal override void ListenMouseUp(object sender, UIMouseUpEventArgs e) { if (_ownerBeh.HasMouseUp) { _ownerBeh.InvokeMouseUp((S)sender, _state, e); } }
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); }
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); }
public virtual void HandleDragEnd(UIMouseUpEventArgs e) { _isDragBegin = false; _editSession.StartSelectIfNoSelection(); _editSession.SetCaretPos(e.X, e.Y); _editSession.EndSelect(); //this.InvalidateGraphics(); InvalidateGraphicOfCurrentSelectionArea(); }
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); }
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(); }
public static void SetMouseDoubleClick(this UIMouseUpEventArgs e, bool isAlsoDoubleClick) { e.IsAlsoDoubleClick = isAlsoDoubleClick; }
protected override void OnMouseUp(UIMouseUpEventArgs e) { _demoBase.MouseUp(e.X, e.Y); base.OnMouseUp(e); }
void IEventListener.ListenMouseUp(UIMouseUpEventArgs e) { //1. mouse up OnMouseUp(e); }
internal void InvokeMouseUp(S sender, T state, UIMouseUpEventArgs e) { MouseUp?.Invoke(new SenderInfo(sender, state), e); }
public override void HandleDragEnd(UIMouseUpEventArgs e) { SetCaretVisible(true); GetRoot().CaretStopBlink(); base.HandleDragEnd(e); }
void IEventListener.ListenMouseUp(UIMouseUpEventArgs e) { MouseUp?.Invoke(this, e); }
public static void SetIsDragging(this UIMouseUpEventArgs e, bool isDragging) => e.IsDragging = isDragging;
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; } }
void IEventListener.ListenMouseUp(UIMouseUpEventArgs e) { OnMouseUp(e); _externalEventListener?.ListenMouseUp(e); }
protected override void OnMouseUp(UIMouseUpEventArgs e) { }
internal abstract void ListenMouseUp(object sender, UIMouseUpEventArgs e);
//int dbugNN = 0; public void MouseUp(UIMouseUpEventArgs e) { MouseUp(e, _htmlVisualRoot.RootCssBox); }
protected override void OnMouseUp(UIMouseUpEventArgs e) { _isMouseDown = false; base.OnMouseUp(e); }