Пример #1
0
 IEnumerator <object> ManageLabelFocus()
 {
     while (true)
     {
         if (PropertyLabel.Input.WasMousePressed())
         {
             PropertyLabel.SetFocus();
         }
         yield return(null);
     }
 }
Пример #2
0
        IEnumerator <object> ManageLabelTask()
        {
            while (true)
            {
                var popupMenu = PropertyLabel.Input.WasMouseReleased(1);
                if (popupMenu || PropertyLabel.Input.WasMouseReleased(0))
                {
                    PropertyLabel.SetFocus();
                }
                PropertyLabel.Color = PropertyLabel.IsFocused() ? Theme.Colors.KeyboardFocusBorder : Theme.Colors.BlackText;
                if (popupMenu)
                {
                    // Wait until the label actually change its color.
                    yield return(null);

                    yield return(null);

                    ShowPropertyContextMenu();
                }
                if (PropertyLabel.IsFocused())
                {
                    if (Command.Copy.WasIssued())
                    {
                        Command.Copy.Consume();
                        Copy();
                    }
                    if (Command.Paste.WasIssued())
                    {
                        Command.Paste.Consume();
                        Paste();
                    }
                    if (resetToDefault.WasIssued())
                    {
                        resetToDefault.Consume();
                        var defaultValue = EditorParams.DefaultValueGetter();
                        if (defaultValue != null)
                        {
                            SetProperty(defaultValue);
                        }
                    }
                }
                yield return(null);
            }
        }