コード例 #1
0
        private RmlElementEditor openRangeEditor(Element element, GuiFrameworkUICallback uiCallback, int left, int top)
        {
            //Find actions
            String actionName = element.GetAttribute("onchange").StringValue;

            if (String.IsNullOrEmpty(actionName))
            {
                actionName = Guid.NewGuid().ToString();
                element.SetAttribute("onclick", actionName);
            }
            SlideAction action = slide.getAction(actionName);

            if (action == null)
            {
                action = new BlendSceneAction(actionName);
                slide.addAction(action);
            }

            //Make copy of action, this is really important, a lot of the function of this editor assumes this
            //is copied.
            SlideAction editingAction = CopySaver.Default.copy(action);

            EditInterface editInterface = setupEditInterface(editingAction, slide);

            editInterfaceEditor = new EditInterfaceEditor("Blend", editInterface, uiCallback);
            //appearanceEditor = new EditInterfaceEditor("Appearance", elementStyle.getEditInterface(), uiCallback);
            RmlElementEditor editor = RmlElementEditor.openEditor(element, left, top, this);

            editor.addElementEditor(editInterfaceEditor);
            return(editor);
        }
コード例 #2
0
 public void changeEditInterface(EditInterface editInterface)
 {
     if (consumer != null)
     {
         consumer.CurrentEditInterface = editInterface;
     }
 }
コード例 #3
0
        public override void customizeEditInterface(EditInterface editInterface, EditInterfaceManager <ButtonDefinitionBase> itemEdits)
        {
            addItemCreation("Add Button", delegate(String name)
            {
                return(new ButtonDefinition(name));
            });

            editInterface.addCommand(new EditInterfaceCommand("Add Close Button", callback =>
            {
                if (!hasItem("Close"))
                {
                    add(new CloseButtonDefinition("Close"));
                }
            }));

            editInterface.addCommand(new EditInterfaceCommand("Add Navigation Buttons", callback =>
            {
                if (!hasItem("Cancel") &&
                    !hasItem("Previous") &&
                    !hasItem("Next") &&
                    !hasItem("Finish"))
                {
                    add(new ButtonDefinition("Cancel", "Common/Cancel"));
                    add(new ButtonDefinition("Previous", "Common/Previous"));
                    add(new ButtonDefinition("Next", "Common/Next"));
                    add(new ButtonDefinition("Finish", "Common/Finish"));
                }
            }));

            addItemMovementCommands(itemEdits);
        }
コード例 #4
0
        public EditInterfaceTreeNode(EditInterface editInterface, EditInterfaceTreeView editInterfaceTreeView)
            : base(editInterface.getName())
        {
            if (editInterface.IconReferenceTag != null)
            {
                this.ImageResource = editInterface.IconReferenceTag.ToString();
            }

            this.editInterfaceTreeView = editInterfaceTreeView;

            this.editInterface = editInterface;
            editInterface.OnSubInterfaceAdded    += editInterface_OnSubInterfaceAdded;
            editInterface.OnSubInterfaceRemoved  += editInterface_OnSubInterfaceRemoved;
            editInterface.OnBackColorChanged     += editInterface_OnBackColorChanged;
            editInterface.OnForeColorChanged     += editInterface_OnForeColorChanged;
            editInterface.OnIconReferenceChanged += editInterface_OnIconReferenceChanged;
            editInterface.OnNameChanged          += editInterface_OnNameChanged;

            if (editInterface.hasSubEditInterfaces())
            {
                foreach (EditInterface subInterface in editInterface.getSubEditInterfaces())
                {
                    this.Children.add(new EditInterfaceTreeNode(subInterface, editInterfaceTreeView));
                }
            }
        }
コード例 #5
0
 private void buildEditInterface(String name)
 {
     ensureScannerExists();
     editInterface = new ReflectedListLikeEditInterface <VariantOverride>(overrides, name, () => new VariantOverride(this), validateCallback: () =>
     {
         bool foundName = false;
         bool nameValid = false;
         foreach (var o in overrides)
         {
             if (!foundName)
             {
                 foundName = o.Name == "Name";
                 nameValid = !String.IsNullOrWhiteSpace(o.Value);
             }
             if (!scanner.getMatchingMembers(typeof(MaterialDescription)).Where(i => i.getWrappedName() == o.Name).Any())
             {
                 throw new ValidationException(String.Format("Cannot find a property named '{0}' to override. Please remove this property.", o.Name));
             }
         }
         if (!foundName)
         {
             throw new ValidationException("You must have one override property named 'Name' with a unique material name.");
         }
         if (!nameValid)
         {
             throw new ValidationException("Name property must contain a value.");
         }
     });
 }
