Ejemplo n.º 1
0
        public TextArea(TextEditorControl motherTextEditorControl, TextAreaControl motherTextAreaControl)
        {
            this.motherTextAreaControl   = motherTextAreaControl;
            this.motherTextEditorControl = motherTextEditorControl;
            this.caret                    = new ICSharpCode.TextEditor.Caret(this);
            this.selectionManager         = new ICSharpCode.TextEditor.Document.SelectionManager(this.Document, this);
            this.textAreaClipboardHandler = new TextAreaClipboardHandler(this);
            base.ResizeRedraw             = true;
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            base.SetStyle(ControlStyles.Opaque, false);
            base.SetStyle(ControlStyles.ResizeRedraw, true);
            base.SetStyle(ControlStyles.Selectable, true);
            this.textView      = new ICSharpCode.TextEditor.TextView(this);
            this.gutterMargin  = new ICSharpCode.TextEditor.GutterMargin(this);
            this.foldMargin    = new ICSharpCode.TextEditor.FoldMargin(this);
            this.iconBarMargin = new ICSharpCode.TextEditor.IconBarMargin(this);
            List <AbstractMargin> abstractMargins = this.leftMargins;

            AbstractMargin[] abstractMarginArray = new AbstractMargin[] { this.iconBarMargin, this.gutterMargin, this.foldMargin };
            abstractMargins.AddRange(abstractMarginArray);
            this.OptionsChanged();
            (new TextAreaMouseHandler(this)).Attach();
            (new TextAreaDragDropHandler()).Attach(this);
            this.bracketshemes.Add(new BracketHighlightingSheme('{', '}'));
            this.bracketshemes.Add(new BracketHighlightingSheme('(', ')'));
            this.bracketshemes.Add(new BracketHighlightingSheme('[', ']'));
            this.caret.PositionChanged                   += new EventHandler(this.SearchMatchingBracket);
            this.Document.TextContentChanged             += new EventHandler(this.TextContentChanged);
            this.Document.FoldingManager.FoldingsChanged += new EventHandler(this.DocumentFoldingsChanged);
        }
Ejemplo n.º 2
0
 private void RepaintBookmarks()
 {
     ICSharpCode.TextEditor.TextArea textArea = ActiveTextAreaControl.TextArea;
     if (null != textArea)
     {
         ICSharpCode.TextEditor.IconBarMargin margin = textArea.IconBarMargin;
         if (null != margin)
         {
             margin.Paint(textArea.CreateGraphics(), textArea.DisplayRectangle);
         }
     }
 }
Ejemplo n.º 3
0
        void IconBarMargin_MouseDown(ICSharpCode.TextEditor.AbstractMargin sender, System.Drawing.Point mousepos, System.Windows.Forms.MouseButtons mouseButtons)
        {
            // Determine if bookmarks or breakpoints need to be added or removed
            ICSharpCode.TextEditor.IconBarMargin margin = sender as ICSharpCode.TextEditor.IconBarMargin;
            if (null == margin || System.Windows.Forms.MouseButtons.Left != mouseButtons)
            {
                return;
            }

            System.Drawing.Rectangle viewRect = margin.TextArea.TextView.DrawingPosition;
            int line = margin.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top).Line;

            ToggleBreakPoint(line);
        }
Ejemplo n.º 4
0
 public override void Draw(ICSharpCode.TextEditor.IconBarMargin margin, System.Drawing.Graphics g, System.Drawing.Point p)
 {
     margin.DrawBreakpoint(g, p.Y, true, true);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Draws an arrow.
 /// </summary>
 public override void Draw(ICSharpCode.TextEditor.IconBarMargin margin, Graphics g, Point p)
 {
     margin.DrawArrow(g, p.Y);
 }