示例#1
0
文件: GUI.cs 项目: Paludan/P2-A403
        /// <summary>
        /// Creates tab and adds it to the tab panel
        /// </summary>
        private void addGraph_Click(object sender, EventArgs e)
        {
            if (pTabs.Controls.Count < 6)
            {
                GraphPage addThis = GenerateTabPage();

                //Lav funktion, der tager delegate og fjernes graphhandleren
                addThis.AddToClose(RemoveGHOnClose);

                pTabs.Controls.Add(addThis);
            }
        }
示例#2
0
文件: GUI.cs 项目: Paludan/P2-A403
        /// <summary>
        /// Creates the tab with its own graphHandler and masterGraphPanel
        /// </summary>
        /// <returns>A new graphPage</returns>
        private GraphPage GenerateTabPage()
        {
            var          mgp      = new P2Graph.MasterGraphPanel(628, 487);
            GraphHandler newGH    = new GraphHandler(mgp);
            GraphPage    testPage = new GraphPage(mgp);

            testPage.gh = newGH;
            synth.graphHandlers.Add(newGH);
            testPage.Location = new System.Drawing.Point(4, 22);
            testPage.Name     = "graphTab" + pTabs.Controls.Count + 1;
            testPage.Padding  = new System.Windows.Forms.Padding(3);
            testPage.Size     = new System.Drawing.Size(509, 384);
            testPage.Text     = "Graf " + (pTabs.Controls.Count + 1);
            testPage.UseVisualStyleBackColor = true;

            return(testPage);
        }