protected override void OnMarginClick(MarginClickEventArgs e) { int line = LineFromPosition(e.Position); ToggleBreakpoint(line); base.OnMarginClick(e); }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { //if (e.Margin == BOOKMARK_MARGIN) //{ // // Do we have a marker for this line? // const uint mask = (1 << BOOKMARK_MARKER); // var line = TextArea.Lines[TextArea.LineFromPosition(e.Position)]; // if ((line.MarkerGet() & mask) > 0) // { // // Remove existing bookmark // line.MarkerDelete(BOOKMARK_MARKER); // } // else // { // // Add bookmark // line.MarkerAdd(BOOKMARK_MARKER); // } //} if (e.Margin == BOOKMARK_MARGIN) { var line = this.TextArea.Lines[this.TextArea.LineFromPosition(e.Position)]; Console.WriteLine(" => Click at line : " + line.Index); } }
private static void TextArea_MarginClick(object sender, MarginClickEventArgs e) { ScintillaNET.WPF.ScintillaWPF scintilla = ((MainWindow)App.Current.MainWindow).ActiveDocument.scintilla; if (e.Margin == ScintillaConstants.BREAKPOINT_MARGIN) { const uint mask = (1 << ScintillaConstants.BREAKPOINT_MARKER); Line line = scintilla.Lines[scintilla.LineFromPosition(e.Position)]; scintilla.IndicatorCurrent = ScintillaConstants.BREAKPOINT_INDICATOR; if ((line.MarkerGet() & mask) > 0) { line.MarkerDelete(ScintillaConstants.BREAKPOINT_MARKER); line.MarkerDelete(ScintillaConstants.BREAKPOINT_BG); scintilla.IndicatorClearRange(line.Position, line.Length); } else { int breakPointStartPosition, breakPointHighlightLength; if (ScintillaBreakPointValidator.IsBreakPointAllowed(scintilla, line, out breakPointStartPosition, out breakPointHighlightLength)) { line.MarkerAdd(ScintillaConstants.BREAKPOINT_MARKER); scintilla.IndicatorFillRange(breakPointStartPosition, breakPointHighlightLength); } } } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { var line = TextArea.Lines[TextArea.LineFromPosition(e.Position)]; // Do we have a marker for this line? if ((line.MarkerGet() & BREAKPOINT_MASK) > 0) { if (!_debugger.RemoveBreakpoint(line.Index)) { SendLogToPanel("Error removing breakpoint."); return; } // Remove existing from UI line.MarkerDelete(BREAKPOINT_MARKER); } else { if (!_debugger.AddBreakpoint(line.Index)) { SendLogToPanel("Error adding breakpoint."); return; } // Add breakpoint to UI line.MarkerAdd(BREAKPOINT_MARKER); } } }
private void NoteEdit_MarginClick(object sender, MarginClickEventArgs e) { if (_viewmodel?.SelectedNote == null) { return; } if (e.Margin == ScintillaHighlighter.STYLE_MARGIN_LISTSYMBOLS) { bool listHighlight = (Settings.ListMode == ListHighlightMode.Always) || (Settings.ListMode == ListHighlightMode.WithTag && _viewmodel?.SelectedNote?.HasTagCaseInsensitive(AppSettings.TAG_LIST) == true); if (listHighlight) { var line = NoteEdit.Lines[NoteEdit.LineFromPosition(e.Position)]; var mark = line.MarkerGet(); if ((mark & (1 << ScintillaHighlighter.STYLE_MARKER_LIST_ON)) != 0) { var mrk = _highlighterDefault.FindListMarkerChar(NoteEdit.Lines, ListHighlightValue.FALSE); var newText = _highlighterDefault.ChangeListLine(line.Text, mrk ?? ' '); NoteEdit.TargetStart = line.Position; NoteEdit.TargetEnd = line.EndPosition; NoteEdit.ReplaceTarget(newText); } else if ((mark & (1 << ScintillaHighlighter.STYLE_MARKER_LIST_OFF)) != 0) { if (e.Modifiers.HasFlag(Keys.Control)) { var mrk = _highlighterDefault.FindListMarkerChar(NoteEdit.Lines, ListHighlightValue.INTERMED); var newText = _highlighterDefault.ChangeListLine(line.Text, mrk ?? '~'); NoteEdit.TargetStart = line.Position; NoteEdit.TargetEnd = line.EndPosition; NoteEdit.ReplaceTarget(newText); } else { var mrk = _highlighterDefault.FindListMarkerChar(NoteEdit.Lines, ListHighlightValue.TRUE); var newText = _highlighterDefault.ChangeListLine(line.Text, mrk ?? 'X'); NoteEdit.TargetStart = line.Position; NoteEdit.TargetEnd = line.EndPosition; NoteEdit.ReplaceTarget(newText); } } else if ((mark & (1 << ScintillaHighlighter.STYLE_MARKER_LIST_MIX)) != 0) { var mrk = _highlighterDefault.FindListMarkerChar(NoteEdit.Lines, ListHighlightValue.TRUE); var newText = _highlighterDefault.ChangeListLine(line.Text, mrk ?? 'X'); NoteEdit.TargetStart = line.Position; NoteEdit.TargetEnd = line.EndPosition; NoteEdit.ReplaceTarget(newText); } } } }
private void scintillaControl_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == ScintillaMargin.Bookmark) { SetBookmark(_scintillaControl.zGetLineFromPosition(e.Position)); } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { var line = scintillaCode.Lines[scintillaCode.LineFromPosition(e.Position)]; ChangeBookMark(line); } }
/// ------------------------------------------------------------------------------------------------- /// <summary> Event handler. Called by TextArea for margin click events. </summary> /// /// <remarks> 19/09/2018. </remarks> /// /// <param name="sender"> Source of the event. </param> /// <param name="e"> Margin click event information. </param> /// ------------------------------------------------------------------------------------------------- private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (!Program.InStepMode) { return; } MarginClicked = true; //Console.WriteLine("TextArea_MarginClick"); Scintilla s = (Scintilla)sender; if (e.Margin == CODE_MARGIN || e.Margin == BREAKPOINT_MARGIN) { const uint mask = (1 << BREAKPOINT_MARKER); int linenum = s.LineFromPosition(e.Position); var line = s.Lines[linenum]; TraceFile tf = TraceFile.FindTraceFile((string)s.Tag); if ((string)s.Tag == "Dissassembly") { tf = DisasmCodeFile; } //Section sec = FindSection((string)s.Tag); if (tf != null && tf.IsLineLegal(linenum)) { //Console.WriteLine("Line Ok"); LineData ld = tf.GetLine(linenum); if ((line.MarkerGet() & mask) > 0) { // Remove existing breakpoint Program.serialport.RemoveBreakpoint(null, ld.nextAddress.GetAddr(), ld.nextAddress.GetBank()); MainForm.myBreakpoints.RequestUpdate(); } else { // Add breakpoint Program.serialport.SetBreakpoint(null, ld.nextAddress.GetAddr(), ld.nextAddress.GetBank()); MainForm.myBreakpoints.RequestUpdate(); Console.WriteLine("Add breakpoint " + ld.nextAddress.GetAddr().ToString("X4") + " " + ld.nextAddress.GetBank()); } } } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { // Do we have a marker for this line? var line = textArea.Lines[textArea.LineFromPosition(e.Position)]; ToggleBM(line); } else if (e.Margin == BREAKPOINT_MARGIN) { // Do we have a marker for this line? var line = textArea.Lines[textArea.LineFromPosition(e.Position)]; ToggleBP(line); } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == 2) { var line = this.TextArea.Lines[this.TextArea.LineFromPosition(e.Position)]; if ((line.MarkerGet() & 4) == 0) { line.MarkerAdd(2); } else { line.MarkerDelete(2); } } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { const uint mask = (1 << BOOKMARK_MARKER); var line = scintilla1.Lines[scintilla1.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { line.MarkerDelete(BOOKMARK_MARKER); } else { line.MarkerAdd(BOOKMARK_MARKER); } } }
private void codeBox_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == 0) { var line = _codeBox.Lines[_codeBox.LineFromPosition(e.Position)]; bool isSet = (line.MarkerGet() & 0x01) == 0; OnBreakpointChanged(new BreakpointChangedEventArgs(line.Index + 1, isSet)); if (isSet) { line.MarkerAdd(0); } else { line.MarkerDelete(0); } } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == 2) { // Do we have a marker for this line? const uint mask = (1 << 2); var line = codeEdit.Lines[codeEdit.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(2); } else { // Add bookmark line.MarkerAdd(2); } } }
private void Scintilla_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == 1) { // Do we have a marker for this line? const uint mask = (1 << 1); var line = sci.Lines[sci.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(1); } else { // Add bookmark line.MarkerAdd(1); } } }
/// <summary> /// 断点 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Scintilla_OnMarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == TextEitorModal.BOOKMARK_MARGIN) { // Do we have a marker for this line? uint mask = (uint)(1 << TextEitorModal.BOOKMARK_MARKER); var line = TextEditor.Lines[TextEditor.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(TextEitorModal.BOOKMARK_MARKER); } else { // Add bookmark line.MarkerAdd(TextEitorModal.BOOKMARK_MARKER); } } }
private void codeEditor_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { // 这条线有标记吗? const uint mask = (1 << BOOKMARK_MARKER); var line = codeEditor.Lines[codeEditor.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // 删除现有的书签 line.MarkerDelete(BOOKMARK_MARKER); } else { // 添加书签 line.MarkerAdd(BOOKMARK_MARKER); } } }
private void _textArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { // Do we have a marker for this line? const uint mask = (1 << BOOKMARK_MARKER); var line = _textArea.Lines[_textArea.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(BOOKMARK_MARKER); } else { // Add bookmark line.MarkerAdd(BOOKMARK_MARKER); } } }
private void editor_MarginClick(object sender, MarginClickEventArgs e) { if (m_currentFile == null) { return; } if (e.Margin == 0) { var lineIndex = editor.LineFromPosition(e.Position); var line = editor.Lines[lineIndex]; if ((line.MarkerGet() & (1u << MARKER_BREAKPOINT)) != 0) { var bpIndex = m_breakpoints.FindIndex(bp => bp.Line == lineIndex + 1 && bp.Filename == m_currentFile); if (bpIndex != -1) { m_breakpoints.RemoveAt(bpIndex); } line.MarkerDelete(MARKER_BREAKPOINT); m_writer.Write((ushort)5); } else { m_breakpoints.Add(new ScriptBreakpoint() { Filename = m_currentFile, Line = lineIndex + 1 }); line.MarkerAdd(MARKER_BREAKPOINT); m_writer.Write((ushort)4); } m_writer.Write((ushort)m_currentFile.Length); m_writer.Write(Encoding.UTF8.GetBytes(m_currentFile)); m_writer.Write(lineIndex + 1); RefreshBreakpointsList(); } }
private void scintilla_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin != BookmarkMargin) { return; } const uint mask = (1 << BookmarkMarker); var line = Scintilla.Lines[Scintilla.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { line.MarkerDelete(BookmarkMarker); } else { line.MarkerAdd(BookmarkMarker); } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { ScintillaNET.WPF.ScintillaWPF TextArea = Document.ActiveDocument.Scintilla; if (e.Margin == BOOKMARK_MARGIN) { // Do we have a marker for this line? const uint mask = (1 << BOOKMARK_MARKER); var line = TextArea.Lines[TextArea.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(BOOKMARK_MARKER); } else { // Add bookmark line.MarkerAdd(BOOKMARK_MARKER); } } }
static private void editor_MarginClick(object sender, MarginClickEventArgs e) { Scintilla editor = (Scintilla)sender; if (e.Margin == BOOKMARK_MARGIN) { // Do we have a marker for this line? const uint mask = (1 << BOOKMARK_MARKER); var line = editor.Lines[editor.LineFromPosition(e.Position)]; if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(BOOKMARK_MARKER); } else { // Add bookmark line.MarkerAdd(BOOKMARK_MARKER); } } }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (e.Margin == BOOKMARK_MARGIN) { // Do we have a marker for this line? const uint mask = (1 << BREAKPOINT_MARKER); var line = TextArea.Lines[TextArea.LineFromPosition(e.Position)]; var ofs = ResolveOffset(line.Index); if ((line.MarkerGet() & mask) > 0) { // Remove existing bookmark line.MarkerDelete(BREAKPOINT_MARKER); line.MarkerDelete(BREAKPOINT_BG); if (ofs >= 0) // should always be true { debugger.SetBreakpointState(ofs, false); } } else { // check if was possible to resolve this line to a valid offset in the script if (ofs >= 0) { // Add bookmark line.MarkerAdd(BREAKPOINT_MARKER); line.MarkerAdd(BREAKPOINT_BG); // enable a breakpoint in the VM debugger.SetBreakpointState(ofs, true); } } } }
private void scint_MarginClick(object sender, MarginClickEventArgs e) { }
/// ------------------------------------------------------------------------------------------------- /// <summary> Event handler. Called by TextArea for margin click events. </summary> /// /// <remarks> 19/09/2018. </remarks> /// /// <param name="sender"> Source of the event. </param> /// <param name="e"> Margin click event information. </param> /// ------------------------------------------------------------------------------------------------- private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { if (!Program.InStepMode) { return; } MarginClicked = true; //Console.WriteLine("TextArea_MarginClick"); Scintilla s = (Scintilla)sender; if (e.Margin == CODE_MARGIN || e.Margin == BREAKPOINT_MARGIN) { const uint mask = (1 << BREAKPOINT_MARKER); int linenum = s.LineFromPosition(e.Position); var line = s.Lines[linenum]; TraceFile tf = TraceFile.FindTraceFile((string)s.Tag); //Section sec = FindSection((string)s.Tag); if (tf != null && tf.IsLineLegal(linenum)) { //Console.WriteLine("Line Ok"); LineData ld = tf.GetLine(linenum); //Form1.commsthread.AddCommand(Command.disassmblememory, 50, " " + ld.Addess.ToString("X4") + "H 256"); //now request memory and display is asm window if ((line.MarkerGet() & mask) > 0) { // Remove existing breakpoint //line.MarkerDelete(BOOKMARK_MARKER); //line.MarkerDelete(BREAKPOINT_MARKER); if (Breakpoint.RemoveBreakPointAtAddress(ld.address)) { } //Form1.commsthread.AddCommand(Command.direct, 76, "disable-breakpoint 1"); } else { // Add breakpoint if (Breakpoint.SetBreakPoint(ld.address, Breakpoint.BreakpointType.PC, "PC=" + ld.address.ToString("X4") + "H", tf.filename, linenum)) { } // // // //if (Program.AddBreakpoint(ld.address)) //{ // line.MarkerAdd(BREAKPOINT_MARKER); //} // //line.MarkerAdd(BOOKMARK_MARKER); //LineData ld = cf.GetLine(linenum); //Form1.commsthread.AddCommand(Command.setbreakpointaction, 76, " 1 break"); //Form1.commsthread.AddCommand(Command.setbreakpoint, 75, " 1 PC="+ld.Addess.ToString("x4")+"H"); //Form1.commsthread.AddCommand(Command.direct, 74, "enable-breakpoint 1"); } } } /* if (e.Margin == BOOKMARK_MARGIN) * { * * CodeFile cf = GetCodeFileFromSection((string)s.Tag); * * * * // Do we have a marker for this line? * const uint mask = (1 << BOOKMARK_MARKER); * int linenum = s.LineFromPosition(e.Position); * var line = s.Lines[linenum]; * * * if (cf.IsLineLegal(linenum)) * { * if ((line.MarkerGet() & mask) > 0) * { * // Remove existing breakpoint * line.MarkerDelete(BOOKMARK_MARKER); * line.MarkerDelete(BREAKPOINT_MARKER); * * * //Form1.commsthread.AddCommand(Command.direct, 76, "disable-breakpoint 1"); * * * } * else * { * // Add breakpoint * line.MarkerAdd(BOOKMARK_MARKER); * line.MarkerAdd(BREAKPOINT_MARKER); * * LineData ld = cf.GetLine(linenum); * * //Form1.commsthread.AddCommand(Command.setbreakpointaction, 76, " 1 break"); * Form1.commsthread.AddCommand(Command.setbreakpoint, 75, " 1 PC="+ld.Addess.ToString("x4")+"H"); * //Form1.commsthread.AddCommand(Command.direct, 74, "enable-breakpoint 1"); * * } * * } * * * * }*/ }
public MarginClickExEventArgs(Scintilla scintilla, MarginClickEventArgs baseArgs) : base(scintilla, baseArgs.Modifiers, 0, baseArgs.Margin) { _position = baseArgs.Position; _lineNumber = scintilla.LineFromPosition(_position); }
private void ExecutingBox_MarginClick(object sender, MarginClickEventArgs e) //Only used for Margins { }
private void TextArea_MarginClick(object sender, MarginClickEventArgs e) { }