public QTabItemBase(string title, QTabControl parent) { this.titleText = title; this.Owner = parent; if (font == null) { font = new Font(parent.Font, FontStyle.Bold); } if (fontSubText == null) { float sizeInPoints = font.SizeInPoints; fontSubText = new Font(parent.Font.FontFamily, (sizeInPoints > 8.25f) ? (sizeInPoints - 0.75f) : sizeInPoints, FontStyle.Bold); } if (sfMeasure == null) { sfMeasure = new StringFormat(); sfMeasure.FormatFlags |= StringFormatFlags.NoWrap; } if (title.Length > 0) { this.RefreshRectangle(); } else { this.tabBounds = new Rectangle(this.tabBounds.X, this.tabBounds.Y, 100, 0x18); } }
public QTabItem(string title, string path, QTabControl parent) { Owner = parent; Comment = string.Empty; stckHistoryForward = new Stack <LogData>(); stckHistoryBackward = new Stack <LogData>(); dicSelectedItems = new Dictionary <string, Address[]>(); dicFocusedItemName = new Dictionary <string, string>(); Branches = new List <LogData>(); CurrentPath = path; ToolTipText = string.Empty; titleText = title; if (font == null) { font = new Font(parent.Font, FontStyle.Bold); } if (fontSubText == null) { float sizeInPoints = font.SizeInPoints; fontSubText = new Font(parent.Font.FontFamily, (sizeInPoints > 8.25f) ? (sizeInPoints - 0.75f) : sizeInPoints, FontStyle.Bold); } if (sfMeasure == null) { sfMeasure = new StringFormat(); sfMeasure.FormatFlags |= StringFormatFlags.NoWrap; } if (title.Length > 0) { RefreshRectangle(); } else { TabBounds = new Rectangle(TabBounds.X, TabBounds.Y, 100, 0x18); } }
public QTabItem(string title, string path, QTabControl parent) : base(title, parent) { stckHistoryForward = new Stack<LogData>(); stckHistoryBackward = new Stack<LogData>(); dicSelectdItems = new Dictionary<string, Address[]>(); dicFocusedItemName = new Dictionary<string, string>(); lstHistoryBranches = new List<LogData>(); CurrentPath = path; }
public void OnClose() { if (Closed != null) { Closed(null, EventArgs.Empty); Closed = null; } Owner = null; }
public QTabItem(string title, string path, QTabControl parent) : base(title, parent) { stckHistoryForward = new Stack <LogData>(); stckHistoryBackward = new Stack <LogData>(); dicSelectdItems = new Dictionary <string, Address[]>(); dicFocusedItemName = new Dictionary <string, string>(); lstHistoryBranches = new List <LogData>(); CurrentPath = path; }
public CreateNewGroupForm(string currentPath, QTabControl.QTabCollection tabs) { newPath = currentPath; Tabs = tabs; InitializeComponent(); textBox1.Text = QTUtility2.MakePathDisplayText(newPath, false); string[] strArray = QTUtility.TextResourcesDic["TabBar_NewGroup"]; Text = strArray[0]; label1.Text = strArray[1]; checkBox1.Text = strArray[2]; ActiveControl = textBox1; }
public static void CheckSubTexts(QTabControl tabControl) { bool needsRefresh = false; char[] separator = new char[] { Path.DirectorySeparatorChar }; Dictionary<string, List<QTabItem>> commonTextTabs = new Dictionary<string, List<QTabItem>>(); foreach(QTabItem item in tabControl.TabPages) { if(!item.CurrentPath.StartsWith("::")) { string text = item.Text.ToLower(); if(commonTextTabs.ContainsKey(text)) { commonTextTabs[text].Add(item); } else { commonTextTabs[text] = new List<QTabItem> { item }; } } } foreach(List<QTabItem> tabs in commonTextTabs.Values) { if(tabs.Count > 1) { if(tabs.All(tab => tab.CurrentPath == tabs[0].CurrentPath)) { foreach(QTabItem tab in tabs.Where(item => item.Comment.Length > 0)) { tab.Comment = string.Empty; tab.RefreshRectangle(); needsRefresh = true; } } else { List<string[]> pathArrays = tabs.Select(item => item.CurrentPath .Split(separator).Reverse().Skip(1).ToArray()).ToList(); for(int i = 0; i < tabs.Count; i++) { string comment = pathArrays[i].FirstOrDefault(str => !pathArrays.Where( (path, j) => i != j && path.Contains(str)).Any()) ?? tabs[i].currentPath; if(comment.Length == 2 && comment[1] == ':') { comment += @"\"; } if(tabs[i].Comment != comment) { tabs[i].Comment = comment; tabs[i].RefreshRectangle(); needsRefresh = true; } } } } else if(tabs[0].Comment.Length > 0) { needsRefresh = true; tabs[0].Comment = string.Empty; tabs[0].RefreshRectangle(); } } if(needsRefresh) { tabControl.Refresh(); } }
public QTabItemBase(string title, QTabControl parent) { this.titleText = title; this.Owner = parent; if(font == null) { font = new Font(parent.Font, FontStyle.Bold); } if(fontSubText == null) { float sizeInPoints = font.SizeInPoints; fontSubText = new Font(parent.Font.FontFamily, (sizeInPoints > 8.25f) ? (sizeInPoints - 0.75f) : sizeInPoints, FontStyle.Bold); } if(sfMeasure == null) { sfMeasure = new StringFormat(); sfMeasure.FormatFlags |= StringFormatFlags.NoWrap; } if(title.Length > 0) { this.RefreshRectangle(); } else { this.tabBounds = new Rectangle(this.tabBounds.X, this.tabBounds.Y, 100, 0x18); } }
public static void CheckSubTexts(QTabControl tabControl) { if (!tabControl.AutoSubText) { return; } bool needsRefresh = false; char[] separator = new char[] { Path.DirectorySeparatorChar }; Dictionary <string, List <QTabItem> > commonTextTabs = new Dictionary <string, List <QTabItem> >(); foreach (QTabItem item in tabControl.TabPages) { if (item.CurrentPath.StartsWith("::")) { continue; } string text = item.Text.ToLower(); if (commonTextTabs.ContainsKey(text)) { commonTextTabs[text].Add(item); } else { commonTextTabs[text] = new List <QTabItem> { item }; } } foreach (List <QTabItem> tabs in commonTextTabs.Values) { if (tabs.Count > 1) { if (tabs.All(tab => tab.CurrentPath == tabs[0].CurrentPath)) { foreach (QTabItem tab in tabs.Where(item => item.Comment.Length > 0)) { tab.Comment = string.Empty; tab.RefreshRectangle(); needsRefresh = true; } } else { List <string[]> pathArrays = tabs.Select(item => item.CurrentPath .Split(separator).Reverse().Skip(1).ToArray()).ToList(); for (int i = 0; i < tabs.Count; i++) { string comment = pathArrays[i].FirstOrDefault(str => !pathArrays.Where( (path, j) => i != j && path.Contains(str)).Any()) ?? tabs[i].currentPath; if (comment.Length == 2 && comment[1] == ':') { comment += @"\"; } if (tabs[i].Comment != comment) { tabs[i].Comment = comment; tabs[i].RefreshRectangle(); needsRefresh = true; } } } } else if (tabs[0].Comment.Length > 0) { needsRefresh = true; tabs[0].Comment = string.Empty; tabs[0].RefreshRectangle(); } } if (needsRefresh) { tabControl.Refresh(); } }
public virtual void OnClose() { this.Owner = null; }
public virtual void OnClose() { Owner = null; }
private void InitializeComponent() { components = new Container(); buttonNavHistoryMenu = new ToolStripDropDownButton(); tabControl1 = new QTabControl(); CurrentTab = new QTabItem(string.Empty, string.Empty, tabControl1); contextMenuTab = new ContextMenuStripEx(components, false); contextMenuSys = new ContextMenuStripEx(components, false); tabControl1.SuspendLayout(); contextMenuSys.SuspendLayout(); contextMenuTab.SuspendLayout(); SuspendLayout(); bool flag = QTUtility.CheckConfig(Settings.ShowNavButtons); if(flag) { InitializeNavBtns(false); } buttonNavHistoryMenu.AutoSize = false; buttonNavHistoryMenu.DisplayStyle = ToolStripItemDisplayStyle.None; buttonNavHistoryMenu.Enabled = false; buttonNavHistoryMenu.Size = new Size(13, 0x15); buttonNavHistoryMenu.DropDown = new DropDownMenuBase(components, true, true, true); buttonNavHistoryMenu.DropDown.ItemClicked += NavigationButton_DropDownMenu_ItemClicked; buttonNavHistoryMenu.DropDownOpening += NavigationButtons_DropDownOpening; buttonNavHistoryMenu.DropDown.ImageList = QTUtility.ImageListGlobal; tabControl1.SetRedraw(false); tabControl1.TabPages.Add(CurrentTab); tabControl1.Dock = DockStyle.Fill; tabControl1.ContextMenuStrip = contextMenuTab; tabControl1.RefreshOptions(true); tabControl1.RowCountChanged += tabControl1_RowCountChanged; tabControl1.Deselecting += tabControl1_Deselecting; tabControl1.Selecting += tabControl1_Selecting; tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged; tabControl1.GotFocus += Controls_GotFocus; tabControl1.MouseEnter += tabControl1_MouseEnter; tabControl1.MouseLeave += tabControl1_MouseLeave; tabControl1.MouseDown += tabControl1_MouseDown; tabControl1.MouseUp += tabControl1_MouseUp; tabControl1.MouseMove += tabControl1_MouseMove; tabControl1.MouseDoubleClick += tabControl1_MouseDoubleClick; tabControl1.ItemDrag += tabControl1_ItemDrag; tabControl1.PointedTabChanged += tabControl1_PointedTabChanged; tabControl1.TabCountChanged += tabControl1_TabCountChanged; tabControl1.CloseButtonClicked += tabControl1_CloseButtonClicked; tabControl1.TabIconMouseDown += tabControl1_TabIconMouseDown; contextMenuTab.Items.Add(new ToolStripMenuItem()); contextMenuTab.ShowImageMargin = false; contextMenuTab.ItemClicked += contextMenuTab_ItemClicked; contextMenuTab.Opening += contextMenuTab_Opening; contextMenuTab.Closed += contextMenuTab_Closed; contextMenuSys.Items.Add(new ToolStripMenuItem()); contextMenuSys.ShowImageMargin = false; contextMenuSys.ItemClicked += contextMenuSys_ItemClicked; contextMenuSys.Opening += contextMenuSys_Opening; Controls.Add(tabControl1); if(flag) { Controls.Add(toolStrip); } MinSize = new Size(150, QTUtility.TabHeight + 2); Height = QTUtility.TabHeight + 2; ContextMenuStrip = contextMenuSys; MouseDoubleClick += QTTabBarClass_MouseDoubleClick; tabControl1.ResumeLayout(false); contextMenuSys.ResumeLayout(false); contextMenuTab.ResumeLayout(false); if(flag) { toolStrip.ResumeLayout(false); toolStrip.PerformLayout(); } ResumeLayout(false); }
public void ResetOwner(QTabControl owner) { this.Owner = owner; owner.TabPages.Add(this); }
public static void CheckSubTexts(QTabControl tabControl) { bool flag = false; char[] separator = new char[] { '\\' }; Dictionary <string, List <QTabItem> > dictionary = new Dictionary <string, List <QTabItem> >(); foreach (QTabItem item in tabControl.TabPages) { if (!item.CurrentPath.StartsWith("::")) { if (dictionary.ContainsKey(item.Text)) { dictionary[item.Text].Add(item); } else { List <QTabItem> list = new List <QTabItem>(); list.Add(item); dictionary[item.Text] = list; } } } foreach (string str in dictionary.Keys) { List <QTabItem> list2 = dictionary[str]; if (list2.Count > 1) { bool flag2 = true; for (int i = 1; i < list2.Count; i++) { if (list2[i].CurrentPath != list2[0].CurrentPath) { flag2 = false; break; } } if (flag2) { foreach (QTabItem item2 in list2) { if (item2.Comment.Length > 0) { item2.Comment = string.Empty; item2.RefreshRectangle(); flag = true; } } } else { foreach (QTabItem item3 in list2) { string str2 = string.Empty; string[] strArray = item3.CurrentPath.Split(separator); if (strArray.Length > 1) { for (int j = strArray.Length - 2; j > -1; j--) { str2 = strArray[j]; bool flag3 = false; foreach (QTabItem item4 in list2) { if ((item4 == item3) || !(item4.CurrentPath != item3.CurrentPath)) { continue; } string[] strArray2 = item4.CurrentPath.Split(separator); if (strArray2.Length > 1) { for (int k = strArray2.Length - 2; k > -1; k--) { if (str2 == strArray2[k]) { flag3 = true; str2 = string.Empty; break; } } } if (flag3) { break; } } if (!flag3) { break; } } } if (str2.Length > 0) { if ((str2.Length == 2) && (str2[1] == ':')) { str2 = str2 + @"\"; } item3.Comment = str2; } else { item3.Comment = item3.CurrentPath; } item3.RefreshRectangle(); flag = true; } } continue; } if (list2[0].Comment.Length > 0) { flag = true; list2[0].Comment = string.Empty; list2[0].RefreshRectangle(); } } if (flag) { tabControl.Refresh(); } }
public void ResetOwner(QTabControl owner) { Owner = owner; owner.TabPages.Add(this); }
public static void CheckSubTexts(QTabControl tabControl) { bool flag = false; char[] separator = new char[] { '\\' }; Dictionary<string, List<QTabItem>> dictionary = new Dictionary<string, List<QTabItem>>(); foreach(QTabItem item in tabControl.TabPages) { if(!item.CurrentPath.StartsWith("::")) { if(dictionary.ContainsKey(item.Text)) { dictionary[item.Text].Add(item); } else { List<QTabItem> list = new List<QTabItem>(); list.Add(item); dictionary[item.Text] = list; } } } foreach(string str in dictionary.Keys) { List<QTabItem> list2 = dictionary[str]; if(list2.Count > 1) { bool flag2 = true; for(int i = 1; i < list2.Count; i++) { if(list2[i].CurrentPath != list2[0].CurrentPath) { flag2 = false; break; } } if(flag2) { foreach(QTabItem item2 in list2) { if(item2.Comment.Length > 0) { item2.Comment = string.Empty; item2.RefreshRectangle(); flag = true; } } } else { foreach(QTabItem item3 in list2) { string str2 = string.Empty; string[] strArray = item3.CurrentPath.Split(separator); if(strArray.Length > 1) { for(int j = strArray.Length - 2; j > -1; j--) { str2 = strArray[j]; bool flag3 = false; foreach(QTabItem item4 in list2) { if((item4 == item3) || !(item4.CurrentPath != item3.CurrentPath)) { continue; } string[] strArray2 = item4.CurrentPath.Split(separator); if(strArray2.Length > 1) { for(int k = strArray2.Length - 2; k > -1; k--) { if(str2 == strArray2[k]) { flag3 = true; str2 = string.Empty; break; } } } if(flag3) { break; } } if(!flag3) { break; } } } if(str2.Length > 0) { if((str2.Length == 2) && (str2[1] == ':')) { str2 = str2 + @"\"; } item3.Comment = str2; } else { item3.Comment = item3.CurrentPath; } item3.RefreshRectangle(); flag = true; } } continue; } if(list2[0].Comment.Length > 0) { flag = true; list2[0].Comment = string.Empty; list2[0].RefreshRectangle(); } } if(flag) { tabControl.Refresh(); } }