예제 #1
0
        private void InitForm()
        {
            Debug.WriteLine("Initializing UI objects.");

            #region Menubar
            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            DefaultMenuItem exampleMenuItem1 = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(exampleMenuItem1);

            DefaultMenuItem exampleMenuItem11 = new DefaultMenuItem("New Mindmap");
            exampleMenuItem1.AddMenuItem(exampleMenuItem11);
            DefaultMenuItem exampleMenuItem12 = new DefaultMenuItem("Open Mindmap");
            exampleMenuItem1.AddMenuItem(exampleMenuItem12);
            DefaultMenuItem exampleMenuItem13 = new DefaultMenuItem("Close");
            exampleMenuItem1.AddMenuItem(exampleMenuItem13);

            DefaultMenuItem exampleMenuItem2 = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(exampleMenuItem2);

            DefaultMenuItem exampleMenuItem21 = new DefaultMenuItem("Add Proccess");
            exampleMenuItem2.AddMenuItem(exampleMenuItem21);

            DefaultMenuItem exampleMenuItem3 = new DefaultMenuItem("Export");
            this.menubar.AddMenuItem(exampleMenuItem3);

            #endregion
        }
예제 #2
0
        private void InitUI()
        {
            Debug.WriteLine("Initializing UI objects.");

            #region Editor and Canvas

            Debug.WriteLine("Loading canvas...");
            this.editor = new DefaultEditor();
            this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.editor);

            ICanvas canvas1 = new DefaultCanvas();
            canvas1.Name = "Untitled-1";
            this.editor.AddCanvas(canvas1);

            ICanvas canvas2 = new DefaultCanvas();
            canvas2.Name = "Untitled-2";
            this.editor.AddCanvas(canvas2);

            #endregion

            #region Commands

            //BlackCanvasBgCommand blackCanvasBgCmd = new BlackCanvasBgCommand(this.canvas);
            //WhiteCanvasBgCommand whiteCanvasBgCmd = new WhiteCanvasBgCommand(this.canvas);

            #endregion

            #region Menubar

            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            DefaultMenuItem fileMenuItem = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(fileMenuItem);

            DefaultMenuItem newMenuItem = new DefaultMenuItem("New");
            fileMenuItem.AddMenuItem(newMenuItem);
            fileMenuItem.AddSeparator();
            DefaultMenuItem exitMenuItem = new DefaultMenuItem("Exit");
            fileMenuItem.AddMenuItem(exitMenuItem);

            DefaultMenuItem editMenuItem = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(editMenuItem);

            DefaultMenuItem undoMenuItem = new DefaultMenuItem("Undo");
            editMenuItem.AddMenuItem(undoMenuItem);
            DefaultMenuItem redoMenuItem = new DefaultMenuItem("Redo");
            editMenuItem.AddMenuItem(redoMenuItem);

            DefaultMenuItem viewMenuItem = new DefaultMenuItem("View");
            this.menubar.AddMenuItem(viewMenuItem);

            DefaultMenuItem helpMenuItem = new DefaultMenuItem("Help");
            this.menubar.AddMenuItem(helpMenuItem);

            DefaultMenuItem aboutMenuItem = new DefaultMenuItem("About");
            helpMenuItem.AddMenuItem(aboutMenuItem);

            #endregion

            #region Toolbox

            // Initializing toolbox
            Debug.WriteLine("Loading toolbox...");
            this.toolbox = new DefaultToolbox();
            this.toolStripContainer1.LeftToolStripPanel.Controls.Add((Control)this.toolbox);
            this.editor.Toolbox = toolbox;

            #endregion

            #region Tools

            // Initializing tools
            Debug.WriteLine("Loading tools...");
            this.toolbox.AddTool(new SelectionTool());
            this.toolbox.AddSeparator();
            this.toolbox.AddTool(new LineTool());
            this.toolbox.AddTool(new RectangleTool());
            this.toolbox.AddTool(new TextTool());
            this.toolbox.ToolSelected += Toolbox_ToolSelected;

            #endregion

            #region Toolbar

            // Initializing toolbar
            Debug.WriteLine("Loading toolbar...");
            this.toolbar = new DefaultToolbar();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbar);

            ExampleToolbarItem toolItem1 = new ExampleToolbarItem();
            //toolItem1.SetCommand(whiteCanvasBgCmd);
            ExampleToolbarItem toolItem2 = new ExampleToolbarItem();
            //toolItem2.SetCommand(blackCanvasBgCmd);

            this.toolbar.AddToolbarItem(toolItem1);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(toolItem2);

            #endregion
        }
