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); }
void IconBarMargin_Painted(ICSharpCode.TextEditor.AbstractMargin sender, System.Drawing.Graphics g, System.Drawing.Rectangle rect) { if (m_active_breakline < 0) { return; } ICSharpCode.TextEditor.TextArea textArea = this.ActiveTextAreaControl.TextArea; int lineNumber = textArea.Document.GetVisibleLine(m_active_breakline); int lineHeight = textArea.TextView.FontHeight; int yPos = (int)(lineNumber * lineHeight) - textArea.VirtualTop.Y; if (IsLineInsideRegion(yPos, yPos + lineHeight, rect.Y, rect.Bottom)) { if (lineNumber == textArea.Document.GetVisibleLine(m_active_breakline - 1)) { // marker is inside folded region, do not draw it } else { textArea.IconBarMargin.DrawArrow(g, yPos); } } }