Beispiel #1
0
        private void OnPropertyLabelSetupContextMenu(PropertyNameLabel label, FlaxEditor.GUI.ContextMenu.ContextMenu menu, CustomEditor linkedEditor)
        {
            var index = (int)label.Tag;

            menu.AddSeparator();
            menu.AddButton("Rename", () => StartParameterRenaming(index, label));
            menu.AddButton("Edit attributes...", () => EditAttributesParameter(index, label));
            menu.AddButton("Delete", () => DeleteParameter(index));
        }
Beispiel #2
0
            /// <inheritdoc />
            public override void OnShowSecondaryContextMenu(FlaxEditor.GUI.ContextMenu.ContextMenu menu, Float2 location)
            {
                base.OnShowSecondaryContextMenu(menu, location);

                if (GetSelected() == null)
                {
                    return;
                }
                menu.AddSeparator();
                menu.AddButton("Find references...", OnFindReferences);
            }
Beispiel #3
0
        /// <inheritdoc />
        public override bool OnMouseUp(Vector2 location, MouseButton button)
        {
            if (button == MouseButton.Right && Archetype.ValueIndex != -1)
            {
                var menu = new FlaxEditor.GUI.ContextMenu.ContextMenu();
                menu.AddButton("Copy value", OnCopyValue);
                var paste = menu.AddButton("Paste value", OnPasteValue);
                try
                {
                    GetClipboardValue(out _, false);
                }
                catch
                {
                    paste.Enabled = false;
                }

                menu.Show(this, location);
                return(true);
            }

            return(base.OnMouseUp(location, button));
        }
Beispiel #4
0
 /// <summary>
 /// Called to display additional context options for a parameter.
 /// </summary>
 /// <param name="index">The zero-based parameter index.</param>
 /// <param name="menu">The context menu.</param>
 protected virtual void OnParamContextMenu(int index, FlaxEditor.GUI.ContextMenu.ContextMenu menu)
 {
     menu.AddSeparator();
     menu.AddButton("Find references...", () => OnFindReferences(index));
 }