Esempio n. 1
0
        public SteticComponent()
        {
            this.Build();

            View = new StandardDrawingView (this);
            this.scrolledwindow.Add ((Widget) View);
            Tool = new SelectionTool (this);
            UndoManager = new UndoManager();
            UndoManager.StackChanged += delegate {
                OnUndoStackChanged();
            };
        }
        protected AbstractDesigner(int undoBufferSize)
        {
            tool = new SelectionTool (this);
            View = new StandardDrawingView (this);
            UndoBufferSize = undoBufferSize;

            UndoManager = new UndoManager (UndoBufferSize);
            UndoManager.StackChanged += delegate {
                OnStackChanged ();
            };

            CommandList = new List<ICommand> ();
            RebuildCommandList ();

            window = new ScrolledWindow ();
            window.Add ((Widget) View);
            window.ShowAll ();
        }
Esempio n. 3
0
        public override void Execute()
        {
            base.Execute();
            UndoManager manager = DrawingEditor.UndoManager;

            if ((manager == null) || manager.Redoable == false)
            {
                return;
            }

            IUndoActivity lastRedoable = manager.PopRedo();
            // Execute redo
            bool hasBeenRedone = lastRedoable.Redo();

            // Add to undo stack
            if (hasBeenRedone && lastRedoable.Undoable)
            {
                manager.PushUndo(lastRedoable);
            }
        }
Esempio n. 4
0
        // TODO: Make more readable.
        public override void Execute()
        {
            base.Execute();
            UndoManager manager = DrawingEditor.UndoManager;

            if (manager == null || manager.Undoable == false)
            {
                return;
            }

            IUndoActivity lastUndoable = manager.PopUndo();
            // Execute undo
            bool hasBeenUndone = lastUndoable.Undo();

            // Add to redo
            if (hasBeenUndone && lastUndoable.Redoable)
            {
                manager.PushRedo(lastUndoable);
            }

            //lastUndoable.getDrawingView().checkDamage();
            //DrawingEditor.fre getDrawingEditor().figureSelectionChanged(lastUndoable.getDrawingView());
        }
        public ModelerCanvas()
        {
            this.ContentName = GettextCatalog.GetString ("DB Modeler");
            this.IsViewOnly = true;
            //Create model view-controller environment
            View = new StandardDrawingView (this);
            _controller = new modelController (View,this);

            //Create database designer canvas environment
            widget = new ModelerCanvasWidget (this, _controller);
            widget.getScroller ().SetSizeRequest (200, 200);
            widget.getScroller ().BorderWidth = 1;
            widget.getScroller ().Add ((Widget)View);
            Tool = new SelectionTool (this);
            widget.getScroller ().ShowAll ();

            //Add drag and drop support
            TargetEntry[] te2 = new TargetEntry[] { new Gtk.TargetEntry ("table/relationship", 0, 7777) };
            ScrolledWindow xscroller = widget.getScroller ();
            Gtk.Drag.DestSet (xscroller, DestDefaults.All, te2, Gdk.DragAction.Copy);
            xscroller.DragDataReceived += OnDragDataReceived;

            //todo: fix this undo manager
            _undoManager = new UndoManager ();
            UndoManager.StackChanged += delegate { UpdateUndoRedoSensitiveness (); };
        }