コード例 #6
0
 void currentEditInterface_OnDataNeedsRefresh(EditInterface editInterface)
 {
     foreach (PropertiesFormComponent component in components)
     {
         component.refreshData();
     }
 }
コード例 #7
0
 /// <summary>
 /// Get the EditInterface.
 /// </summary>
 /// <returns>The EditInterface.</returns>
 internal EditInterface getEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = new EditInterface(name, addResource, removeResource, () =>
         {
             foreach (Resource resource in resources.Values)
             {
                 if (!resource.isValid())
                 {
                     String locName = resource.LocName;
                     if (locName == null || locName == String.Empty)
                     {
                         throw new ValidationException("Cannot accept empty locations. Please remove any blank entries.");
                     }
                     else
                     {
                         throw new ValidationException("Could not find the path \"{0}\". Please modify or remove that entry", resource.LocName);
                     }
                 }
             }
         });
         editInterface.setPropertyInfo(ResourceEditableProperty.Info);
         foreach (Resource resource in resources.Values)
         {
             onResourceAdded(resource);
         }
     }
     return(editInterface);
 }
コード例 #8
0
        void solutionWindow_InterfaceChosen(EditInterfaceViewEventArgs evt)
        {
            EditInterface editInterface = evt.EditInterface;

            if (editInterface.hasEditableProperties())
            {
                //Determine if the EditInterface is an ObjectPlaceholderInterface
                ObjectPlaceholderInterface objectPlaceholder = editInterface.getEditableProperties().First() as ObjectPlaceholderInterface;
                if (objectPlaceholder != null)
                {
                    showPlaceholder(objectPlaceholder);
                }
                else
                {
                    objectEditor.setEditInterface(editInterface, null, null);
                }
            }
            else if (editInterface.canAddRemoveProperties())
            {
                objectEditor.setEditInterface(editInterface, null, null);
            }
            else
            {
                objectEditor.clearEditInterface();
            }
            processInstanceSelection(editInterface);
        }
コード例 #9
0
 void mainEditor_FieldChanged(EditInterface editInterface, object editingObject)
 {
     if (currentRenderer != null)
     {
         currentRenderer.propertiesChanged(debugSurface);
     }
 }
コード例 #10
0
 protected override void createEditInterface()
 {
     editInterface = new EditInterface(Type);
     editInterface.addSubInterface(startPosition.getEditInterface("Start Position"));
     editInterface.addSubInterface(endPosition.getEditInterface("End Position"));
     editInterface.IconReferenceTag = Icon;
 }
コード例 #11
0
 public void cut()
 {
     EngineClipboard.clear();
     if (solutionWindow.Active)
     {
         foreach (EditInterface selectedInterface in solutionController.SelectedEditInterfaces)
         {
             ClipboardEntry clipEntry = selectedInterface.ClipboardEntry;
             if (selectedInterface.SupportsClipboard && clipEntry.SupportsCut)
             {
                 EngineClipboard.add(clipEntry);
             }
         }
     }
     else if (propertiesEditor.Active)
     {
         EditInterface selectedInterface = propertiesEditor.SelectedEditInterface;
         if (selectedInterface.SupportsClipboard)
         {
             ClipboardEntry clipEntry = selectedInterface.ClipboardEntry;
             if (clipEntry.SupportsCut)
             {
                 EngineClipboard.add(clipEntry);
             }
         }
     }
     EngineClipboard.Mode = EngineClipboardMode.Cut;
 }
