示例#1
0
 private void redoStripButton_Click(object sender, EventArgs e)
 {
     if (CurrentFastColoredTextBox.RedoEnabled)
     {
         CurrentFastColoredTextBox.Redo();
     }
 }
示例#2
0
 private void bookmarkMinusButton_Click(object sender, EventArgs e)
 {
     if (CurrentFastColoredTextBox == null)
     {
         return;
     }
     CurrentFastColoredTextBox.UnbookmarkLine(CurrentFastColoredTextBox.Selection.Start.iLine);
 }
示例#3
0
 private void dgvObjectExplorer_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (CurrentFastColoredTextBox != null)
     {
         var item = explorerList[e.RowIndex];
         CurrentFastColoredTextBox.GoEnd();
         CurrentFastColoredTextBox.SelectionStart = item.position;
         CurrentFastColoredTextBox.DoSelectionVisible();
         CurrentFastColoredTextBox.Focus();
     }
 }
示例#4
0
 private void btInvisibleChars_Click(object sender, EventArgs e)
 {
     foreach (FATabStripItem tab in tsFiles.Items)
     {
         HighlightInvisibleChars((tab.Controls[0] as FastColoredTextBox).Range);
     }
     if (CurrentFastColoredTextBox != null)
     {
         CurrentFastColoredTextBox.Invalidate();
     }
 }
示例#5
0
 private void printToolStripButton_Click(object sender, EventArgs e)
 {
     if (CurrentFastColoredTextBox != null)
     {
         var settings = new PrintDialogSettings();
         settings.Title  = tsFiles.SelectedItem.Title;
         settings.Header = "&b&w&b";
         settings.Footer = "&b&p";
         CurrentFastColoredTextBox.Print(settings);
     }
 }
示例#6
0
 private void btShowFoldingLines_Click(object sender, EventArgs e)
 {
     foreach (FATabStripItem tab in tsFiles.Items)
     {
         (tab.Controls[0] as FastColoredTextBox).ShowFoldingLines = btShowFoldingLines.Checked;
     }
     if (CurrentFastColoredTextBox != null)
     {
         CurrentFastColoredTextBox.Invalidate();
     }
 }
示例#7
0
 private void btHighlightCurrentLine_Click(object sender, EventArgs e)
 {
     foreach (FATabStripItem tab in tsFiles.Items)
     {
         if (btHighlightCurrentLine.Checked)
         {
             (tab.Controls[0] as FastColoredTextBox).CurrentLineColor = _currentLineColor;
         }
         else
         {
             (tab.Controls[0] as FastColoredTextBox).CurrentLineColor = Color.Transparent;
         }
     }
     if (CurrentFastColoredTextBox != null)
     {
         CurrentFastColoredTextBox.Invalidate();
     }
 }
示例#8
0
        void popupMenu_Opening(object sender, CancelEventArgs e)
        {
            //---block autocomplete menu for comments
            //get index of green style (used for comments)
            var iGreenStyle = CurrentFastColoredTextBox.GetStyleIndex(CurrentFastColoredTextBox.SyntaxHighlighter.GreenStyle);

            if (iGreenStyle >= 0)
            {
                if (CurrentFastColoredTextBox.Selection.Start.iChar > 0)
                {
                    //current char (before caret)
                    var c = CurrentFastColoredTextBox[CurrentFastColoredTextBox.Selection.Start.iLine][CurrentFastColoredTextBox.Selection.Start.iChar - 1];
                    //green Style
                    var greenStyleIndex = Range.ToStyleIndex(iGreenStyle);
                    //if char contains green style then block popup menu
                    if ((c.style & greenStyleIndex) != 0)
                    {
                        e.Cancel = true;
                    }
                }
            }
        }
示例#9
0
 private void pasteToolStripButton_Click(object sender, EventArgs e)
 {
     CurrentFastColoredTextBox.Paste();
 }
示例#10
0
 private void copyToolStripButton_Click(object sender, EventArgs e)
 {
     CurrentFastColoredTextBox.Copy();
 }