示例#1
0
 private void scintillaControl_MarginClick(object sender, MarginClickEventArgs e)
 {
     if (e.Margin == ScintillaMargin.Bookmark)
     {
         SetBookmark(_scintillaControl.zGetLineFromPosition(e.Position));
     }
 }
示例#2
0
 private void HandleMarginClick(object sender, MarginClickEventArgs e)
 {
     switch (e.Margin)
     {
     /// ON BOOKMARK MARGIN CLICK
     case BREAKPOINT_MARGIN:
         var line = Lines[LineFromPosition(e.Position)];
         // Do we have a marker for this line?
         if ((line.MarkerGet() & BREAKPOINT_MARKER_MASK) > 0)
         {
             // remove existing bookmark
             line.MarkerDelete(BREAKPOINT_MARKER);
         }
         else
         {
             // add bookmark
             line.MarkerAdd(BREAKPOINT_MARKER);
         }
         break;
     }
 }
示例#3
0
 private void ScnMarginClick(ref NativeMethods.SCNotification scn)
 {
     var keys = Keys.Modifiers & (Keys)(scn.modifiers << 16);
     var eventArgs = new MarginClickEventArgs(this, keys, scn.position, scn.margin);
     OnMarginClick(eventArgs);
 }
示例#4
0
 /// <summary>
 /// Raises the <see cref="MarginClick" /> event.
 /// </summary>
 /// <param name="e">A <see cref="MarginClickEventArgs" /> that contains the event data.</param>
 protected virtual void OnMarginClick(MarginClickEventArgs e)
 {
     var handler = Events[marginClickEventKey] as EventHandler<MarginClickEventArgs>;
     if (handler != null)
         handler(this, e);
 }
示例#5
0
        /// <summary>
        ///     Raises the <see cref="MarginClick"/> event.
        /// </summary>
        /// <param name="e">An <see cref="MarginClickEventArgs"/> that contains the event data.</param>
        protected virtual void OnMarginClick(MarginClickEventArgs e)
        {
            EventHandler<MarginClickEventArgs> handler = Events[_marginClickEventKey] as EventHandler<MarginClickEventArgs>;
            if (handler != null)
                handler(this, e);

            if (e.ToggleMarkerNumber >= 0)
            {
                int mask = (int)Math.Pow(2, e.ToggleMarkerNumber);
                if ((e.Line.GetMarkerMask() & mask) == mask)
                    e.Line.DeleteMarker(e.ToggleMarkerNumber);
                else
                    e.Line.AddMarker(e.ToggleMarkerNumber);
            }

            if (e.ToggleFold)
                e.Line.ToggleFoldExpanded();
        }
示例#6
0
 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 MarginClickHandler(object sender, MarginClickEventArgs e)
        {
            int i = ScintillaInstance.LineFromPosition(e.Position);

            ToggleBreakPoint(i);
        }
示例#8
0
        private void ScintillaMarginClickHandler(object sender, MarginClickEventArgs e)
        {
            Scintilla scintilla = sender as Scintilla;
            int line = scintilla.LineFromPosition(e.Position);

            ToggleBreakPoint(line);
        }