Exemplo n.º 1
0
 /// <summary>
 /// Moves the cursor to the previous marker
 /// </summary>
 public static void PreviousMarker(ScintillaControl sci, Int32 marker, Int32 line)
 {
     Int32 prev = 0; Int32 count = 0;
     Int32 lineMask = sci.MarkerGet(line);
     if ((lineMask & GetMarkerMask(marker)) != 0)
     {
         prev = sci.MarkerPrevious(line - 1, GetMarkerMask(marker));
         if (prev != -1) sci.GotoLine(prev);
         else
         {
             count = sci.LineCount;
             prev = sci.MarkerPrevious(count, GetMarkerMask(marker));
             if (prev != -1) sci.GotoLine(prev);
         }
     }
     else
     {
         prev = sci.MarkerPrevious(line, GetMarkerMask(marker));
         if (prev != -1) sci.GotoLine(prev);
         else
         {
             count = sci.LineCount;
             prev = sci.MarkerPrevious(count, GetMarkerMask(marker));
             if (prev != -1) sci.GotoLine(prev);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds or removes a marker
 /// </summary>
 public static void ToggleMarker(ScintillaControl sci, Int32 marker, Int32 line)
 {
     Int32 lineMask = sci.MarkerGet(line);
     if ((lineMask & GetMarkerMask(marker)) == 0) sci.MarkerAdd(line, marker);
     else sci.MarkerDelete(line, marker);
     UITools.Manager.MarkerChanged(sci, line);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Moves the cursor to the next marker
 /// </summary>
 public static void NextMarker(ScintillaControl sci, Int32 marker, Int32 line)
 {
     Int32 next = 0;
     Int32 lineMask = sci.MarkerGet(line);
     if ((lineMask & GetMarkerMask(marker)) != 0)
     {
         next = sci.MarkerNext(line + 1, GetMarkerMask(marker));
         if (next != -1) sci.GotoLine(next);
         else
         {
             next = sci.MarkerNext(0, GetMarkerMask(marker));
             if (next != -1) sci.GotoLine(next);
         }
     }
     else
     {
         next = sci.MarkerNext(line, GetMarkerMask(marker));
         if (next != -1) sci.GotoLine(next);
         else
         {
             next = sci.MarkerNext(0, GetMarkerMask(marker));
             if (next != -1) sci.GotoLine(next);
         }
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Moves the cursor to the next marker
        /// </summary>
        public static void NextMarker(ScintillaControl sci, Int32 marker, Int32 line)
        {
            Int32 next = 0;
            Int32 lineMask = sci.MarkerGet(line);
            if ((lineMask & GetMarkerMask(marker)) != 0)
            {
                next = sci.MarkerNext(line + 1, GetMarkerMask(marker));
                if (next != -1)
                {
                    sci.EnsureVisibleEnforcePolicy(next);
                    sci.GotoLineIndent(next);
                }
                else
                {
                    next = sci.MarkerNext(0, GetMarkerMask(marker));
                    if (next != -1)
                    {

                        sci.EnsureVisibleEnforcePolicy(next);
                        sci.GotoLineIndent(next);
                    }
                }
            }
            else
            {
                next = sci.MarkerNext(line, GetMarkerMask(marker));
                if (next != -1)
                {
                    sci.EnsureVisibleEnforcePolicy(next);
                    sci.GotoLineIndent(next);
                }
                else
                {
                    next = sci.MarkerNext(0, GetMarkerMask(marker));
                    if (next != -1)
                    {
                        sci.EnsureVisibleEnforcePolicy(next);
                        sci.GotoLineIndent(next);
                    }
                }
            }
        }
 static public Boolean IsMarkerSet(ScintillaControl sci, Int32 marker, Int32 line)
 {
     return (sci.MarkerGet(line) & GetMarkerMask(marker)) != 0;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Moves the cursor to the previous marker
 /// </summary>
 public static void PreviousMarker(ScintillaControl sci, Int32 marker, Int32 line)
 {
     Int32 prev = 0; Int32 count = 0;
     Int32 lineMask = sci.MarkerGet(line);
     if ((lineMask & GetMarkerMask(marker)) != 0)
     {
         prev = sci.MarkerPrevious(line - 1, GetMarkerMask(marker));
         if (prev != -1)
         {
             sci.EnsureVisibleEnforcePolicy(prev);
             sci.GotoLineIndent(prev);
         }
         else
         {
             count = sci.LineCount;
             prev = sci.MarkerPrevious(count, GetMarkerMask(marker));
             if (prev != -1)
             {
                 sci.EnsureVisibleEnforcePolicy(prev);
                 sci.GotoLineIndent(prev);
             }
         }
     }
     else
     {
         prev = sci.MarkerPrevious(line, GetMarkerMask(marker));
         if (prev != -1)
         {
             sci.EnsureVisibleEnforcePolicy(prev);
             sci.GotoLineIndent(prev);
         }
         else
         {
             count = sci.LineCount;
             prev = sci.MarkerPrevious(count, GetMarkerMask(marker));
             if (prev != -1)
             {
                 sci.EnsureVisibleEnforcePolicy(prev);
                 sci.GotoLineIndent(prev);
             }
         }
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Whether a certain line has a certain marker.
 /// </summary>
 public static bool HasMarker(ScintillaControl sci, Int32 marker, Int32 line)
 {
     Int32 lineMask = sci.MarkerGet(line);
     return (lineMask & GetMarkerMask(marker)) > 0;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Gets the state object from a scintilla control
 /// </summary>
 private static StateObject GetStateObject(ScintillaControl sci)
 {
     StateObject so = new StateObject();
     so.LineCount = sci.LineCount;
     so.Position = sci.CurrentPos;
     so.FileName = sci.FileName;
     for (Int32 i = 0; i < sci.LineCount; i++)
     {
         if (!sci.FoldExpanded(i)) so.FoldedLines.Add(i);
         if ((sci.MarkerGet(i) & (1 << 0)) != 0)
         {
             so.BookmarkedLines.Add(i);
         }
     }
     return so;
 }