예제 #3
0
        private void InitUI()
        {
            Debug.WriteLine("Initializing UI objects.");

            #region Canvas
            Debug.WriteLine("Loading canvas...");
            this.canvas = new DefaultCanvas();
            this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.canvas);
            #endregion

            #region Commands

            BlackCanvasBgCommands blackCanvasBgCommands = new BlackCanvasBgCommands(this.canvas);
            WhiteCanvasBgCommands whiteCanvasBgCommands = new WhiteCanvasBgCommands(this.canvas);

            #endregion

            #region Menubar
            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            DefaultMenuItem fileMenuItem = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(fileMenuItem);

            DefaultMenuItem newMenuItem = new DefaultMenuItem("New");
            fileMenuItem.AddMenuItem(newMenuItem);

            DefaultMenuItem editMenuItem = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(editMenuItem);

            DefaultMenuItem changeToBlackMenuItem = new DefaultMenuItem("Change to Black");
            changeToBlackMenuItem.SetCommand(blackCanvasBgCommands);
            editMenuItem.AddMenuItem(changeToBlackMenuItem);

            DefaultMenuItem changeToWhiteMenuItem = new DefaultMenuItem("Change to White");
            changeToWhiteMenuItem.SetCommand(whiteCanvasBgCommands);
            editMenuItem.AddMenuItem(changeToWhiteMenuItem);

            #endregion

            #region Toolbox

            // Initializing toolbox
            Debug.WriteLine("Loading toolbox...");
            this.toolbox = new DefaultToolbox();
            this.toolStripContainer1.LeftToolStripPanel.Controls.Add((Control)this.toolbox);

            #endregion

            #region Tools

            // Initializing tools
            Debug.WriteLine("Loading tools...");
            this.toolbox.AddTool(new SelectionTool());
            this.toolbox.AddSeparator();
            this.toolbox.AddTool(new LineTool());
            this.toolbox.AddTool(new RectangleTool());
            this.toolbox.AddTool(new TextTool());
            this.toolbox.AddTool(new ConnectorTool());
            this.toolbox.ToolSelected += Toolbox_ToolSelected;

            #endregion

            #region Toolbar
            // Initializing toolbar
            Debug.WriteLine("Loading toolbar...");
            this.toolbar = new DefaultToolbar();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbar);

            ExampleToolbarItem whiteBackgroundTool = new ExampleToolbarItem();
            whiteBackgroundTool.SetCommand(whiteCanvasBgCommands);
            ExampleToolbarItem blackBackgroundTool = new ExampleToolbarItem();
            blackBackgroundTool.SetCommand(blackCanvasBgCommands);

            this.toolbar.AddToolbarItem(whiteBackgroundTool);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(blackBackgroundTool);
            #endregion
        }
