private void InitializeTextEditor() { if (_textEditor != null) { return; } _textEditor = new TextEditorControl(); panEditor.Controls.Add(_textEditor); _textEditor.Dock = DockStyle.Fill; _textEditor.BringToFront(); _textEditor.ConvertTabsToSpaces = true; _textEditor.ShowEOLMarkers = false; _textEditor.ShowInvalidLines = false; _textEditor.ShowLineNumbers = true; _textEditor.ShowMatchingBracket = true; _textEditor.ShowSpaces = false; _textEditor.ShowTabs = false; _textEditor.IndentStyle = IndentStyle.Auto; _textEditor.TabIndent = 2; _textEditor.VRulerRow = 120; _textEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("SQL"); _textArea = new TextAreaControl(_textEditor); _textEditor.ContextMenuStrip = contextMenuEditor; ActiveTextArea.KeyDown += new System.Windows.Forms.KeyEventHandler(OnTextEditorKeyDown); }
private void InitializeTextEditor( ) { if (_textEditor != null) { return; } _textEditor = new TextEditorControl(); panEditor.Controls.Add(_textEditor); _textEditor.Dock = DockStyle.Fill; _textEditor.BringToFront(); _textEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("SQL"); _textEditor.Document.DocumentChanged += new DocumentEventHandler(Document_DocumentChanged); ActiveTextEditorProps.AllowCaretBeyondEOL = false; ActiveTextEditorProps.ConvertTabsToSpaces = false; ActiveTextEditorProps.EnableFolding = false; ActiveTextEditorProps.IndentStyle = IndentStyle.Smart; ActiveTextEditorProps.ShowEOLMarker = false; ActiveTextEditorProps.ShowInvalidLines = false; ActiveTextEditorProps.ShowLineNumbers = true; ActiveTextEditorProps.ShowSpaces = false; ActiveTextEditorProps.ShowTabs = false; ActiveTextEditorProps.ShowVerticalRuler = true; ActiveTextEditorProps.TabIndent = 2; ActiveTextEditorProps.VerticalRulerRow = 120; _textEditor.Focus(); }
private void InitializeTextEditor() { if (_textEditor != null) { return; } _textEditor = new TextEditorControl(); panEditor.Controls.Add(_textEditor); _textEditor.Dock = DockStyle.Fill; _textEditor.BringToFront(); _textEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("SQL"); ActiveTextArea.TextEditorProperties.EnableFolding = false; ActiveTextArea.TextEditorProperties.AllowCaretBeyondEOL = true; if (ConfigHelper.Current != null && ConfigHelper.Current.TextEditorOptions != null) { ActiveTextArea.MotherTextEditorControl.Encoding = ConfigHelper.Current.TextEditorOptions.Encoding; } else { ActiveTextArea.MotherTextEditorControl.Encoding = Encoding.Default; } ConfigHelper.Current.TextEditorOptions.ApplyToControl(_textEditor); ActiveDocument.ReadOnly = true; _textEditor.Focus(); }
private void _bs_CurrentChanged(object sender, EventArgs e) { DataRowView row = _bs.Current as DataRowView; if (row == null) { ActiveDocument.TextContent = String.Empty; ActiveTextArea.Invalidate(); ActiveTextArea.Update(); return; } ActiveDocument.TextContent = row["ObjectScript"] as string; kryptonHeader1.Text = String.Format("Script of '{0}'",row["ObjectName"]); ActiveTextArea.Invalidate(); ActiveTextArea.Update(); _textEditor.BringToFront(); }
private void InitializeTextEditor() { if (_textEditor != null) { return; } _textEditor = new TextEditorControl(); panScript.Controls.Add(_textEditor); _textEditor.Dock = DockStyle.Fill; _textEditor.BringToFront(); Program.MainForm.ConfigContent.TextEditorOptions.ApplyToControl(_textEditor); _textEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("SQL"); _textEditor.ContextMenuStrip = popUpEditor; _textEditor.Focus(); ActiveTextArea.TextEditorProperties.EnableFolding = false; ActiveDocument.ReadOnly = true; }
private void InitializeTextEditor( ) { if (_textEditor != null) { return; } _textEditor = new TextEditorControl(); panEditor.Controls.Add(_textEditor); _textEditor.Dock = DockStyle.Fill; _textEditor.BringToFront(); ConfigurationLoader.CurrentConfig.TextEditorOptions.ApplyToControl(_textEditor); _textEditor.Document.HighlightingStrategy = ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy("SQL"); _textEditor.ContextMenuStrip = popUpEditor; ActiveTextArea.KeyDown += new System.Windows.Forms.KeyEventHandler(OnTextEditorKeyDown); _textEditor.Document.DocumentChanged += new DocumentEventHandler(OnDocumentChanged); _textEditor.Focus(); }
public void AddTab(string fileName) { Form.LogWindow.AppendText("\nCreating new material tab..."); if (TabControl.TabCount > 0) { TabControl.TabPages.Remove(TabControl.TabPages[TabControl.TabPages.Count - 1]); } var ruler = new Ruler(); var map = new DocumentMap(); var textBox = new TextEditorControl(); var page = new TabPage(); Form.LogWindow.AppendText("\nCreate control layout, bounds, and themes.."); ruler.Dock = System.Windows.Forms.DockStyle.Top; ruler.Target = textBox; ruler.BackColor = ColorTranslator.FromHtml("#f8f8f8"); ruler.BackColor2 = ColorTranslator.FromHtml("#f8f8f8"); ruler.Visible = false; map.Dock = System.Windows.Forms.DockStyle.Right; map.Target = textBox; map.Width = 100; map.BackColor = Color.White; map.Visible = false; map.MapBackground = ColorTranslator.FromHtml("#e3e3e3"); map.ScrollbarVisible = false; textBox.Dock = System.Windows.Forms.DockStyle.Fill; textBox.AutoCompleteBrackets = true; textBox.AutoIndent = true; textBox.LeftPadding = 25; textBox.IndentBackColor = Color.White; textBox.ServiceLinesColor = Color.White; textBox.LineNumberColor = Color.Teal; textBox.Font = new Font("Consolas", 9); textBox.Language = detectLang(fileName); textBox.FoldingIndicatorColor = Color.FromArgb(156, 156, 156); if (File.Exists(fileName)) { textBox.OpenFile(fileName); Properties.Settings.Default.Recent += fileName + "|"; Properties.Settings.Default.Save(); } page = new TabPage { Text = Path.GetFileName(fileName), Tag = fileName }; textBox.AllowSeveralTextStyleDrawing = true; textBox.DragEnter += TextBox_DragEnter; textBox.DragDrop += TextBox_DragDrop; textBox.AllowDrop = true; FindTextTemplate find = new FindTextTemplate(textBox); find.Dock = DockStyle.Top; ReplaceTextTemplate replace = new ReplaceTextTemplate(textBox); replace.Dock = DockStyle.Top; // page.Controls.Add (find); //page.Controls.Add (replace); Form.LogWindow.AppendText("\nAdding new themed controls to tabs.."); page.Controls.Add(ruler); page.Controls.Add(map); page.Controls.Add(textBox); textBox.BringToFront(); TabControl.TabPages.Add(page); Form.LogWindow.AppendText("\nCreating a new instance of new tab button"); TabControl.TabPages.Add(new TabPage() { Text = "+" }); TabControl.SelectedTab = page; Form.LogWindow.AppendText("\nTab created: [" + fileName + ", TabIndex: " + Convert.ToString(TabControl.TabPages.Count - 1) + "]"); }