public void AddToolboxItem(string tab, Guid projectGuid, Type tp, string name, Bitmap img, Dictionary <string, object> properties) { xToolboxItem ti = createItem(tp, name, img, properties); ToolboxTabProject ptab = CreateProjectTab(tab, projectGuid); ptab.AddItem(ti); }
public ToolboxTabProject CreateProjectTab(string name, Guid guid) { ToolboxTabProject retTab = null; int n = TabCount; for (int i = 0; i < n; i++) { ToolboxTabProject ptab = toolTabs[i] as ToolboxTabProject; if (ptab != null) { if (ptab.ProjectGuid == guid) { ptab.Visible = true; retTab = ptab; } else { ptab.Visible = false; } } } if (retTab == null) { ToolboxTab2[] a = new ToolboxTab2[n + 1]; toolTabs.CopyTo(a, 1); toolTabs = a; retTab = new ToolboxTabProject(this, name, guid); toolTabs[0] = retTab; retTab.Visible = true; retTab.Location = new Point(0, 0); retTab.Size = new Size(this.ClientSize.Width - 1, LabelToolboxTabTitle.TitleHeight - 1); panelTabs.Controls.Add(retTab); } return(retTab); }
public void RemoveProjectTabs() { List <ToolboxTabProject> ps = new List <ToolboxTabProject>(); List <ToolboxTab2> ts = new List <ToolboxTab2>(); int n = TabCount; for (int i = 0; i < n; i++) { ToolboxTabProject ptab = toolTabs[i] as ToolboxTabProject; if (ptab != null) { ps.Add(ptab); } else { ts.Add(toolTabs[i]); } } toolTabs = new ToolboxTab2[ts.Count]; ts.CopyTo(toolTabs); foreach (ToolboxTabProject p in ps) { Control pr = p.Parent; if (pr != null) { pr.Controls.Remove(p); } } AdjustTabSizes(); }
public void AdjustTabSize(Guid projectGuid) { int n = TabCount; for (int i = 0; i < n; i++) { ToolboxTabProject ptab = toolTabs[i] as ToolboxTabProject; if (ptab != null && ptab.ProjectGuid == projectGuid) { toolTabs[i].AdjustSize(); break; } } }
public void ResetProjectTab(Guid projectGuid) { int n = TabCount; for (int i = 0; i < n; i++) { ToolboxTabProject ptab = toolTabs[i] as ToolboxTabProject; if (ptab != null) { if (ptab.ProjectGuid == projectGuid) { ptab.ClearItems(); break; } } } }
public void ShowProjectTab(Guid projectGuid) { int n = TabCount; for (int i = 0; i < n; i++) { ToolboxTabProject ptab = toolTabs[i] as ToolboxTabProject; if (ptab != null) { if (ptab.ProjectGuid == projectGuid) { ptab.Visible = true; } else { ptab.Visible = false; } } } }