private void OnPointerUp(PointerEventArgs e)
        {
            BSplitterCJsInterop.releasePointerCapture(jsRuntimeCurrent, bSplitter.bsbSettings.ID, e.PointerId);
            DragMode = false;

            OnDragEnd?.Invoke(bSplitter.bsbSettings.index, (int)e.ClientX, (int)e.ClientY);
        }
示例#2
0
        public bool OnEndDrag(PointerEventData eventData)
        {
            if (_isDraggingPoint)
            {
                OnDragEnd?.Invoke(this, new EventArgs(eventData, isPointEvent: true));
            }
            else if (_isDraggingOutHandle)
            {
                OnDragEnd?.Invoke(this, new EventArgs(eventData, isOutHandleEvent: true));
            }
            else if (_isDraggingInHandle)
            {
                OnDragEnd?.Invoke(this, new EventArgs(eventData, isInHandleEvent: true));
            }
            else
            {
                return(!IsEventOutside(eventData));
            }

            _isDraggingPoint     = false;
            _isDraggingOutHandle = false;
            _isDraggingInHandle  = false;

            return(true);
        }
        internal void DispatchEvent(PopupEventArgs eventArgs)
        {
            switch (eventArgs.Type)
            {
            case "close":
                OnClose?.Invoke(eventArgs);
                break;

            case "drag":
                OnDrag?.Invoke(eventArgs);
                break;

            case "dragend":
                OnDragEnd?.Invoke(eventArgs);
                break;

            case "dragstart":
                OnDragStart?.Invoke(eventArgs);
                break;

            case "open":
                OnOpen?.Invoke(eventArgs);
                break;
            }
        }
示例#4
0
 void _handle_up(ICogaManager coga)
 {
     isMouseDown = false;
     if (isDragging)
     {
         OnDragEnd?.Invoke(Parent);
         coga.UnlockHover();
     }
     else
     {
         if (LongClickingEnabled)
         {
             // With long clicking enabled, allow early cancel out and
             // only long click past the const delay.
             if (mouseDownTime < MouseClickDelay)
             {
                 _update_click(coga);
             }
             else
             {
                 OnLongClick?.Invoke(Parent);
                 OnEndClicking?.Invoke(Parent);
             }
         }
         else
         {
             // If we don't need to worry about the long click,
             // just always click.
             _update_click(coga);
         }
     }
 }
示例#5
0
 public virtual void DragEnd(UIDragEndEvent e)
 {
     OnDragEnd?.Invoke(e, this);
     if (PropagationRule.HasFlag(PropagationFlags.DragEnd))
     {
         Parent?.DragEnd(e);
     }
 }
示例#6
0
 void MyDragEnd(UIDragEventArgs args)
 {
     if (Debug)
     {
         Console.WriteLine($"DR: {DataItem} END");
     }
     OnDragEnd?.Invoke(args, DataItem);
 }
示例#7
0
        public void OnEndDrag(PointerEventData eventData)
        {
            SfxManager.Instance.Play(SfxType.UI_DragEnd);

            OnDragEnd?.Invoke();

            selectedObject = null;
            Destroy(this.gameObject);
        }
示例#8
0
        private IEnumerator InvokeOnDragEndEvent()
        {
            //Wait until the end of the frame so that the OnHandleFinish event doesn't overlap with the OnMouseUp event
            yield return(new WaitForEndOfFrame());

            //After dragging the handle, release the cursor
            EditorManager.Instance.ReleaseCursor();
            //Notify all listeners that the selection drag box was disabled
            OnDragEnd?.Invoke();
        }
示例#9
0
        public void OnEndDrag(PointerEventData eventData)
        {
            ExecOnEnabledAndFocus(() => {
                OnDragEnd?.Invoke(eventData);
            });

            SetUnfocus(true);

            _isDragged = false;
        }
示例#10
0
        private void AdornedElement_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (dragging)
            {
                dragging = false;

                AdornedElement.ReleaseMouseCapture();
                e.Handled = true;

                OnDragEnd?.Invoke(this, new EventArgs());
            }
        }
