/// <summary> /// Opens a new tab and loads the meta into it /// </summary> /// <param name="meta">The meta to load into the new tab</param> /// <param name="allowDuplicate">if false, will look for a tab with the same meta and activate. /// if true, will open a new tab with a duplicated meta</param> /// <returns>Page Number of active tab</returns> public int addNewTab(Meta meta, bool allowDuplicate) { string typeAndTag = "[" + meta.type.ToLower() + "] " + meta.name.Substring(meta.name.LastIndexOf('\\') + 1); if (!allowDuplicate) { for (int i = 0; i < this.tabs.Tabs.Count; i++) { if (this.tabs.Tabs[i].Text == typeAndTag) { this.tabs.SelectedTabIndex = i; //this.tabs.SelectedTab.Focus(); return(i); } } } MetaEditorControlPage mecp = new MetaEditorControlPage(meta, mapForm); this.BackColor = bgColor; this.ForeColor = fgColor; mecp.setFormColors(fgColor, bgColor); // mapName = map.filePath.Substring(map.filePath.LastIndexOf('\\') + 1).ToUpper() + TabItem tp = tabs.CreateTab(typeAndTag); mecp.Parent = tp.AttachedControl; mecp.Dock = DockStyle.Fill; tp.Tooltip = "[" + @meta.type.ToLower() + "] " + @meta.name; this.tabs.AllowDrop = true; //this.tabs.DragDrop += new DragEventHandler(tp_DragDrop); //this.tabs.DragEnter += new DragEventHandler(tp_DragEnter); //this.tabs.DragLeave += new EventHandler(tp_DragLeave); //// These tabs don't change selected index till MouseUp, so do it on MouseDown! //this.tabs.MouseDown += new MouseEventHandler(tabControl1_MouseDown); //this.tabs.MouseMove += new MouseEventHandler(tabControl1_MouseMove); this.tabs.SelectedTabIndex = tabs.Tabs.IndexOf(tp); this.WindowState = FormWindowState.Normal; this.Show(); this.Focus(); return(tabs.Tabs.IndexOf(tp)); }
/// <summary> /// Opens a new tab and loads the meta into it /// </summary> /// <param name="meta">The meta to load into the new tab</param> /// <param name="allowDuplicate">if false, will look for a tab with the same meta and activate. /// if true, will open a new tab with a duplicated meta</param> /// <returns>Page Number of active tab</returns> public int addNewTab(Meta meta, bool allowDuplicate) { string typeAndTag = "[" + meta.type.ToLower() + "] " + meta.name.Substring(meta.name.LastIndexOf('\\') + 1); if (!allowDuplicate) { for (int i = 0; i < this.tabs.Tabs.Count; i++) { if (this.tabs.Tabs[i].Text == typeAndTag) { this.tabs.SelectedTabIndex = i; //this.tabs.SelectedTab.Focus(); return(i); } } } MetaEditorControlPage mecp = new MetaEditorControlPage(meta, mapForm); this.BackColor = bgColor; this.ForeColor = fgColor; mecp.setFormColors(fgColor, bgColor); // mapName = map.filePath.Substring(map.filePath.LastIndexOf('\\') + 1).ToUpper() + TabItem tp = tabs.CreateTab(typeAndTag); mecp.Parent = tp.AttachedControl; mecp.Dock = DockStyle.Fill; #region tooltip Information tp.Tooltip = "[" + @meta.type.ToLower() + "] " + @meta.name; try { string PluginSet = Globals.PluginSetSelector.getActivePlugin(); tp.Tooltip += "\nPlugin set: " + PluginSet; } catch {} string PluginInfo = string.Empty; try { string PluginAuthor = ((HaloMap.Plugins.IFPIO)HaloMap.Plugins.IFPHashMap.H2IFPHash[meta.type]).author; if (PluginAuthor != null) { PluginInfo += "Author: " + PluginAuthor + " "; } } catch { } try { string PluginVersion = ((HaloMap.Plugins.IFPIO)HaloMap.Plugins.IFPHashMap.H2IFPHash[meta.type]).version; if (PluginVersion != null) { PluginInfo += "Version: " + PluginVersion + " "; } } catch { } if (PluginInfo != string.Empty) { tp.Tooltip += "\nPlugin " + PluginInfo; } #endregion this.tabs.AllowDrop = true; //this.tabs.DragDrop += new DragEventHandler(tp_DragDrop); //this.tabs.DragEnter += new DragEventHandler(tp_DragEnter); //this.tabs.DragLeave += new EventHandler(tp_DragLeave); //// These tabs don't change selected index till MouseUp, so do it on MouseDown! //this.tabs.MouseDown += new MouseEventHandler(tabControl1_MouseDown); //this.tabs.MouseMove += new MouseEventHandler(tabControl1_MouseMove); this.tabs.SelectedTabIndex = tabs.Tabs.IndexOf(tp); this.WindowState = FormWindowState.Normal; this.Show(); this.Focus(); return(tabs.Tabs.IndexOf(tp)); }
/// <summary> /// Opens a new tab and loads the meta into it /// </summary> /// <param name="meta">The meta to load into the new tab</param> /// <param name="allowDuplicate">if false, will look for a tab with the same meta and activate. /// if true, will open a new tab with a duplicated meta</param> /// <returns>Page Number of active tab</returns> public int addNewTab( Meta meta, bool allowDuplicate) { string typeAndTag = "[" + meta.type.ToLower() + "] " + meta.name.Substring(meta.name.LastIndexOf('\\') + 1); if (!allowDuplicate) for (int i = 0; i < this.tabs.Tabs.Count; i++) if (this.tabs.Tabs[i].Text == typeAndTag) { this.tabs.SelectedTabIndex = i; //this.tabs.SelectedTab.Focus(); return i; } MetaEditorControlPage mecp = new MetaEditorControlPage(meta, mapForm); this.BackColor = bgColor; this.ForeColor = fgColor; mecp.setFormColors(fgColor, bgColor); // mapName = map.filePath.Substring(map.filePath.LastIndexOf('\\') + 1).ToUpper() + TabItem tp = tabs.CreateTab(typeAndTag); mecp.Parent = tp.AttachedControl; mecp.Dock = DockStyle.Fill; tp.Tooltip = "[" + @meta.type.ToLower() + "] " + @meta.name; this.tabs.AllowDrop = true; //this.tabs.DragDrop += new DragEventHandler(tp_DragDrop); //this.tabs.DragEnter += new DragEventHandler(tp_DragEnter); //this.tabs.DragLeave += new EventHandler(tp_DragLeave); //// These tabs don't change selected index till MouseUp, so do it on MouseDown! //this.tabs.MouseDown += new MouseEventHandler(tabControl1_MouseDown); //this.tabs.MouseMove += new MouseEventHandler(tabControl1_MouseMove); this.tabs.SelectedTabIndex = tabs.Tabs.IndexOf(tp); this.WindowState = FormWindowState.Normal; this.Show(); this.Focus(); return tabs.Tabs.IndexOf(tp); }
/// <summary> /// Opens a new tab and loads the meta into it /// </summary> /// <param name="meta">The meta to load into the new tab</param> /// <param name="allowDuplicate">if false, will look for a tab with the same meta and activate. /// if true, will open a new tab with a duplicated meta</param> /// <returns>Page Number of active tab</returns> public int addNewTab( Meta meta, bool allowDuplicate) { string typeAndTag = "[" + meta.type.ToLower() + "] " + meta.name.Substring(meta.name.LastIndexOf('\\') + 1); if (!allowDuplicate) for (int i = 0; i < this.tabs.Tabs.Count; i++) if (this.tabs.Tabs[i].Text == typeAndTag) { this.tabs.SelectedTabIndex = i; //this.tabs.SelectedTab.Focus(); return i; } MetaEditorControlPage mecp = new MetaEditorControlPage(meta, mapForm); this.BackColor = bgColor; this.ForeColor = fgColor; mecp.setFormColors(fgColor, bgColor); // mapName = map.filePath.Substring(map.filePath.LastIndexOf('\\') + 1).ToUpper() + TabItem tp = tabs.CreateTab(typeAndTag); mecp.Parent = tp.AttachedControl; mecp.Dock = DockStyle.Fill; #region tooltip Information tp.Tooltip = "[" + @meta.type.ToLower() + "] " + @meta.name; try { string PluginSet = Globals.PluginSetSelector.getActivePlugin(); tp.Tooltip += "\nPlugin set: " + PluginSet; } catch {} string PluginInfo = string.Empty; try { string PluginAuthor = ((HaloMap.Plugins.IFPIO)HaloMap.Plugins.IFPHashMap.H2IFPHash[meta.type]).author; if (PluginAuthor != null) PluginInfo += "Author: " + PluginAuthor + " "; } catch { } try { string PluginVersion = ((HaloMap.Plugins.IFPIO)HaloMap.Plugins.IFPHashMap.H2IFPHash[meta.type]).version; if (PluginVersion != null) PluginInfo += "Version: " + PluginVersion + " "; } catch { } if (PluginInfo != string.Empty) tp.Tooltip += "\nPlugin " + PluginInfo; #endregion this.tabs.AllowDrop = true; //this.tabs.DragDrop += new DragEventHandler(tp_DragDrop); //this.tabs.DragEnter += new DragEventHandler(tp_DragEnter); //this.tabs.DragLeave += new EventHandler(tp_DragLeave); //// These tabs don't change selected index till MouseUp, so do it on MouseDown! //this.tabs.MouseDown += new MouseEventHandler(tabControl1_MouseDown); //this.tabs.MouseMove += new MouseEventHandler(tabControl1_MouseMove); this.tabs.SelectedTabIndex = tabs.Tabs.IndexOf(tp); this.WindowState = FormWindowState.Normal; this.Show(); this.Focus(); return tabs.Tabs.IndexOf(tp); }