Esempio n. 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);
 }
Esempio n. 2
0
 void textbox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         FindReplaceMode = FindReplaceState.None;
     }
     HandleGlobalKeys(e);
 }
Esempio n. 3
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     try
     {
         FindReplaceMode = FindReplaceState.None;
     }
     catch (Exception ex)
     {
         Utils.HandleError(ex);
     }
 }
Esempio n. 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;
        }
Esempio n. 5
0
 public void Replace()
 {
     FindReplaceMode = FindReplaceState.Replace;
 }
Esempio n. 6
0
 public void Find()
 {
     FindReplaceMode = FindReplaceState.Find;
 }
Esempio n. 7
0
 private void btnClose_Click(object sender, EventArgs e)
 {
   try
   {
     FindReplaceMode = FindReplaceState.None;
   }
   catch (Exception ex)
   {
     Utils.HandleError(ex);
   }
 }
Esempio n. 8
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;
 }
Esempio n. 9
0
 void textbox_KeyDown(object sender, KeyEventArgs e)
 {
   if (e.KeyCode == Keys.Escape)
   {
     FindReplaceMode = FindReplaceState.None;
   }
   HandleGlobalKeys(e);
 }
Esempio n. 10
0
 public void Replace()
 {
   FindReplaceMode = FindReplaceState.Replace;
 }
Esempio n. 11
0
 public void Find()
 {
   FindReplaceMode = FindReplaceState.Find;
 }
Esempio n. 12
0
    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;
    }