Ejemplo n.º 1
0
        public TextEditorControl()
        {
            SetStyle(ControlStyles.ContainerControl, true);

            textAreaPanel.Dock = DockStyle.Fill;

            Document = (new DocumentFactory()).CreateDocument();
            Document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategy();

            primaryTextArea                    = new TextAreaControl(this);
            activeTextAreaControl              = primaryTextArea;
            primaryTextArea.TextArea.GotFocus += delegate {
                SetActiveTextAreaControl(primaryTextArea);
            };
            primaryTextArea.Dock = DockStyle.Fill;
            textAreaPanel.Controls.Add(primaryTextArea);
            InitializeTextAreaControl(primaryTextArea);
            Controls.Add(textAreaPanel);
            ResizeRedraw             = true;
            Document.UpdateCommited += new EventHandler(CommitUpdateRequested);
            OptionsChanged();
        }
Ejemplo n.º 2
0
        public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl)
        {
            this.motherTextAreaControl   = motherTextAreaControl;
            this.motherTextEditorControl = motherTextEditorControl;

            caret            = new Caret(this);
            selectionManager = new SelectionManager(Document, this);

            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);

            textView = new TextView(this);

            gutterMargin  = new GutterMargin(this);
            foldMargin    = new FoldMargin(this);
            iconBarMargin = new IconBarMargin(this);
            leftMargins.AddRange(new AbstractMargin[] { iconBarMargin, gutterMargin, foldMargin });
            OptionsChanged();


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

            bracketshemes.Add(new BracketHighlightingSheme('{', '}'));
            bracketshemes.Add(new BracketHighlightingSheme('(', ')'));
            bracketshemes.Add(new BracketHighlightingSheme('[', ']'));

            caret.PositionChanged                   += new EventHandler(SearchMatchingBracket);
            Document.TextContentChanged             += new EventHandler(TextContentChanged);
            Document.FoldingManager.FoldingsChanged += new EventHandler(DocumentFoldingsChanged);
        }
Ejemplo n.º 3
0
 protected virtual void InitializeTextAreaControl(TextAreaControl newControl)
 {
 }