public void OpenSearch()
        {
            SearchManager.SearchBox = TxtSearch;
            SearchManager.TextArea  = textControl;

            if (!SearchIsOpen)
            {
                SearchIsOpen = true;
                InvokeIfNeeded(delegate()
                {
                    PanelSearch.Visible = true;
                    TxtSearch.Text      = SearchManager.LastSearch;
                    TxtSearch.Focus();
                    TxtSearch.SelectAll();
                });
            }
            else
            {
                InvokeIfNeeded(delegate()
                {
                    TxtSearch.Focus();
                    TxtSearch.SelectAll();
                });
            }
        }
示例#2
0
        private void OpenSearch()
        {
            SearchManager.SearchBox = TxtSearch;
            SearchManager.TextArea  = m_rScintilla_TextArea;

            if (!SearchIsOpen)
            {
                SearchIsOpen = true;
                InvokeIfNeeded(delegate()
                {
                    PanelSearch.Visible = true;
                    TxtSearch.Text      = SearchManager.LastSearch;
                    TxtSearch.Focus();
                    TxtSearch.SelectAll();
                });
            }
            else
            {
                InvokeIfNeeded(delegate()
                {
                    TxtSearch.Focus();
                    TxtSearch.SelectAll();
                });
            }
        }
示例#3
0
        public void ShowFor(TextEditX dad, TextEditorControl editor, bool replaceMode)
        {
            Editor = editor;
            Dad    = dad;

            _search.ClearScanRegion();
            var sm = editor.ActiveTextAreaControl.SelectionManager;

            if (sm.HasSomethingSelected && sm.SelectionCollection.Count == 1)
            {
                var sel = sm.SelectionCollection[0];
                if (sel.StartPosition.Line == sel.EndPosition.Line)
                {
                    TxtSearch.Text = sm.SelectedText;
                }
                else
                {
                    _search.SetScanRegion(sel);
                }
            }
            else
            {
                // Get the current word that the caret is on
                Caret caret = editor.ActiveTextAreaControl.Caret;
                int   start = TextUtilities.FindWordStart(editor.Document, caret.Offset);
                int   endAt = TextUtilities.FindWordEnd(editor.Document, caret.Offset);
                TxtSearch.Text = editor.Document.GetText(start, endAt - start);
            }

            //ReplaceMode = replaceMode;

            this.Owner = (Form)editor.TopLevelControl;
            this.Show();

            TxtSearch.SelectAll();
            TxtSearch.Focus();

            if (!_highlightGroups.ContainsKey(_editor))
            {
                _highlightGroups[_editor] = new HighlightGroup(_editor);
            }
            HighlightGroup group = _highlightGroups[_editor];

            group.ClearMarkers();
        }
示例#4
0
 private void OpenSearch()
 {
     if (!searchOpen)
     {
         searchOpen = true;
         InvokeIfNeeded(delegate() {
             PanelSearch.Visible = true;
             TxtSearch.Text      = lastSearch;
             TxtSearch.Focus();
             TxtSearch.SelectAll();
         });
     }
     else
     {
         InvokeIfNeeded(delegate() {
             TxtSearch.Focus();
             TxtSearch.SelectAll();
         });
     }
 }