public static void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons) { try { if (mouseButtons != MouseButtons.Left) { return; } Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; //Point logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) { string s = iconBar.TextArea.MotherTextEditorControl.FileName; if (s == null) { s = TextAreaHelper.GetFileNameByTextArea(iconBar.TextArea); } ToggleBreakpointAt(iconBar.TextArea.Document, s, logicPos.Y); iconBar.TextArea.Refresh(iconBar); } } catch (System.Exception e) { } }
public static void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons) { try { if (mouseButtons != MouseButtons.Left) { if (mouseButtons == MouseButtons.Right) { iconBar.TextArea.MotherTextEditorControl.ContextMenuStrip = null; Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) { cur_bookmark = IsOnBreakpoint(iconBar.TextArea.Document, logicPos.Y); if (cur_bookmark != null) { iconBar.TextArea.MotherTextEditorControl.ContextMenuStrip = VisualPABCSingleton.MainForm.BreakpointMenuStrip; } } } return; } else { Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition; //Point logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); ICSharpCode.TextEditor.TextLocation logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top); if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) { string s = iconBar.TextArea.MotherTextEditorControl.FileName; if (s == null) { s = TextAreaHelper.GetFileNameByTextArea(iconBar.TextArea); } ToggleBreakpointAt(iconBar.TextArea.Document, s, logicPos.Y); iconBar.TextArea.Refresh(iconBar); } } } catch (System.Exception e) { } }