private void fontSizeToolStripComboBox_Validated(object sender, EventArgs e) { syntaxTreeViewer.UndoAdd(); fontSizeToolStripComboBox.Text = Convert.ToString(StringToFontSize(fontSizeToolStripComboBox.Text)); SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); sp.FontSize = StringToFontSize(fontSizeToolStripComboBox.Text); syntaxTreeViewer.UpdateEverything(true); }
private void fontToolStripComboBox_Validated(object sender, EventArgs e) { syntaxTreeViewer.UndoAdd(); SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); sp.FontName = fontToolStripComboBox.Text; syntaxTreeViewer.UpdateEverything(true); }
private void fontColorToolStripComboBox_SelectionChangeCommitted(object sender, EventArgs e) { syntaxTreeViewer.UndoAdd(); SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); sp.Color = ((SolidBrush)fontColorToolStripComboBox.SelectedItem).Color; syntaxTreeViewer.UpdateEverything(true); }
private bool DoFont(bool forReal) { bool done = false; if (syntaxTreeViewer.GetSelection().Count > 0) { if (forReal) { SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); Font theFont = sp.Font; theFont = GeneralPickFont(this, theFont); if (theFont != null) { syntaxTreeViewer.UndoAdd(); sp.Font = theFont; UpdateFontToolBar(); syntaxTreeViewer.UpdateEverything(true); } } done = true; } return done; }
private bool DoColor(bool forReal) { bool done = false; if (syntaxTreeViewer.GetSelection().Count > 0) { if (forReal) { SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); Color theColor = sp.Color; theColor = GeneralPickColor(this, theColor); if (theColor != Color.Empty) { syntaxTreeViewer.UndoAdd(); sp.Color = theColor; UpdateFontToolBar(); syntaxTreeViewer.UpdateEverything(true); } } done = true; } return done; }
private void applyUnderline() { syntaxTreeViewer.UndoAdd(); SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, syntaxTreeViewer.GetSelection()); if (sp.Underline == Ternary.No) sp.Underline = Ternary.Yes; else sp.Underline = Ternary.No; syntaxTreeViewer.UpdateEverything(true); UpdateFontToolBar(); }
private void UpdateFontToolBar() { List<Elem> selected = syntaxTreeViewer.GetSelection(); //mainToolStrip.SuspendLayout(); if (selected == null || selected.Count == 0) { mainToolStrip.Enabled = false; fontToolStripComboBox.Text = String.Empty; fontSizeToolStripComboBox.Text = String.Empty; fontColorToolStripComboBox.SelectedItem = Brushes.Black; boldToolStripButton.Checked = false; italicToolStripButton.Checked = false; underlineToolStripButton.Checked = false; superscriptToolStripButton.Checked = false; subscriptToolStripButton.Checked = false; strikeoutToolStripButton.Checked = false; return; } SelectionProxy sp = new SelectionProxy(syntaxTreeViewer, nodeEditor, selected); FormatChanges fc = sp.SelectionSummary(); fontToolStripComboBox.SelectedIndex = -1; fontToolStripComboBox.Text = fc.fontfamily; if (fc.fontsize == 0f) fontSizeToolStripComboBox.Text = String.Empty; else fontSizeToolStripComboBox.Text = Convert.ToString(fc.fontsize); if (fc.color == Color.Empty) fontColorToolStripComboBox.SelectedIndex = 0; else fontColorToolStripComboBox.SelectedIndex = IndexOfFontColor(fc.color); CheckButton(boldToolStripButton, fc.bold); CheckButton(italicToolStripButton, fc.italic); CheckButton(underlineToolStripButton, fc.underline); CheckButton(superscriptToolStripButton, fc.superscript); CheckButton(subscriptToolStripButton, fc.subscript); CheckButton(strikeoutToolStripButton, fc.strikeout); mainToolStrip.Enabled = true; //mainToolStrip.ResumeLayout(false); }