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); }
private void btnClose_Click(object sender, EventArgs e) { try { FindReplaceMode = FindReplaceState.None; } catch (Exception ex) { Utils.HandleError(ex); } }
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; }
public void Replace() { FindReplaceMode = FindReplaceState.Replace; }
public void Find() { FindReplaceMode = FindReplaceState.Find; }
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; }
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; }