Example #1
0
        public BlockController(Graphics textMetrics, Font textFont, Size canvasSize, Func<TextBox> textBoxMaker)
        {
            this.Modified += delegate(object sender) { };
            blockSpace = new BlockSpace();
            blockSpace.OnTopLevelAdded += new TopLevelEvent(blockSpace_OnTopLevelAdded);
            blockSpace.OnTopLevelDeleted += new TopLevelEvent(blockSpace_OnTopLevelDeleted);
            blockSpace.OnTopLevelMoved += new TopLevelEvent(blockSpace_OnTopLevelMoved);

            palette = new Palette(new Size(canvasSize.Width - 20, 60), textMetrics, textFont);
            palette.Modified += new PaletteModifiedEvent(palette_Modified);

            canvasView = new CanvasView(textMetrics, canvasSize, allViews, DropRegions, textFont, palette);
            this.canvasSize = canvasSize;
            state = CanvasState.Ready;
            viewFactory = new BlockViewFactory(textMetrics, textFont, blockSpace, blockViews,
                ()=>Modified(this));

            this.textBoxMaker = textBoxMaker;
        }
Example #2
0
        public BlockController(Graphics textMetrics, Font textFont, Size canvasSize, Func <TextBox> textBoxMaker)
        {
            this.Modified += delegate(object sender) { };
            blockSpace     = new BlockSpace();
            blockSpace.OnTopLevelAdded   += new TopLevelEvent(blockSpace_OnTopLevelAdded);
            blockSpace.OnTopLevelDeleted += new TopLevelEvent(blockSpace_OnTopLevelDeleted);
            blockSpace.OnTopLevelMoved   += new TopLevelEvent(blockSpace_OnTopLevelMoved);

            palette           = new Palette(new Size(canvasSize.Width - 20, 60), textMetrics, textFont);
            palette.Modified += new PaletteModifiedEvent(palette_Modified);

            canvasView      = new CanvasView(textMetrics, canvasSize, allViews, DropRegions, textFont, palette);
            this.canvasSize = canvasSize;
            state           = CanvasState.Ready;
            viewFactory     = new BlockViewFactory(textMetrics, textFont, blockSpace, blockViews,
                                                   () => Modified(this));

            this.textBoxMaker = textBoxMaker;
        }