コード例 #1
0
ファイル: VFXBlackboard.cs プロジェクト: vault51/Graphics
 void OnMouseDownSubTitle(MouseDownEvent evt)
 {
     if (evt.clickCount == 2 && evt.button == (int)MouseButton.LeftMouse && m_CanEdit && controller != null)
     {
         StartEditingPath();
         evt.PreventDefault();
     }
 }
コード例 #2
0
 void OnMouseDownEvent(MouseDownEvent evt)
 {
     if (evt.clickCount == 2 && evt.button == (int)MouseButton.LeftMouse)
     {
         StartEditingPath();
         evt.PreventDefault();
     }
 }
コード例 #3
0
 private void OnMouseDownEvent(MouseDownEvent e)
 {
     if ((e.clickCount == 2) && e.button == (int)MouseButton.LeftMouse)
     {
         RenameGo();
         e.PreventDefault();
     }
 }
コード例 #4
0
 public static void OnEditEvent(MouseDownEvent evt, TextField edit)
 {
     if (evt.clickCount == 2 && evt.button == (int)MouseButton.LeftMouse)
     {
         ShowEditableText(edit);
         evt.PreventDefault();
     }
 }
コード例 #5
0
 private void OnTitleLabelMouseDown(MouseDownEvent evt)
 {
     if (evt.clickCount == 2 && evt.button == (int)MouseButton.LeftMouse)
     {
         StartEditingName();
         evt.PreventDefault();
     }
 }
コード例 #6
0
 private void OnMouseDownEvent(MouseDownEvent e)
 {
     if ((e.clickCount == 2) && e.button == (int)MouseButton.LeftMouse)
     {
         OpenTextEditor();
         e.PreventDefault();
     }
 }
コード例 #7
0
 void OnTitleMouseDown(MouseDownEvent e)
 {
     if (e.clickCount == 2)
     {
         OnRename();
         e.StopPropagation();
         e.PreventDefault();
     }
 }
コード例 #8
0
 void OnMouseDownEvent(MouseDownEvent e)
 {
     if ((e.clickCount == 2) && e.button == (int)MouseButton.LeftMouse && IsRenamable())
     {
         OpenTextEditor();
         e.PreventDefault();
         e.StopImmediatePropagation();
     }
 }
コード例 #9
0
 void OnContentsMouseDown(MouseDownEvent e)
 {
     if (e.clickCount == 2)
     {
         m_ContentsField.value         = m_Contents.text;
         m_ContentsField.style.display = DisplayStyle.Flex;
         m_ContentsField.Q("unity-text-input").Focus();
         e.StopPropagation();
         e.PreventDefault();
     }
 }
コード例 #10
0
 void OnContentsMouseDown(MouseDownEvent e)
 {
     if (e.button == (int)MouseButton.LeftMouse && e.clickCount == 2)
     {
         m_ContentsField.value         = m_Contents.text;
         m_ContentsField.style.display = DisplayStyle.Flex;
         m_ContentsField.Q(TextField.textInputUssName).Focus();
         e.StopPropagation();
         e.PreventDefault();
     }
 }
コード例 #11
0
        void OnMouseDownEventForRename(MouseDownEvent e)
        {
            if (e.clickCount != 2 || e.button != (int)MouseButton.LeftMouse || e.target == null)
            {
                return;
            }

            ActivateRenameElementMode();

            e.PreventDefault();
        }
コード例 #12
0
ファイル: StickyNote.cs プロジェクト: JamesZhao01/UnityVrGame
 void OnContentsMouseDown(MouseDownEvent e)
 {
     if (e.clickCount == 2)
     {
         m_ContentsField.value   = m_Contents.text;
         m_ContentsField.visible = true;
         m_ContentsField.Q("unity-text-input").Focus();
         e.StopPropagation();
         e.PreventDefault();
     }
 }
コード例 #13
0
 void OnContentsMouseDown(MouseDownEvent e)
 {
     if (e.button == (int)MouseButton.LeftMouse && e.clickCount == 2)
     {
         m_Content.style.display      = DisplayStyle.None;
         m_ContentField.style.display = StyleKeyword.Null;
         m_ContentField.Q(TextField.textInputUssName).Focus();
         m_ContentField.SelectAll();
         e.StopPropagation();
         e.PreventDefault();
     }
 }
コード例 #14
0
        void OnTitleMouseDown(MouseDownEvent e)
        {
            if (e.button == (int)MouseButton.LeftMouse && e.clickCount == 2)
            {
                m_TitleField.RemoveFromClassList("empty");
                m_Title.style.display      = DisplayStyle.None;
                m_TitleField.style.display = StyleKeyword.Null;

                m_TitleField.Q(TextField.textInputUssName).Focus();
                m_TitleField.SelectAll();

                e.StopPropagation();
                e.PreventDefault();
            }
        }