コード例 #12
0
        private EditInterface setupEditInterface(SlideAction editingAction, Slide slide)
        {
            currentAction = editingAction;
            EditInterface editInterface = editingAction.getEditInterface();

            editingAction.ChangesMade += editingAction_ChangesMade;
            editInterface.addCommand(new EditInterfaceCommand("Change Type", callback =>
            {
                callback.showBrowser <Func <String, SlideAction> >(actionTypeBrowser, delegate(Func <String, SlideAction> result, ref string errorPrompt)
                {
                    currentAction.ChangesMade -= editingAction_ChangesMade;
                    SlideAction newAction      = result(currentAction.Name);
                    newAction.ChangesMade     += editingAction_ChangesMade;
                    actionEditor.EditInterface = setupEditInterface(newAction, slide);
                    editingAction_ChangesMade(newAction);
                    errorPrompt = "";
                    return(true);
                });
            }));
            if (editingAction.AllowPreview)
            {
                editInterface.addCommand(new EditInterfaceCommand("Preview", callback =>
                {
                    previewTriggerAction.clear();
                    currentAction.setupAction(slide, previewTriggerAction);
                    if (PreviewTrigger != null)
                    {
                        PreviewTrigger.Invoke();
                    }
                }));
            }
            return(editInterface);
        }
コード例 #13
0
 public SlideshowStyleManager(SlideshowEditController editorController, LectureUICallback uiCallback)
 {
     this.editorController = editorController;
     this.uiCallback       = uiCallback;
     editInterface         = new EditInterface("Theme");
     ReflectedEditInterface.expandEditInterface(this, ReflectedEditInterface.DefaultScanner, editInterface);
 }
コード例 #14
0
        public EditInterface getEditInterface()
        {
            if (editInterface == null)
            {
                editInterface = new EditInterface(name + " Behavior Manager");

                phasesEditInterface = new EditInterface("Update Phases",
                                                        uiCallback =>
                {
                    addUpdatePhase(new BehaviorUpdatePhase());
                },
                                                        (uiCallback, property) =>
                {
                    removeUpdatePhase((BehaviorUpdatePhase)property);
                }, null);
                EditablePropertyInfo propertyInfo = new EditablePropertyInfo();
                propertyInfo.addColumn(new EditablePropertyColumn("Name", false));
                phasesEditInterface.setPropertyInfo(propertyInfo);
                foreach (var phase in updatePhases)
                {
                    addPhaseProperty(phase);
                }

                editInterface.addSubInterface(phasesEditInterface);
            }
            return(editInterface);
        }
コード例 #15
0
        public EditInterface getEditInterface()
        {
            if (editInterface == null)
            {
                editInterface = new EditInterface(name);
                editInterface.addCommand(new EditInterfaceCommand("Create Group", createGroupCallback));
                editInterface.addCommand(new EditInterfaceCommand("Create Sim Object", createSimObjectCallback));
                editInterface.addCommand(new EditInterfaceCommand("Show All", showAllCallback));
                editInterface.addCommand(new EditInterfaceCommand("Hide All", hideAllCallback));
                editInterface.addCommand(new EditInterfaceCommand("Import Positions", importPositionsCallback));
                editInterface.IconReferenceTag = AnomalyIcons.Folder;
                GenericClipboardEntry clipboardEntry = new GenericClipboardEntry(typeof(InstanceGroup));
                clipboardEntry.PasteFunction = pasteCallback;
                clipboardEntry.SupportsPastingTypeFunction = supportsPasteType;
                editInterface.ClipboardEntry = clipboardEntry;

                var groupManager = editInterface.createEditInterfaceManager <InstanceGroup>();
                groupManager.addCommand(new EditInterfaceCommand("Remove", destroyGroupCallback));
                var instanceFileManager = editInterface.createEditInterfaceManager <InstanceFileInterface>();
                instanceFileManager.addCommand(new EditInterfaceCommand("Remove", destroySimObjectCallback));
                instanceFileManager.addCommand(new EditInterfaceCommand("Rename", renameSimObjectCallback));
                foreach (InstanceGroup group in groups.Values)
                {
                    addGroupSubInterface(group);
                }
                foreach (InstanceFileInterface file in instanceFiles.Values)
                {
                    onInstanceFileAdded(file);
                }
            }
            return(editInterface);
        }
