Inheritance: MonoHotDraw.Tools.AbstractTool
Beispiel #1
0
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            Build ();

            View = new StandardDrawingView (this);
            scrolledwindow.Add((Widget) View);
            Tool = new SelectionTool(this);
        }
Beispiel #2
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();
            };
        }
        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 (); };
        }