Beispiel #1
0
 private bool HandleGlobalKeys(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F && e.Control)
     {
         FindReplaceMode = FindReplaceState.Find;
         e.Handled       = true;
         return(true);
     }
     else if (e.KeyCode == Keys.H && e.Control)
     {
         FindReplaceMode = FindReplaceState.Replace;
         e.Handled       = true;
         return(true);
     }
     else if (e.KeyCode == Keys.F3 && e.Shift)
     {
         if (FindReplaceMode != FindReplaceState.None)
         {
             FindPrevious();
         }
     }
     else if (e.KeyCode == Keys.F3)
     {
         if (FindReplaceMode != FindReplaceState.None)
         {
             FindNext();
         }
     }
     return(false);
 }
Beispiel #2
0
 void textbox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         FindReplaceMode = FindReplaceState.None;
     }
     HandleGlobalKeys(e);
 }
Beispiel #3
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     try
     {
         FindReplaceMode = FindReplaceState.None;
     }
     catch (Exception ex)
     {
         Utils.HandleError(ex);
     }
 }
Beispiel #4
0
        public FullEditor()
        {
            InitializeComponent();

            _renderer = new SearchResultBackgroundRenderer();
            editor.Editor.TextArea.TextView.BackgroundRenderers.Add(_renderer);
            editor.FileOpening += (s, e) => OpenFile(e.Path);

            editor.KeyDown          += editor_KeyDown;
            editor.RunRequested     += editor_RunRequested;
            editor.SelectionChanged += editor_SelectionChanged;
            editor.TextChanged      += editor_TextChanged;

            txtFind.SingleLine       = true;
            txtFind.TextChanged     += txtFind_TextChanged;
            txtFind.RunRequested    += txtFind_RunRequested;
            txtFind.KeyDown         += textbox_KeyDown;
            txtReplace.SingleLine    = true;
            txtReplace.RunRequested += txtReplace_RunRequested;
            txtReplace.KeyDown      += textbox_KeyDown;

            FindReplaceMode = FindReplaceState.None;
        }
Beispiel #5
0
 public void Replace()
 {
     FindReplaceMode = FindReplaceState.Replace;
 }
Beispiel #6
0
 public void Find()
 {
     FindReplaceMode = FindReplaceState.Find;
 }
 private void btnClose_Click(object sender, EventArgs e)
 {
   try
   {
     FindReplaceMode = FindReplaceState.None;
   }
   catch (Exception ex)
   {
     Utils.HandleError(ex);
   }
 }
 private bool HandleGlobalKeys(KeyEventArgs e)
 {
   if (e.KeyCode == Keys.F && e.Control)
   {
     FindReplaceMode = FindReplaceState.Find;
     e.Handled = true;
     return true;
   }
   else if (e.KeyCode == Keys.H && e.Control)
   {
     FindReplaceMode = FindReplaceState.Replace;
     e.Handled = true;
     return true;
   }
   else if (e.KeyCode == Keys.F3 && e.Shift)
   {
     if (FindReplaceMode != FindReplaceState.None)
       FindPrevious();
   }
   else if (e.KeyCode == Keys.F3)
   {
     if (FindReplaceMode != FindReplaceState.None)
       FindNext();
   }
   return false;
 }
 void textbox_KeyDown(object sender, KeyEventArgs e)
 {
   if (e.KeyCode == Keys.Escape)
   {
     FindReplaceMode = FindReplaceState.None;
   }
   HandleGlobalKeys(e);
 }
 public void Replace()
 {
   FindReplaceMode = FindReplaceState.Replace;
 }
 public void Find()
 {
   FindReplaceMode = FindReplaceState.Find;
 }
    public FullEditor()
    {
      InitializeComponent();

      _renderer = new SearchResultBackgroundRenderer();
      editor.Editor.TextArea.TextView.BackgroundRenderers.Add(_renderer);

      editor.KeyDown += editor_KeyDown;
      editor.RunRequested += editor_RunRequested;
      editor.SelectionChanged += editor_SelectionChanged;
      editor.TextChanged += editor_TextChanged;

      txtFind.SingleLine = true;
      txtFind.TextChanged += txtFind_TextChanged;
      txtFind.RunRequested += txtFind_RunRequested;
      txtFind.KeyDown += textbox_KeyDown;
      txtReplace.SingleLine = true;
      txtReplace.RunRequested += txtReplace_RunRequested;
      txtReplace.KeyDown += textbox_KeyDown;

      FindReplaceMode = FindReplaceState.None;
    }