コード例 #16
0
 /// <summary>
 /// Get the EditInterface for this SceneNode.
 /// </summary>
 /// <returns>The node's EditInterface.</returns>
 protected override EditInterface createEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = ReflectedEditInterface.createEditInterface(this, memberScanner, Name + " Scene Node", null);
         var movableObjectEdits = editInterface.createEditInterfaceManager <MovableObjectDefinition>();
         var childNodeEdits     = editInterface.createEditInterfaceManager <SceneNodeDefinition>();
         editInterface.addCommand(new EditInterfaceCommand("Add Entity", addEntity));
         editInterface.addCommand(new EditInterfaceCommand("Add Light", addLight));
         editInterface.addCommand(new EditInterfaceCommand("Add Camera", addCamera));
         editInterface.addCommand(new EditInterfaceCommand("Add Manual Object", addManualObject));
         editInterface.addCommand(new EditInterfaceCommand("Add Child Node", addChildNode));
         editInterface.IconReferenceTag = EngineIcons.Node;
         movableObjectEdits.addCommand(new EditInterfaceCommand("Remove", removeMovableObject));
         childNodeEdits.addCommand(new EditInterfaceCommand("Remove", removeChildNode));
         foreach (MovableObjectDefinition movable in movableObjects.Values)
         {
             addMovableObjectEdit(movable);
         }
         foreach (SceneNodeDefinition child in childNodes.Values)
         {
             addChildNodeEdit(child);
         }
     }
     return(editInterface);
 }
コード例 #17
0
 private void processInstanceSelection(EditInterface editInterface)
 {
     if (editInterface.hasEditableProperties())
     {
         InstanceFileInterface instanceFile = editInterface.getEditableProperties().First() as InstanceFileInterface;
         if (instanceFile != null)
         {
             if (AddSelectable.HeldDown)
             {
                 controller.SelectionController.addSelectedObject(instanceFile);
             }
             else if (RemoveSelectable.HeldDown)
             {
                 controller.SelectionController.removeSelectedObject(instanceFile);
             }
             else
             {
                 controller.SelectionController.setSelectedObject(instanceFile);
             }
         }
         else
         {
             controller.SelectionController.clearSelection();
         }
     }
     else
     {
         controller.SelectionController.clearSelection();
     }
 }
コード例 #18
0
 public EditInterfaceEditor(String title, EditInterface editInterface, GuiFrameworkUICallback uiCallback)
     : base("Medical.GUI.Editor.RmlWysiwyg.ElementEditorComponents.EditInterfaceEditor.layout", title)
 {
     propertiesScroll             = (ScrollView)widget.findWidget("PropertiesScroll");
     propertiesForm               = new ScrollingExpandingEditInterfaceViewer(propertiesScroll, uiCallback);
     propertiesForm.EditInterface = editInterface;
 }
コード例 #19
0
        protected sealed override EditInterface createEditInterface()
        {
            EditInterface editInterface = actionCollection.getEditInterface(Name);

            editInterface.IconReferenceTag = "MvcContextEditor/ControllerIcon";
            return(editInterface);
        }
コード例 #20
0
 void tree_NodeMouseReleased(object sender, TreeMouseEventArgs e)
 {
     if (e.Button == MouseButtonCode.MB_BUTTON1)
     {
         EditInterfaceTreeNode node = e.Node as EditInterfaceTreeNode;
         tree.SelectedNode    = e.Node;
         currentMenuInterface = node.EditInterface;
         if (currentMenuInterface.hasCommands())
         {
             PopupMenu menu = Gui.Instance.createWidgetT("PopupMenu", "PopupMenu", 0, 0, 1000, 1000, Align.Default, "Overlapped", "") as PopupMenu;
             menu.ItemAccept += new MyGUIEvent(menu_ItemAccept);
             menu.Closed     += new MyGUIEvent(menu_Closed);
             menu.Visible     = false;
             foreach (EditInterfaceCommand command in currentMenuInterface.getCommands())
             {
                 MenuItem item = menu.addItem(command.Name);
                 item.UserObject = command;
             }
             LayerManager.Instance.upLayerItem(menu);
             menu.setPosition(e.MousePosition.x, e.MousePosition.y);
             menu.ensureVisible();
             menu.setVisibleSmooth(true);
         }
     }
 }
