private EditorTabPage AddNewTextEditor(string title) { if (mEditorSettings == null) { mEditorSettings = new DefaultTextEditorProperties(); mEditorSettings.AllowCaretBeyondEOL = false; mEditorSettings.AutoInsertCurlyBracket = true; mEditorSettings.BracketMatchingStyle = BracketMatchingStyle.After; mEditorSettings.ConvertTabsToSpaces = false; mEditorSettings.CutCopyWholeLine = true; mEditorSettings.DocumentSelectionMode = DocumentSelectionMode.Normal; mEditorSettings.EnableFolding = true; mEditorSettings.HideMouseCursor = false; mEditorSettings.IndentStyle = IndentStyle.Smart; mEditorSettings.IsIconBarVisible = true; mEditorSettings.LineTerminator = Environment.NewLine; mEditorSettings.LineViewerStyle = LineViewerStyle.None; mEditorSettings.MouseWheelScrollDown = true; mEditorSettings.MouseWheelTextZoom = true; mEditorSettings.ShowEOLMarker = false; mEditorSettings.ShowHorizontalRuler = false; mEditorSettings.ShowInvalidLines = false; mEditorSettings.ShowLineNumbers = true; mEditorSettings.ShowMatchingBracket = true; mEditorSettings.ShowSpaces = false; mEditorSettings.ShowTabs = false; mEditorSettings.ShowVerticalRuler = false; mEditorSettings.SupportReadOnlySegments = false; mEditorSettings.TabIndent = 4; mEditorSettings.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; } var tab = new EditorTabPage(title, mEditorSettings); fileTabs.Controls.Add(tab); fileTabs.SelectTab(tab); return(tab); }
private EditorTabPage AddNewTextEditor(string title) { if (mEditorSettings == null) { mEditorSettings = new DefaultTextEditorProperties(); mEditorSettings.AllowCaretBeyondEOL = false; mEditorSettings.AutoInsertCurlyBracket = true; mEditorSettings.BracketMatchingStyle = BracketMatchingStyle.After; mEditorSettings.ConvertTabsToSpaces = false; mEditorSettings.CutCopyWholeLine = true; mEditorSettings.DocumentSelectionMode = DocumentSelectionMode.Normal; mEditorSettings.EnableFolding = true; mEditorSettings.HideMouseCursor = false; mEditorSettings.IndentStyle = IndentStyle.Smart; mEditorSettings.IsIconBarVisible = true; mEditorSettings.LineTerminator = Environment.NewLine; mEditorSettings.LineViewerStyle = LineViewerStyle.None; mEditorSettings.MouseWheelScrollDown = true; mEditorSettings.MouseWheelTextZoom = true; mEditorSettings.ShowEOLMarker = false; mEditorSettings.ShowHorizontalRuler = false; mEditorSettings.ShowInvalidLines = false; mEditorSettings.ShowLineNumbers = true; mEditorSettings.ShowMatchingBracket = true; mEditorSettings.ShowSpaces = false; mEditorSettings.ShowTabs = false; mEditorSettings.ShowVerticalRuler = false; mEditorSettings.SupportReadOnlySegments = false; mEditorSettings.TabIndent = 4; mEditorSettings.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; } var tab = new EditorTabPage(title, mEditorSettings); fileTabs.Controls.Add(tab); fileTabs.SelectTab(tab); return tab; }
public EditorTabPage AddTab(string name, ProjectFile projectFile) { TabPage tab = null; if (projectfiles.ContainsKey(name)) { // Select the page tab = Tabs.TabPages[name]; } else { var editor = new ScintillaEditor(); var editorTab = new EditorTabPage(name, projectFile, editor); Tabs.TabPages.Add(editorTab); tab = Tabs.TabPages[Tabs.TabPages.Count - 1]; tab.Name = name; tab.Text = name; tab.Controls.Add(editor); tab.Controls[tab.Controls.Count - 1].Text = projectFile.FileContents; projectfiles.Add(name, projectFile); } selectedtabname = name; selectedtabprojectfile = projectFile; Tabs.SelectedTab = tab; return (EditorTabPage)tab; }