示例#1
0
        /// <summary>
        /// Loads dock objects, initializes the project tree and loads some other variables.
        /// </summary>
        private void FormLoad()
        {
            //Current Directory
            appDirectory=Application.StartupPath;

            IsProjectOpen=false;
            showErrors=true;
            showWarnings=true;

            //

            // Tree
            projectFilesTree=new NETXP.Controls.TreeViewEx();
            projectFilesTree.ImageIndex = -1;
            projectFilesTree.Location = new System.Drawing.Point(0,0);
            projectFilesTree.Size=new Size(175,320);
            projectFilesTree.Dock=System.Windows.Forms.DockStyle.Left;
            projectFilesTree.Name = "projectFilesTree";
            projectFilesTree.SelectedImageIndex = -1;
            projectFilesTree.TabIndex = 4;
            projectFilesTree.ImageList=treeImageList;
            projectFilesTree.HideSelection=false;
            projectFilesTree.MouseDown+=new MouseEventHandler(projectFilesTree_MouseDown);
            projectFilesTree.AfterExpand+=new TreeViewEventHandler(projectFilesTree_AfterExpand);
            projectFilesTree.AfterCollapse+=new TreeViewEventHandler(projectFilesTree_AfterCollapse);

            // TempErrorList
            tempErrorList=new ArrayList(20);

            // ErrorList
            errorList = new ErrorListView();
            errorList.Dock = System.Windows.Forms.DockStyle.Bottom;
            errorList.FullRowSelect = true;
            errorList.GridLines = true;
            errorList.Location = new System.Drawing.Point(0,320);
            errorList.Name = "errorList";
            errorList.Size = new System.Drawing.Size(792, 170);
            errorList.TabIndex = 8;
            errorList.View = System.Windows.Forms.View.Details;
            errorList.SmallImageList = treeImageList;
            errorList.ItemActivate+=new EventHandler(errorList_ItemActivate);

            ColumnHeader errorSymbolColumn = new System.Windows.Forms.ColumnHeader();
            ColumnHeader messageColumn  = new System.Windows.Forms.ColumnHeader();
            ColumnHeader lineNumberColumn  = new System.Windows.Forms.ColumnHeader();
            ColumnHeader fileNameColumn  = new System.Windows.Forms.ColumnHeader();

            errorSymbolColumn.Text=" ! ";
            errorSymbolColumn.Width=25;

            messageColumn.Text="Message";
            messageColumn.Width=200;
            messageColumn.TextAlign=HorizontalAlignment.Left;

            lineNumberColumn.Text="Line";
            lineNumberColumn.Width=70;
            lineNumberColumn.TextAlign=HorizontalAlignment.Center;

            fileNameColumn.Text="File";
            fileNameColumn.Width=400;
            fileNameColumn.TextAlign=HorizontalAlignment.Left;

            errorList.Columns.AddRange(new ColumnHeader[] {errorSymbolColumn,messageColumn,lineNumberColumn,fileNameColumn});

            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(GetType());

            // OutputWindow
            dockingManagerExtender.SetAllowDocking(outputWindow, true);
            dockingManagerExtender.SetFullTitle(outputWindow, "Output");
            dockingManagerExtender.SetIcon(outputWindow, ((System.Drawing.Image)(resources.GetObject("viewOutputWindow.Image"))));
            dockingManagerExtender.SetTitle(outputWindow, "Output");
            dockingManagerExtender.SetCloseOnHide(outputWindow,false);
            dockingManagerExtender.SetTabbedMode(outputWindow,true);

            // ErrorList
            dockingManagerExtender.SetAllowDocking(errorList, true);
            dockingManagerExtender.SetFullTitle(errorList, "Error List");
            dockingManagerExtender.SetIcon(errorList, ((System.Drawing.Image)(resources.GetObject("viewErrorList.Image"))));
            dockingManagerExtender.SetTitle(errorList, "Error List");
            dockingManagerExtender.SetCloseOnHide(errorList,false);
            dockingManagerExtender.SetTabbedMode(errorList,true);

            // ToolBox
            dockingManagerExtender.SetAllowDocking(toolBox, true);
            dockingManagerExtender.SetFullTitle(toolBox, "Toolbox");
            dockingManagerExtender.SetIcon(toolBox, ((System.Drawing.Image)(resources.GetObject("viewToolBox.Image"))));
            dockingManagerExtender.SetTitle(toolBox, "Toolbox");
            dockingManagerExtender.SetCloseOnHide(toolBox,false);
            dockingManagerExtender.SetTabbedMode(toolBox,true);

            //Tree
            dockingManagerExtender.SetAllowDocking(projectFilesTree, true);
            dockingManagerExtender.SetFullTitle(projectFilesTree, "Project Files");
            dockingManagerExtender.SetIcon(projectFilesTree, ((System.Drawing.Image)(resources.GetObject("viewProjectFiles.Image"))));
            dockingManagerExtender.SetTitle(projectFilesTree, "Project Files");
            dockingManagerExtender.SetCloseOnHide(projectFilesTree,false);
            dockingManagerExtender.SetTabbedMode(projectFilesTree,true);

            // Property Window
            dockingManagerExtender.SetAllowDocking(propertiesWindow, true);
            dockingManagerExtender.SetFullTitle(propertiesWindow, "Properties");
            dockingManagerExtender.SetIcon(propertiesWindow, ((System.Drawing.Image)(resources.GetObject("viewPropertiesWindow.Image"))));
            dockingManagerExtender.SetTitle(propertiesWindow, "Properties");
            dockingManagerExtender.SetCloseOnHide(propertiesWindow,false);
            dockingManagerExtender.SetTabbedMode(propertiesWindow,true);
        }