コード例 #21
0
 void editInterface_OnDataNeedsRefresh(EditInterface editInterface)
 {
     if (sequenceEditor.Player != null)
     {
         sequenceEditor.Player.blend(keyframe.BlendAmount);
     }
 }
コード例 #22
0
        protected override void onShown(EventArgs args)
        {
            base.onShown(args);
            if (firstShow)
            {
                firstShow = false;
                EditInterface editInterface = new EditInterface("Debug Visualizers");
                foreach (var debugInterface in pluginManager.DebugInterfaces)
                {
                    EditInterface        debugEditInterface = new EditInterface(debugInterface.Name);
                    EditablePropertyInfo propertyInfo       = new EditablePropertyInfo();
                    propertyInfo.addColumn(new EditablePropertyColumn("Name", true));
                    propertyInfo.addColumn(new EditablePropertyColumn("Value", false));
                    debugEditInterface.setPropertyInfo(propertyInfo);

                    debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>("Enabled",
                                                                                               () => debugInterface.Enabled, v => debugInterface.Enabled = v, canParseBool, bool.Parse));

                    debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>("Depth Testing",
                                                                                               () => debugInterface.DepthTesting, v => debugInterface.DepthTesting = v, canParseBool, bool.Parse));

                    foreach (var entry in debugInterface.Entries)
                    {
                        debugEditInterface.addEditableProperty(new CallbackEditableProperty <bool>(entry.Text,
                                                                                                   () => entry.Enabled, value => entry.Enabled = value, canParseBool, bool.Parse));
                    }

                    editInterface.addSubInterface(debugEditInterface);
                }

                objectEditor.EditInterface = editInterface;

                createDebugVisualizers();
            }
        }
コード例 #23
0
 protected override void createEditInterface()
 {
     editInterface = new EditInterface(Type);
     editInterface.addSubInterface(CameraStartPosition.getEditInterface("Start Position", ReflectedEditInterface.DefaultScanner));
     editInterface.addSubInterface(CameraEndPosition.getEditInterface("End Position", ReflectedEditInterface.DefaultScanner));
     editInterface.IconReferenceTag = Icon;
 }
コード例 #24
0
 /// <summary>
 /// Get an EditInterface.
 /// </summary>
 /// <returns>An EditInterface for the definition or null if there is not interface.</returns>
 public EditInterface getEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = ReflectedEditInterface.createEditInterface(this, memberScanner, name + " Ogre Scene", null);
     }
     return(editInterface);
 }
コード例 #25
0
 protected override EditInterface createEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = ReflectedEditInterface.createEditInterface(this, String.Format("{0} - IK Drag Control", Name));
     }
     return(editInterface);
 }
コード例 #26
0
 public EditInterface getEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = ReflectedEditInterface.createEditInterface(this, EditInterfaceName);
     }
     return(editInterface);
 }
コード例 #27
0
 public override void customizeEditInterface(EditInterface editInterface, EditInterfaceManager <MvcController> itemEdits)
 {
     editInterface.IconReferenceTag = "MvcContextEditor/ControllerIcon";
     addItemCreation("Add Controller", delegate(String name)
     {
         return(new MvcController(name));
     });
 }
コード例 #28
0
 public override EditInterface getEditInterface()
 {
     if (editInterface == null)
     {
         editInterface = new EditInterface("Show Popup Image");
     }
     return(editInterface);
 }
コード例 #29
0
 public ExpandingGenericEditorView(String name, EditInterface editInterface, EditorController editorController, GuiFrameworkUICallback editUICallback, bool horizontalAlignment = false)
     : base(name)
 {
     this.EditInterface       = editInterface;
     this.HorizontalAlignment = horizontalAlignment;
     this.EditorController    = editorController;
     this.EditUICallback      = editUICallback;
 }
コード例 #30
0
        private void showPlaceholder(ObjectPlaceholderInterface placeholder)
        {
            Object        currentObject = placeholder.getObject();
            EditInterface edit          = placeholder.getObjectEditInterface(currentObject);

            objectEditor.setEditInterface(edit, currentObject, placeholder.uiFieldUpdateCallback);
            currentPlaceholder = placeholder;
        }