示例#11
0
 private void Drag()
 {
     if (!isActive)
     {
         return;
     }
     if (!isUse)
     {
         assembleManager.OnSelect.Invoke(this);
         PrepareAssmeble();
     }
     else if (prepareFinish)
     {
         if (Input.GetMouseButtonDown(0))
         {
             Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
             RaycastHit hit;
             containerBase = null;
             if (Physics.Raycast(ray, out hit, 100) && hit.transform.name == obj.name)
             {
                 screenPosition  = Camera.main.WorldToScreenPoint(obj.transform.position);
                 mScreenPosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z);
                 offset          = obj.transform.position - Camera.main.ScreenToWorldPoint(mScreenPosition);
                 isButtonDown    = true;
             }
             if (OnDragBegin != null)
             {
                 OnDragBegin.Invoke();
             }
         }
         if (Input.GetMouseButton(0) && isButtonDown)
         {
             mScreenPosition        = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPosition.z);
             obj.transform.position = Camera.main.ScreenToWorldPoint(mScreenPosition) + offset;
         }
         if (Input.GetMouseButtonUp(0) && isButtonDown)
         {
             isUse         = false;
             isActive      = false;
             isButtonDown  = false;
             tempContainer = FindContainer();
             if (JugeAssmeble(tempContainer))
             {
                 BeginAssmeble(tempContainer);
             }
             if (OnDragEnd != null)
             {
                 OnDragEnd.Invoke(this, containerBase);
             }
         }
     }
 }
示例#12
0
    public void OnEndDrag(PointerEventData eventData)
    {
        var direction = eventData.position - startPosition;

        startPosition = Vector2.zero;
        if (direction.y >= 0)
        {
            OnDragEnd?.Invoke(Direction.Up);
        }
        else
        {
            OnDragEnd?.Invoke(Direction.Down);
        }
    }
示例#13
0
 static int SetDragEndCallBack(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ScrollRectExtend obj  = (ScrollRectExtend)ToLua.CheckObject <ScrollRectExtend>(L, 1);
         OnDragEnd        arg0 = (OnDragEnd)ToLua.CheckDelegate <OnDragEnd>(L, 2);
         obj.SetDragEndCallBack(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#14
0
 protected virtual Task HandleDragEnd(DragEventArgs args)
 {
     return(OnDragEnd.InvokeAsync(args));
 }
示例#15
0
 protected virtual void RaiseOnDragEnd(DragEndEvent arg)
 {
     OnDragEnd?.Invoke(this, arg);
 }
示例#16
0
 protected void Invoke_OnDragEnd(object sender, DragArgs args)
 {
     OnDragEnd?.Invoke(sender, args);
 }
示例#17
0
 public void StopDragging()
 {
     OnDragEnd?.Invoke();
 }
示例#18
0
 // ReSharper disable once MemberCanBePrivate.Global
 protected void OnDragFinish(Polygon polygon)
 {
     OnDragEnd?.Invoke(polygon);
     UpdatePointsAsync(CurrentPolygon);
 }
示例#19
0
 public void NotifyDragEnd(DragEndEvent eventArgs)
 {
     OnDragEnd?.Invoke(this, eventArgs);
 }
        private void Timeline_MouseUp(object sender, MouseEventArgs e)
        {
            _dragging = false;

            OnDragEnd?.Invoke(this, null);
        }
示例#21
0
 public void OnEndDrag(PointerEventData eventData)
 {
     OnDragEnd?.Invoke();
 }
示例#22
0
 public void TriggerOnDragEnd(Widget widget, PointerEventData eventData)
 {
     OnDragEnd?.Invoke(widget, eventData);
 }
示例#23
0
 internal virtual void DoDragEnd()
 {
     OnDragEnd?.Invoke();
 }
        internal void DispatchEvent(Map map, HtmlMarkerJsEventArgs eventArgs)
        {
            if (eventArgs.Options != null)
            {
                var popupOptions = Options.Popup;
                Options       = eventArgs.Options;
                Options.Popup = popupOptions;
            }

            switch (eventArgs.Type)
            {
            case "click":
                OnClick?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "contextmenu":
                OnContextMenu?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dblclick":
                OnDblClick?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "drag":
                OnDrag?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dragend":
                OnDragEnd?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dragstart":
                OnDragStart?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keydown":
                OnKeyDown?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keypress":
                OnKeyPress?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keyup":
                OnKeyUp?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mousedown":
                OnMouseDown?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseenter":
                OnMouseEnter?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseleave":
                OnMouseLeave?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mousemove":
                OnMouseMove?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseout":
                OnMouseOut?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseover":
                OnMouseOver?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseup":
                OnMouseUp?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;
            }
        }
 public void OnEndDrag(PointerEventData eventData) => OnDragEnd?.Invoke(this, new PointerEventArgs(eventData));