コード例 #15
0
        void OnTitleMouseDown(MouseDownEvent e)
        {
            if (e.clickCount == 2)
            {
                m_TitleField.RemoveFromClassList("empty");
                m_TitleField.value         = m_Title.text;
                m_TitleField.style.display = DisplayStyle.Flex;
                UpdateTitleFieldRect();
                m_Title.RegisterCallback <GeometryChangedEvent>(OnTitleRelayout);

                m_TitleField.Q("unity-text-input").Focus();
                m_TitleField.SelectAll();

                e.StopPropagation();
                e.PreventDefault();
            }
        }
コード例 #16
0
ファイル: StickyNote.cs プロジェクト: pball1000/FPS-Template
        void OnTitleMouseDown(MouseDownEvent e)
        {
            if (e.clickCount == 2)
            {
                m_TitleField.RemoveFromClassList("empty");
                m_TitleField.value   = m_Title.text;
                m_TitleField.visible = true;
                UpdateTitleFieldRect();
                m_Title.RegisterCallback <GeometryChangedEvent>(OnTitleRelayout);

                m_TitleField.Focus();
                m_TitleField.SelectAll();

                e.StopPropagation();
                e.PreventDefault();
            }
        }
コード例 #17
0
            protected void OnMouseDown(MouseDownEvent e)
            {
                if (CanStartManipulation(e))
                {
                    VisualSplitter visualSplitter = target as VisualSplitter;
                    FlexDirection  flexDirection  = visualSplitter.resolvedStyle.flexDirection;

                    if (m_AffectedElements != null)
                    {
                        VisualElementListPool.Release(m_AffectedElements);
                    }
                    m_AffectedElements = visualSplitter.GetAffectedVisualElements();

                    var shouldUseEvent = false;
                    for (int i = 0; i < m_AffectedElements.Count - 1; ++i)
                    {
                        VisualElement visualElement = m_AffectedElements[i];

                        Rect splitterRect = visualSplitter.GetSplitterRect(visualElement);

                        if (splitterRect.Contains(e.localMousePosition))
                        {
                            bool isReverse = flexDirection == FlexDirection.RowReverse || flexDirection == FlexDirection.ColumnReverse;

                            if (isReverse)
                            {
                                m_ActiveVisualElementIndex = i + 1;
                                m_NextVisualElementIndex   = i;
                            }
                            else
                            {
                                m_ActiveVisualElementIndex = i;
                                m_NextVisualElementIndex   = i + 1;
                            }
                            shouldUseEvent = true;
                        }
                    }
                    if (shouldUseEvent)
                    {
                        m_Active = true;
                        target.CaptureMouse();
                        e.StopPropagation();
                        e.PreventDefault();
                    }
                }
            }
コード例 #18
0
        void OnTitleMouseDown(MouseDownEvent e)
        {
            if (e.button == (int)MouseButton.LeftMouse && e.clickCount == 2)
            {
                m_TitleField.RemoveFromClassList("empty");
                m_TitleField.value         = m_Title.text;
                m_TitleField.style.display = DisplayStyle.Flex;
                UpdateTitleFieldRect();
                m_Title.RegisterCallback <GeometryChangedEvent>(OnTitleRelayout);

                m_TitleField.Q(TextField.textInputUssName).Focus();
                m_TitleField.SelectAll();

                e.StopPropagation();
                e.PreventDefault();
            }
        }
コード例 #19
0
        void OnMouseDown(MouseDownEvent evt)
        {
            if (s_CurrentlyActiveBuilderDragger != null && s_CurrentlyActiveBuilderDragger != this)
            {
                return;
            }

            var target = evt.currentTarget as VisualElement;

            if (m_WeStartedTheDrag && target.HasMouseCapture())
            {
                evt.StopImmediatePropagation();
                evt.PreventDefault();
                return;
            }

            if (!CanStartManipulation(evt))
            {
                return;
            }

            var stopEvent = StopEventOnMouseDown(evt);

            if (stopEvent)
            {
                evt.StopImmediatePropagation();
            }

            if (target.HasMouseCapture())
            {
                if (!stopEvent)
                {
                    evt.StopImmediatePropagation();
                }

                return;
            }

            s_CurrentlyActiveBuilderDragger = this;
            m_Start            = evt.mousePosition;
            m_WeStartedTheDrag = true;
            target.CaptureMouse();
        }