void OnMouseUp(MouseUpEvent evt) { bool emitDragFinishedEvent = m_Active; m_Active = false; if (m_Handle.HasMouseCapture()) { m_Handle.ReleaseMouse(); } evt.StopImmediatePropagation(); // Recalculate which corner to dock to m_WindowDockingLayout.CalculateDockingCornerAndOffset(target.layout, target.parent.layout); m_WindowDockingLayout.ClampToParentWindow(); // Use the docking results to figure which of left/right and top/bottom needs to be set. m_WindowDockingLayout.ApplyPosition(target); // Signal that the dragging has finished. if (emitDragFinishedEvent && OnDragFinished != null) { OnDragFinished(); } }
void OnMouseUp(MouseUpEvent evt) { if (evt.button != (int)MouseButton.LeftMouse) return; if (!m_Grabbed) return; m_Grabbed = false; this.ReleaseMouse(); evt.StopImmediatePropagation(); }
void OnMouseUp(MouseUpEvent evt) { active = false; if (handle.HasMouseCapture()) { handle.ReleaseMouse(); } evt.StopImmediatePropagation(); if (onDragEnd != null) { onDragEnd(); } }
void OnMouseUp(MouseUpEvent evt) { if (evt.clickCount != 1) { return; } if (evt.button == (int)MouseButton.RightMouse) { if (OnContextMenu != null) { OnContextMenu.Invoke(); } } evt.StopImmediatePropagation(); }
void OnItemMouseUp(MouseUpEvent evt) { if (evt.clickCount != 1) { return; } if (evt.modifiers != EventModifiers.None || evt.button != (int)MouseButton.RightMouse) { return; } if (OnItemContextMenu != null) { var item = (T)evt.currentTarget; OnItemContextMenu.Invoke(item); } evt.StopImmediatePropagation(); }
void OnMouseUp(MouseUpEvent evt) { bool emitDragFinishedEvent = m_Active; m_Active = false; if (m_Handle.HasMouseCapture()) { m_Handle.ReleaseMouseCapture(); } evt.StopImmediatePropagation(); m_WindowDockingLayout.CalculateDockingCornerAndOffset(target.layout, target.parent.layout); if (emitDragFinishedEvent && OnDragFinished != null) { OnDragFinished(); } }
void OnMouseUp(MouseUpEvent evt) { if (evt.button != (int)MouseButton.LeftMouse) { return; } if (!m_Grabbed) { return; } m_Grabbed = false; #if UNITY_2018_3_OR_NEWER this.ReleaseMouse(); #else this.ReleaseMouseCapture(); #endif evt.StopImmediatePropagation(); }
private void HandleMouseUp(MouseUpEvent evt) { if (evt.button != (int)MouseButton.RightMouse) { return; } evt.StopImmediatePropagation(); var contextMenu = new GenericMenu(); contextMenu.AddItem(new GUIContent("Hide Empty Collections"), hideIfEmpty, () => { hideIfEmpty = !hideIfEmpty; if (!selected.HasValue || world == null || !world.EntityManager.Exists(selected.Value.Entity)) { return; } DispatchHideChangeEvent(); }); contextMenu.ShowAsContext(); }