Пример #1
0
            public override void onPostEdit(SimSet selection)
            {
                if (!this.pendingGenericUndoAction.isObject())
                    Util._error("Error: attempting to complete a GenericUndoAction that hasn't been started!");

                GuiEditorUndo.GenericUndoAction act = this.pendingGenericUndoAction;
                this.pendingGenericUndoAction = "";

                bool diffs = act.learnSet(selection);
                if (diffs)
                    {
                    //echo("adding generic undoaction to undo manager");
                    //%act.dump();
                    act.addToManager(this.getUndoManager());
                    }
                else
                    {
                    //echo("deleting empty generic undoaction");
                    act.delete();
                    }

                this.updateUndoMenu();
            }
Пример #2
0
            public override void onPreEdit(SimSet selection)
            {
                GuiEditorTreeView GuiEditorTreeView = "GuiEditorTreeView";
                GuiEditorUndo.GenericUndoAction GenericUndoAction = "GenericUndoAction";

                if (this.pendingGenericUndoAction.isObject())
                    {
                    Util._error("Error: attempting to create two generic undo actions at once in the same editor!");
                    return;
                    }

                //echo("pre edit");
                GuiEditorUndo.GenericUndoAction act = GenericUndoAction.create();
                act.watchSet(selection);
                act["tree"] = GuiEditorTreeView;

                this.pendingGenericUndoAction = act;

                this.updateUndoMenu();
            }