示例#2
0
        /// <summary>
        /// Contructor for this class
        /// </summary>
        private ProjectManagerClass()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Project Options Dialog Box Initialzation
            TreeNode projectOptionsFolderNode=new System.Windows.Forms.TreeNode("Project Options", 1, 1);
            projectOptionsFolderNode.Tag=true;
            optionsTree.Nodes.Add(projectOptionsFolderNode);
            TreeNode libraryOptionsNode=new System.Windows.Forms.TreeNode("Library Options", 0, 2);
            libraryOptionsNode.Tag=false;
            TreeNode advancedOptionsNode=new System.Windows.Forms.TreeNode("Advanced Options", 0, 2);
            advancedOptionsNode.Tag=false;
            projectOptionsFolderNode.Nodes.AddRange(new TreeNode[]{libraryOptionsNode,advancedOptionsNode});

            // Project variables intialization
            isProjectModified=false;
            projectFilesTree=MainFormClass.MainForm.ProjectFilesTree;

            projectFilesTree.AfterLabelEdit+=new NodeLabelEditEventHandler(projectFilesTree_AfterLabelEdit);
            projectFilesTree.DoubleClick+=new EventHandler(projectFilesTree_DoubleClick);

            projectFilesTree.ContextMenu=projectContextMenu;

            // GCC Output controls initialization
            outputWindow=MainFormClass.MainForm.OutputWindow;
            errorList=MainFormClass.MainForm.ErrorList;

            // Setting GCC Path
            //gccPath=MainFormClass.MainForm.AppDirectory+"\\avr-gcc\\bin";

            // Loading the libraries Assembly
            //libAssembly=AppDomain.CurrentDomain.Load("MegaLib");
            libAssembly=Assembly.Load("MegaLib");
            megaLibVersion=libAssembly.FullName.Substring(libAssembly.FullName.IndexOf("Version=")+8,7);
            //MessageBox.Show(libAssembly.FullName+"| |"+megaLibVersion+"|");

            // Library Options Box Initializations
            libraryOptionsBoxHeading="Library Options";
            libraryOptionsBoxText="Select only the libraries you need. Selecting unnecessary libraries will increase code size and device programming time.";

            // Initializing Liblist
            libList=new ArrayList(32);

            //Serial Port
            serialPort=new serialportcomm.RS232();
            serialPort.Timeout=50;
        }