ARCed.Scintilla.DropMarker.GetClientRectangle C# (CSharp) Method

GetClientRectangle() public method

Gets the Client Rectangle in pixels of the DropMarker's visual indicator.
public GetClientRectangle ( ) : Rectangle
return System.Drawing.Rectangle
        public Rectangle GetClientRectangle()
        {
            int x = NativeScintilla.PointXFromPosition(Start);
            int y = NativeScintilla.PointYFromPosition(Start) + NativeScintilla.TextHeight(0) - 2;

            // Invalidate the old Marker Location so that we don't get "Ghosts"
            return new Rectangle(x - 2, y, 5, 5);
        }

Usage Example

Example #1
0
        /// <summary>
        ///     Drops a DropMarker at the specified document position
        /// </summary>
        /// <param name="position"></param>
        /// <returns>The newly created DropMarker</returns>
        /// <remarks>
        ///     Dropping a DropMarker creates a visual marker (red triangle)
        ///     indicating the DropMarker point.
        /// </remarks>
        public DropMarker Drop(int position)
        {
            var dm = new DropMarker(position, position, this.GetCurrentTopOffset(), Scintilla);
            this._allDocumentDropMarkers.Add(dm);
            this._markerStack.Push(dm);
            Scintilla.ManagedRanges.Add(dm);

            //	Force the Drop Marker to paint
            Scintilla.Invalidate(dm.GetClientRectangle());
            return dm;
        }