void ReadyToDisplay() { this.Cursor = Cursors.Default; mgr = new VersioningManager(); int[] edversion = System.Reflection.Assembly.GetExecutingAssembly().GetVersionInts(); System.Diagnostics.Debug.Assert(edversion != null); ReadLocalFiles(mgr, managedownloadmode); if (managedownloadmode) { mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/V1", downloadactfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File"); mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "AddonFiles/V1", downloadaddonfolder, EDDOptions.Instance.AppDataDirectory, "*.inf", edversion, "Other File"); #if DEBUG mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/Debug", downloadactdebugfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File"); #endif } mgr.Sort(); panelVScroll.RemoveAllControls(); // blank panelVScroll.SuspendLayout(); int[] tabs; if (managedownloadmode) { // type, n, ver des stat act, del, ena tabs = new int[] { 0, 80, 280, 360, 560, 660, 760, 820, 880 } } ; else { tabs = new int[] { 0, 80, 280, 360, 560, 560, 660, 720, 780 } }; var theme = ExtendedControls.Theme.Current; int fonth = (int)theme.GetFont.GetHeight() + 1; int headervsize = fonth + panelheightmargin + 2; int vpos = headervsize + 8; // draw everything in 8.25 point position then scale int maxpanelwidth = 0; foreach (VersioningManager.DownloadItem di in mgr.DownloadItems) { Group g = new Group(); g.di = di; g.panel = new Panel(); g.panel.BorderStyle = BorderStyle.FixedSingle; g.panel.Tag = g; g.panel.MouseEnter += MouseEnterControl; g.type = new Label(); g.type.Location = new Point(tabs[0], labelheightmargin); // 8 spacing, allow 8*4 to indent g.type.Size = new Size(tabs[1] - tabs[0], 24); g.type.Text = di.itemtype; g.panel.Controls.Add(g.type); g.info = new ExtendedControls.ExtButton(); g.info.Location = new Point(tabs[1], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.info.Size = new Size(16, 16); g.info.Text = "i"; g.info.Click += Info_Click; g.info.Tag = g; g.panel.Controls.Add(g.info); g.name = new Label(); g.name.Location = new Point(tabs[1] + 32, labelheightmargin); // 8 spacing, allow 8*4 to indent g.name.Size = new Size(tabs[2] - tabs[1] - 32, 24); g.name.Text = di.itemname; g.panel.Controls.Add(g.name); g.version = new Label(); g.version.Location = new Point(tabs[2], labelheightmargin); // 8 spacing, allow 8*4 to indent g.version.Size = new Size(tabs[3] - tabs[2], 24); g.version.Text = (di.localversion != null) ? di.localversion.ToString(".") : "N/A"; g.panel.Controls.Add(g.version); g.shortdesc = new Label(); g.shortdesc.Location = new Point(tabs[3], labelheightmargin); // 8 spacing, allow 8*4 to indent g.shortdesc.Size = new Size(tabs[4] - tabs[3], 24); g.shortdesc.Text = di.ShortLocalDescription; if (g.shortdesc.Text.Length == 0) { g.shortdesc.Text = "N/A"; } g.panel.Controls.Add(g.shortdesc); if (managedownloadmode) { bool isversion = false; string text; if (di.state == VersioningManager.ItemState.EDOutOfDate) { text = "Newer EDD required".T(EDTx.AddOnManagerForm_Newer); } else if (di.state == VersioningManager.ItemState.EDTooOld) { text = "Too old for EDD".T(EDTx.AddOnManagerForm_Old); } else if (di.state == VersioningManager.ItemState.UpToDate) { text = (di.localmodified) ? "Locally modified".T(EDTx.AddOnManagerForm_Locallymodified) : "Up to Date".T(EDTx.AddOnManagerForm_UptoDate); } else if (di.state == VersioningManager.ItemState.LocalOnly) { text = "Local Only".T(EDTx.AddOnManagerForm_LocalOnly); } else if (di.state == VersioningManager.ItemState.NotPresent) { isversion = true; text = "Version".T(EDTx.AddOnManagerForm_Version) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } else { isversion = true; text = "New version".T(EDTx.AddOnManagerForm_Newversion) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } g.actionlabel = new Label(); g.actionlabel.Location = new Point(tabs[4], labelheightmargin); // 8 spacing, allow 8*4 to indent g.actionlabel.Size = new Size(tabs[5] - tabs[4], 24); g.actionlabel.Text = text; g.panel.Controls.Add(g.actionlabel); if (isversion) { g.actionbutton = new ExtendedControls.ExtButton(); g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.actionbutton.Size = new Size(tabs[6] - tabs[5] - 20, 24); g.actionbutton.Text = (di.state == VersioningManager.ItemState.NotPresent) ? "Install".T(EDTx.AddOnManagerForm_Install) : "Update".T(EDTx.AddOnManagerForm_Update); g.actionbutton.Click += Actionbutton_Click; g.actionbutton.Tag = g; g.panel.Controls.Add(g.actionbutton); } } else { bool loaded = CheckActionLoaded != null?CheckActionLoaded(g.di.itemname) : false; if (loaded) // may not be loaded IF its got an error. { if (!di.localnoteditable) { g.actionbutton = new ExtendedControls.ExtButton(); g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.actionbutton.Size = new Size(tabs[6] - tabs[5] - 20, 24); g.actionbutton.Text = "Edit".T(EDTx.AddOnManagerForm_Edit); g.actionbutton.Click += ActionbuttonEdit_Click; g.actionbutton.Tag = g; g.panel.Controls.Add(g.actionbutton); } } } if (di.HasLocalCopy) { g.deletebutton = new ExtendedControls.ExtButton(); g.deletebutton.Location = new Point(tabs[6], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.deletebutton.Size = new Size(24, 24); g.deletebutton.Text = "X"; g.deletebutton.Click += Deletebutton_Click; g.deletebutton.Tag = g; g.panel.Controls.Add(g.deletebutton); } if (di.localenable.HasValue) { g.enabled = new ExtendedControls.ExtCheckBox(); g.enabled.Location = new Point(tabs[7], labelheightmargin - 4); g.enabled.Size = new Size(tabs[8] - tabs[7], 24); g.enabled.Text = ""; g.enabled.Checked = di.localenable.Value; g.enabled.Click += Enabled_Click; g.enabled.Tag = g; g.enabled.Enabled = !di.localnotdisableable; g.panel.Controls.Add(g.enabled); } g.panel.Location = new Point(panelleftmargin, vpos); g.panel.Size = g.panel.FindMaxSubControlArea(4, 4); maxpanelwidth = Math.Max(maxpanelwidth, g.panel.Width); panelVScroll.Controls.Add(g.panel); vpos += g.panel.Height + 4; } foreach (Control c in panelVScroll.Controls) // set all the sub items, which are panels, to max panel width { c.Width = maxpanelwidth; } // then add the titles panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[0] + panelleftmargin, panelheightmargin), Size = new Size(tabs[1] - tabs[0] - 2, headervsize), Text = "Type".T(EDTx.AddOnManagerForm_Type) }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[1] + panelleftmargin, panelheightmargin), Size = new Size(tabs[2] - tabs[1] - 2, headervsize), Text = "Name".T(EDTx.AddOnManagerForm_Name) }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[2] + panelleftmargin, panelheightmargin), Size = new Size(tabs[3] - tabs[2] - 2, headervsize), Text = "Version".T(EDTx.AddOnManagerForm_Version) }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[3] + panelleftmargin, panelheightmargin), Size = new Size(tabs[4] - tabs[3] - 2, headervsize), Text = "Description".T(EDTx.AddOnManagerForm_Description) }); if (managedownloadmode) { panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[4] + panelleftmargin, panelheightmargin), Size = new Size(tabs[5] - tabs[4] - 2, headervsize), Text = "Status".T(EDTx.AddOnManagerForm_Status) }); } panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[5] + panelleftmargin, panelheightmargin), Size = new Size(tabs[6] - tabs[5] - 2, headervsize), Text = "Action".T(EDTx.AddOnManagerForm_Action) }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[6] + panelleftmargin, panelheightmargin), Size = new Size(tabs[7] - tabs[6] - 2, headervsize), Text = "Delete".T(EDTx.AddOnManagerForm_Delete) }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[7] + panelleftmargin, panelheightmargin), Size = new Size(tabs[8] - tabs[7] - 2, headervsize), Text = "Enabled".T(EDTx.AddOnManagerForm_Enabled) }); if (!managedownloadmode) // add on a more button if in edit pack mode { ExtendedControls.ExtButton dynmore = new ExtendedControls.ExtButton(); dynmore.Size = new System.Drawing.Size(24, 24); dynmore.Text = "+"; dynmore.Click += new System.EventHandler(this.buttonMore_Click); dynmore.UseVisualStyleBackColor = true; dynmore.Location = new Point(panelleftmargin, vpos); panelVScroll.Controls.Add(dynmore); } panelVScroll.Scale(this.CurrentAutoScaleFactor()); // scale newly added children to form theme.ApplyStd(panelVScroll); panelVScroll.ResumeLayout(); } bool infoclicked = false;
void ReadyToDisplay() { panelVScroll.RemoveAllControls(new List <Control>() { buttonMore }); mgr = new VersioningManager(); int[] edversion = System.Reflection.Assembly.GetExecutingAssembly().GetVersion(); System.Diagnostics.Debug.Assert(edversion != null); mgr.ReadLocalFiles(EDDOptions.Instance.AppDataDirectory, "Actions", "*.act", "Action File"); if (managedownloadmode) { mgr.ReadLocalFiles(EDDOptions.Instance.AppDataDirectory, "Flights", "*.vid", "Video File"); mgr.ReadLocalFiles(EDDOptions.Instance.AppDataDirectory, "AddonFiles", "*.inf", "Other Files"); mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/V1", downloadactfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File"); mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "VideoFiles/V1", downloadflightfolder, EDDOptions.Instance.AppDataDirectory, "*.vid", edversion, "Video File"); mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "AddonFiles/V1", downloadaddonfolder, EDDOptions.Instance.AppDataDirectory, "*.inf", edversion, "Other File"); #if DEBUG mgr.ReadInstallFiles(EDDiscovery.Properties.Resources.URLGithubDataDownload, "ActionFiles/Debug", downloadactdebugfolder, EDDOptions.Instance.AppDataDirectory, "*.act", edversion, "Action File"); #endif } mgr.Sort(); panelVScroll.SuspendLayout(); int[] tabs; if (managedownloadmode) { tabs = new int[] { 0, 100, 300, 380, 590, 770, 860, 940 } } ; else { tabs = new int[] { 0, 100, 300, 380, 590, 590, 740, 840 } }; panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[0] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Type" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[1] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Name" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[2] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Version" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[3] + panelleftmargin, panelheightmargin), Size = new Size(120, 24), Text = "Description" }); if (managedownloadmode) { panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[4] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Status" }); } panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[5] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Action" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[6] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Delete" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[7] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Enabled" }); int vpos = panelheightmargin + 30; foreach (VersioningManager.DownloadItem di in mgr.downloaditems) { Group g = new Group(); g.di = di; g.panel = new Panel(); g.panel.BorderStyle = BorderStyle.FixedSingle; g.panel.Tag = g; g.panel.MouseEnter += MouseEnterControl; g.type = new Label(); g.type.Location = new Point(tabs[0], labelheightmargin); // 8 spacing, allow 8*4 to indent g.type.Size = new Size(tabs[1] - tabs[0], 24); g.type.Text = di.itemtype; g.panel.Controls.Add(g.type); g.info = new ExtendedControls.ButtonExt(); g.info.Location = new Point(tabs[1], labelheightmargin + 2); // 8 spacing, allow 8*4 to indent g.info.Size = new Size(16, 16); g.info.Text = "i"; g.info.Click += Info_Click; g.info.Tag = g; g.panel.Controls.Add(g.info); g.name = new Label(); g.name.Location = new Point(tabs[1] + 18, labelheightmargin); // 8 spacing, allow 8*4 to indent g.name.Size = new Size(tabs[2] - tabs[1] - 18, 24); g.name.Text = di.itemname; g.panel.Controls.Add(g.name); g.version = new Label(); g.version.Location = new Point(tabs[2], labelheightmargin); // 8 spacing, allow 8*4 to indent g.version.Size = new Size(tabs[3] - tabs[2], 24); g.version.Text = (di.localversion != null) ? di.localversion.ToString(".") : "N/A"; g.panel.Controls.Add(g.version); g.shortdesc = new Label(); g.shortdesc.Location = new Point(tabs[3], labelheightmargin); // 8 spacing, allow 8*4 to indent g.shortdesc.Size = new Size(tabs[4] - tabs[3], 24); g.shortdesc.Text = di.ShortLocalDescription; if (g.shortdesc.Text.Length == 0) { g.shortdesc.Text = "N/A"; } g.panel.Controls.Add(g.shortdesc); if (managedownloadmode) { string text; if (di.state == VersioningManager.ItemState.EDOutOfDate) { text = "Newer EDD required"; } else if (di.state == VersioningManager.ItemState.UpToDate) { text = (di.localmodified) ? "Locally modified" : "Up to Date"; } else if (di.state == VersioningManager.ItemState.LocalOnly) { text = "Local Only"; } else if (di.state == VersioningManager.ItemState.NotPresent) { text = "Version " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } else { text = "New version " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } g.actionlabel = new Label(); g.actionlabel.Location = new Point(tabs[4], labelheightmargin); // 8 spacing, allow 8*4 to indent g.actionlabel.Size = new Size(tabs[5] - tabs[4], 24); g.actionlabel.Text = text; g.panel.Controls.Add(g.actionlabel); if (text.Contains("ersion")) // cheap and nasty way { g.actionbutton = new ExtendedControls.ButtonExt(); g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.actionbutton.Size = new Size(80, 24); g.actionbutton.Text = (di.state == VersioningManager.ItemState.NotPresent) ? "Install" : "Update"; g.actionbutton.Click += Actionbutton_Click; g.actionbutton.Tag = g; g.panel.Controls.Add(g.actionbutton); } } else { bool loaded = CheckActionLoaded != null?CheckActionLoaded(g.di.itemname) : false; if (loaded) // may not be loaded IF its got an error. { g.actionbutton = new ExtendedControls.ButtonExt(); g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.actionbutton.Size = new Size(80, 24); g.actionbutton.Text = "Edit"; g.actionbutton.Click += ActionbuttonEdit_Click; g.actionbutton.Tag = g; g.panel.Controls.Add(g.actionbutton); } } if (di.HasLocalCopy) { g.deletebutton = new ExtendedControls.ButtonExt(); g.deletebutton.Location = new Point(tabs[6], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.deletebutton.Size = new Size(24, 24); g.deletebutton.Text = "X"; g.deletebutton.Click += Deletebutton_Click; g.deletebutton.Tag = g; g.panel.Controls.Add(g.deletebutton); } if (di.localenable.HasValue) { g.enabled = new ExtendedControls.CheckBoxCustom(); g.enabled.Location = new Point(tabs[7], labelheightmargin); g.enabled.Size = new Size(100, 20); g.enabled.Text = "Enabled"; g.enabled.Checked = di.localenable.Value; g.enabled.Click += Enabled_Click; g.enabled.Tag = g; g.panel.Controls.Add(g.enabled); } int panelwidth = Math.Max(panelVScroll.Width - panelVScroll.ScrollBarWidth, 10) - panelleftmargin * 2; g.panel.Location = new Point(panelleftmargin, vpos); g.panel.Size = new Size(panelwidth, 32); vpos += g.panel.Height + 4; panelVScroll.Controls.Add(g.panel); } buttonMore.Location = new Point(panelleftmargin, vpos); EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance; if (theme != null) { theme.ApplyToControls(panelVScroll, font); } panelVScroll.ResumeLayout(); } bool infoclicked = false;
void ReadyToDisplay() { panelVScroll.RemoveAllControls(); mgr = new VersioningManager(); int[] edversion = ObjectExtensionsNumbersBool.GetEDVersion(); System.Diagnostics.Debug.Assert(edversion != null); mgr.ReadLocalFiles(Tools.GetAppDataDirectory(), "Actions", "*.act", "Action File"); mgr.ReadInstallFiles(downloadactfolder, Tools.GetAppDataDirectory(), "*.act", edversion, "Action File"); #if DEBUG mgr.ReadInstallFiles(downloadactdebugfolder, Tools.GetAppDataDirectory(), "*.act", edversion, "Action File"); #endif mgr.ReadLocalFiles(Tools.GetAppDataDirectory(), "Flights", "*.vid", "Video File"); mgr.ReadInstallFiles(downloadflightfolder, Tools.GetAppDataDirectory(), "*.vid", edversion, "Video File"); mgr.Sort(); panelVScroll.SuspendLayout(); int[] tabs = { 0, 100, 260, 340, 550, 730, 820, 900 }; panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[0] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Type" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[1] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Name" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[2] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Version" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[3] + panelleftmargin, panelheightmargin), Size = new Size(120, 24), Text = "Description" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[4] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Status" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[5] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Action" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[6] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Delete" }); panelVScroll.Controls.Add(new Label() { Location = new Point(tabs[7] + panelleftmargin, panelheightmargin), Size = new Size(80, 24), Text = "Enabled" }); int vpos = panelheightmargin + 30; foreach (VersioningManager.DownloadItem di in mgr.downloaditems) { Group g = new Group(); g.di = di; g.panel = new Panel(); g.panel.BorderStyle = BorderStyle.FixedSingle; g.panel.Tag = g; g.panel.MouseEnter += MouseEnterControl; g.type = new Label(); g.type.Location = new Point(tabs[0], labelheightmargin); // 8 spacing, allow 8*4 to indent g.type.Size = new Size(tabs[1] - tabs[0], 24); g.type.Text = di.itemtype; g.panel.Controls.Add(g.type); g.info = new ExtendedControls.ButtonExt(); g.info.Location = new Point(tabs[1], labelheightmargin + 2); // 8 spacing, allow 8*4 to indent g.info.Size = new Size(16, 16); g.info.Text = "i"; g.info.Click += Info_Click; g.info.Tag = g; g.panel.Controls.Add(g.info); g.name = new Label(); g.name.Location = new Point(tabs[1] + 18, labelheightmargin); // 8 spacing, allow 8*4 to indent g.name.Size = new Size(tabs[2] - tabs[1] - 18, 24); g.name.Text = di.itemname; g.panel.Controls.Add(g.name); g.version = new Label(); g.version.Location = new Point(tabs[2], labelheightmargin); // 8 spacing, allow 8*4 to indent g.version.Size = new Size(tabs[3] - tabs[2], 24); g.version.Text = (di.localversion != null) ? di.localversion.ToString(".") : "N/A"; g.panel.Controls.Add(g.version); g.shortdesc = new Label(); g.shortdesc.Location = new Point(tabs[3], labelheightmargin); // 8 spacing, allow 8*4 to indent g.shortdesc.Size = new Size(tabs[4] - tabs[3], 24); g.shortdesc.Text = di.ShortLocalDescription; if (g.shortdesc.Text.Length == 0) { g.shortdesc.Text = "N/A"; } g.panel.Controls.Add(g.shortdesc); string text; if (di.state == VersioningManager.ItemState.EDOutOfDate) { text = "Newer EDD required"; } else if (di.state == VersioningManager.ItemState.UpToDate) { text = (di.localmodified) ? "Locally modified" : "Up to Date"; } else if (di.state == VersioningManager.ItemState.LocalOnly) { text = "Local Only"; } else if (di.state == VersioningManager.ItemState.NotPresent) { text = "Version " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } else { text = "New version " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } g.actionlabel = new Label(); g.actionlabel.Location = new Point(tabs[4], labelheightmargin); // 8 spacing, allow 8*4 to indent g.actionlabel.Size = new Size(tabs[5] - tabs[4], 24); g.actionlabel.Text = text; g.panel.Controls.Add(g.actionlabel); if (text.Contains("ersion")) // cheap and nasty way { g.actionbutton = new ExtendedControls.ButtonExt(); g.actionbutton.Location = new Point(tabs[5], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.actionbutton.Size = new Size(80, 24); g.actionbutton.Text = (di.state == VersioningManager.ItemState.NotPresent) ? "Install" : "Update"; g.actionbutton.Click += Actionbutton_Click; g.actionbutton.Tag = g; g.panel.Controls.Add(g.actionbutton); } if (di.HasLocalCopy) { g.deletebutton = new ExtendedControls.ButtonExt(); g.deletebutton.Location = new Point(tabs[6], labelheightmargin - 4); // 8 spacing, allow 8*4 to indent g.deletebutton.Size = new Size(24, 24); g.deletebutton.Text = "X"; g.deletebutton.Click += Deletebutton_Click; g.deletebutton.Tag = g; g.panel.Controls.Add(g.deletebutton); } if (di.localenable.HasValue) { g.enabled = new ExtendedControls.CheckBoxCustom(); g.enabled.Location = new Point(tabs[7], labelheightmargin); g.enabled.Size = new Size(100, 20); g.enabled.Text = "Enabled"; g.enabled.Checked = di.localenable.Value; g.enabled.Click += Enabled_Click; g.enabled.Tag = g; g.panel.Controls.Add(g.enabled); } int panelwidth = Math.Max(panelVScroll.Width - panelVScroll.ScrollBarWidth, 10) - panelleftmargin * 2; g.panel.Location = new Point(panelleftmargin, vpos); g.panel.Size = new Size(panelwidth, 32); vpos += g.panel.Height + 4; panelVScroll.Controls.Add(g.panel); } EDDiscovery.EDDTheme theme = EDDiscovery.EDDTheme.Instance; if (theme != null) { theme.ApplyToControls(panelVScroll, font); } panelVScroll.ResumeLayout(); }