Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextArea"/> class.
        /// </summary>
        /// <param name="motherTextEditorControl">The mother text editor control.</param>
        /// <param name="motherTextAreaControl">The mother text area control.</param>
        public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl)
        {
            _motherTextAreaControl   = motherTextAreaControl;
            _motherTextEditorControl = motherTextEditorControl;
            _caret                    = new Caret(this);
            _selectionManager         = new SelectionManager(Document, this);
            _textAreaClipboardHandler = new TextAreaClipboardHandler(this);
            ResizeRedraw              = true;

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.Opaque, false);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.Selectable, true);

            _lineNumberMargin = new LineNumberMargin(this);
            _foldMargin       = new FoldMargin(this);
            _iconMargin       = new IconMargin(this);
            _leftMargins.AddRange(new AbstractMargin[] { _iconMargin, _lineNumberMargin, _foldMargin });
            _textView = new TextView(this);
            OptionsChanged();

            new TextAreaMouseHandler(this).Attach();
            new TextAreaDragDropHandler().Attach(this);

            _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('{', '}'));
            _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('(', ')'));
            _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('[', ']'));

            _caret.PositionChanged                 += SearchMatchingBracket;
            Document.TextContentChanged            += TextContentChanged;
            Document.FoldingManager.FoldingChanged += DocumentFoldingsChanged;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextArea"/> class.
        /// </summary>
        /// <param name="motherTextEditorControl">The mother text editor control.</param>
        /// <param name="motherTextAreaControl">The mother text area control.</param>
        public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl)
        {
            _motherTextAreaControl = motherTextAreaControl;
              _motherTextEditorControl = motherTextEditorControl;
              _caret = new Caret(this);
              _selectionManager = new SelectionManager(Document, this);
              _textAreaClipboardHandler = new TextAreaClipboardHandler(this);
              ResizeRedraw = true;

              SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
              SetStyle(ControlStyles.AllPaintingInWmPaint, true);
              SetStyle(ControlStyles.UserPaint, true);
              SetStyle(ControlStyles.Opaque, false);
              SetStyle(ControlStyles.ResizeRedraw, true);
              SetStyle(ControlStyles.Selectable, true);

              _lineNumberMargin = new LineNumberMargin(this);
              _foldMargin = new FoldMargin(this);
              _iconMargin = new IconMargin(this);
              _leftMargins.AddRange(new AbstractMargin[] { _iconMargin, _lineNumberMargin, _foldMargin });
              _textView = new TextView(this);
              OptionsChanged();

              new TextAreaMouseHandler(this).Attach();
              new TextAreaDragDropHandler().Attach(this);

              _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('{', '}'));
              _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('(', ')'));
              _bracketHighlightingSchemes.Add(new BracketHighlightingScheme('[', ']'));

              _caret.PositionChanged += SearchMatchingBracket;
              Document.TextContentChanged += TextContentChanged;
              Document.FoldingManager.FoldingChanged += DocumentFoldingsChanged;
        }