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;
            }
        }
        public void SetCurrentState(TouchInputState state)
        {
            switch (_CurrentState)
            {
            case TouchInputState.TAPPING:
                break;

            case TouchInputState.DRAGGING:
                OnDragStop?.Invoke();
                break;

            case TouchInputState.PINCHING:
                OnPinchStop?.Invoke();
                break;
            }

            switch (state)
            {
            case TouchInputState.TAPPING:
                break;

            case TouchInputState.DRAGGING:
                OnDragStart?.Invoke();
                break;

            case TouchInputState.PINCHING:
                OnPinchStart?.Invoke();
                break;
            }

            _CurrentState = state;
        }
Exemplo n.º 3
0
        private void OnPointerDown(PointerEventArgs e)
        {
            BSplitterCJsInterop.SetPointerCapture(jsRuntimeCurrent, bSplitter.bsbSettings.ID, e.PointerId);
            DragMode = true;

            if (bsSettings.IsDiagonal)
            {
                bSplitter.PreviousPosition  = (int)e.ClientX;
                bSplitter.PreviousPosition2 = (int)e.ClientY;
            }
            else
            {
                if (bsSettings.VerticalOrHorizontal)
                {
                    bSplitter.PreviousPosition  = (int)e.ClientY;
                    bSplitter.PreviousPosition2 = (int)e.ClientX;
                }
                else
                {
                    bSplitter.PreviousPosition  = (int)e.ClientX;
                    bSplitter.PreviousPosition2 = (int)e.ClientY;
                }
            }


            OnDragStart?.Invoke(bSplitter.bsbSettings.index, (int)e.ClientX, (int)e.ClientY);
        }
Exemplo n.º 4
0
 public virtual void DragStart(UIMouseEvent e)
 {
     OnDragStart?.Invoke(e, this);
     if (PropagationRule.HasFlag(PropagationFlags.DragStart))
     {
         Parent?.DragStart(e);
     }
 }
Exemplo n.º 5
0
        public virtual void OnBeginDrag(PointerEventData eventData)
        {
            ExecOnEnabledAndFocus(() => {
                OnDragStart?.Invoke(eventData);

                _isDragged = true;

                SetDragPos(eventData);
            });
        }
Exemplo n.º 6
0
        //Enable the drag selection box
        private void StartDrag()
        {
            //Save the currently selected objects
            originalSeleciton = new HashSet <GameObject>(ObjectSelection.Instance.GetSelection());
            //Enable the drag selection box
            dragSelectBox.SetActive(true);
            dragging = true;

            //Capture the cursor while dragging
            EditorManager.Instance.CaptureCursor();
            //Notify all listeners that the tool handle was activated
            OnDragStart?.Invoke();
        }
Exemplo n.º 7
0
 void MyDragStart(UIDragEventArgs args)
 {
     if (Debug)
     {
         Console.WriteLine($"DR: {DataItem} START");
     }
     args.DataTransfer.EffectAllowed = DragType;
     args.DataTransfer.Types         = new string[] { "text/plain" };
     args.DataTransfer.Items         = new UIDataTransferItem[] { new UIDataTransferItem()
                                                                  {
                                                                      Kind = "string", Type = "text/plain"
                                                                  } };
     OnDragStart?.Invoke(args, DataItem);
 }
Exemplo n.º 8
0
        public void ClearEvents()
        {
            foreach (DragDropCallback d in OnDragDrop.GetInvocationList())
            {
                OnDragDrop -= d;
            }

            foreach (DragDropCallback d in OnDragCancel.GetInvocationList())
            {
                OnDragCancel -= d;
            }

            foreach (DragDropCallback d in OnDragStart.GetInvocationList())
            {
                OnDragStart -= d;
            }
        }
Exemplo n.º 9
0
        void _update(ICogaManager coga, float deltaTime)
        {
            // Continuation from previous input
            if (isMouseDown)
            {
                if (mouseDownTime == 0f)
                {
                    OnStartClicking?.Invoke(Parent);
                    mousepos_lastframe = coga.MousePosition;
                }
                mouseDownTime += deltaTime;
                if (coga.IsClickReleased)                 // Exit out
                {
                    _handle_up(coga);
                    return;
                }

                if (isDragging)
                {
                    _update_drag(coga);
                    return;
                }

                if ((Vector2.Distance(coga.MousePosition, mouseInitial)) >= MouseDragMinimumDistance)
                {
                    OnDragStart?.Invoke(Parent);
                    Parent.Manager.LockHover();
                    OnDrag?.Invoke(Parent, (coga.MousePosition - mouseInitial));
                    isDragging = true;
                    return;
                }
            }
            else
            {
                if (coga.IsClickPressed)
                {
                    isDragging    = false;
                    isMouseDown   = true;
                    mouseDownTime = 0f;
                    mouseInitial  = coga.MousePosition;
                }
            }

            mousepos_lastframe = coga.MousePosition;
        }
Exemplo n.º 10
0
        private void AdornedElement_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            dragging = true;

            if (!(AdornedElement.RenderTransform is TranslateTransform transform))
            {
                transform = new TranslateTransform();
                AdornedElement.RenderTransform = transform;
            }

            dragStartElementPosition = new Point(transform.X, transform.Y);
            dragStartMousePosition   = e.GetPosition(null);

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

            OnDragStart?.Invoke(this, EventArgs.Empty);
        }
        private void HandleDebugMouse()
        {
#if UNITY_EDITOR
            if (Input.GetMouseButtonDown(1))
            {
                _PreviousMousePosition = Input.mousePosition;
                OnDragStart?.Invoke();
            }

            if (Input.GetMouseButton(1))
            {
                Vector2 mousePos = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
                OnDragDelta?.Invoke((mousePos - _PreviousMousePosition) * 2);
                _PreviousMousePosition = Input.mousePosition;
            }

            if (Input.GetMouseButtonUp(1))
            {
                OnDragStop?.Invoke();
            }

            OnPinchDelta?.Invoke(Input.mouseScrollDelta.y * 45);

            if (Input.GetMouseButtonDown(0))
            {
                OnTap?.Invoke();

                if (!ShootGraphicsRays(Input.mousePosition))
                {
                    if (!ShootPhysicsRay(Input.mousePosition))
                    {
                        OnDeselect?.Invoke();
                    }
                }
            }
#endif
        }
        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;
            }
        }
Exemplo n.º 13
0
 public void NotifyDragStart(Event eventArgs)
 {
     OnDragStart?.Invoke(this, eventArgs);
 }
Exemplo n.º 14
0
 public void TriggerOnDragStart(Widget widget, PointerEventData eventData)
 {
     OnDragStart?.Invoke(widget, eventData);
 }
Exemplo n.º 15
0
 protected virtual Task HandleDragStart(DragEventArgs args)
 {
     return(OnDragStart.InvokeAsync(args));
 }
Exemplo n.º 16
0
 protected virtual void RaiseOnDragStart(DragStartEvent arg)
 {
     OnDragStart?.Invoke(this, arg);
 }
Exemplo n.º 17
0
 public override void OnBeginDrag(PointerEventData eventData)
 {
     base.OnBeginDrag(eventData);
     OnDragStart?.Invoke();
 }
Exemplo n.º 18
0
 public void StartDragging()
 {
     OnDragStart?.Invoke();
 }
Exemplo n.º 19
0
 public void TriggerOnDragStart()
 {
     OnDragStart?.Invoke();
 }
Exemplo n.º 20
0
 internal virtual void DoDragStart()
 {
     OnDragStart?.Invoke();
 }