예제 #4
0
        private void InitUI()
        {
            Debug.WriteLine("Initializing UI objects.");

            IPanel canvas1 = new DefaultPanel();

            #region Toolbar

            // Initializing toolbar
            Debug.WriteLine("Loading toolbar...");
            this.toolbar = new DefaultToolbar();
            this.toolStripContainer1.TopToolStripPanel.Controls.Add((Control)this.toolbar);

            UnDoRedo undoredo = new UnDoRedo();

            ToolbarItem toolItem1 = new ToolbarItem("undo", IconSet.undo, canvas1);
            toolItem1.UnDoObject = undoredo;
            //toolItem1.SetCommand(whiteCanvasBgCmd);
            ToolbarItem toolItem2 = new ToolbarItem("redo", IconSet.redo, canvas1);
            toolItem2.UnDoObject = undoredo;
            //toolItem2.SetCommand(blackCanvasBgCmd);

            this.toolbar.AddToolbarItem(toolItem1);
            this.toolbar.AddSeparator();
            this.toolbar.AddToolbarItem(toolItem2);

            #endregion

            #region Editor and Panel
            Debug.WriteLine("Loading panel...");
            this.editor = new DefaultEditor();
            this.toolStripContainer1.ContentPanel.Controls.Add((Control)this.editor);


            canvas1.Name       = "Untitled-1";
            canvas1.UnDoObject = undoredo;
            this.editor.AddCanvas(canvas1);

            /*IPanel canvas2 = new DefaultPanel();
             * canvas2.Name = "Untitled-2";
             * this.editor.AddCanvas(canvas2);*/
            #endregion

            #region Menubar
            Debug.WriteLine("Loading menubar...");
            this.menubar = new DefaultMenubar();
            this.Controls.Add((Control)this.menubar);

            DefaultMenuItem exampleMenuItem1 = new DefaultMenuItem("File");
            this.menubar.AddMenuItem(exampleMenuItem1);

            DefaultMenuItem exampleMenuItem11 = new DefaultMenuItem("New Mindmap");
            exampleMenuItem1.AddMenuItem(exampleMenuItem11);
            DefaultMenuItem exampleMenuItem12 = new DefaultMenuItem("Open Mindmap");
            exampleMenuItem1.AddMenuItem(exampleMenuItem12);
            DefaultMenuItem exampleMenuItem13 = new DefaultMenuItem("Close");
            exampleMenuItem1.AddMenuItem(exampleMenuItem13);

            DefaultMenuItem exampleMenuItem2 = new DefaultMenuItem("Edit");
            this.menubar.AddMenuItem(exampleMenuItem2);

            DefaultMenuItem exampleMenuItem21 = new DefaultMenuItem("Add Proccess");
            exampleMenuItem2.AddMenuItem(exampleMenuItem21);

            DefaultMenuItem exampleMenuItem3 = new DefaultMenuItem("Export");
            this.menubar.AddMenuItem(exampleMenuItem3);
            DefaultMenuItem exampleMenuItem31 = new DefaultMenuItem("Image");
            exampleMenuItem3.AddMenuItem(exampleMenuItem31);
            DefaultMenuItem exampleMenuItem311 = new DefaultMenuItem("JPEG");
            exampleMenuItem31.AddMenuItem(exampleMenuItem311);
            DefaultMenuItem exampleMenuItem312 = new DefaultMenuItem("PNG");
            exampleMenuItem31.AddMenuItem(exampleMenuItem312);
            DefaultMenuItem exampleMenuItem32 = new DefaultMenuItem("PDF");
            exampleMenuItem3.AddMenuItem(exampleMenuItem32);
            #endregion

            #region Toolbox

            // Initializing toolbox
            Debug.WriteLine("Loading toolbox...");
            this.toolbox = new DefaultToolbox();
            this.toolStripContainer1.LeftToolStripPanel.Controls.Add((Control)this.toolbox);
            //this.editor.Toolbox = toolbox;

            #endregion

            #region Tools

            // Initializing tools
            Debug.WriteLine("Loading tools...");
            ITool selectionTool = new SelectionTool();
            selectionTool.UnDoObject = undoredo;
            this.toolbox.AddTool(selectionTool);
            this.toolbox.AddSeparator();
            this.toolbox.AddTool(new LineTool());
            this.toolbox.AddTool(new RectangleTool());
            this.toolbox.AddTool(new TextTool());
            this.toolbox.ToolSelected += Toolbox_ToolSelected;
            #endregion
        }