Example #1
0
        private int FormatRange(bool bDraw, ref RangeToFormat pfr)
        {
            GCHandle handle = GCHandle.Alloc(pfr, GCHandleType.Pinned);

            try
            {
                IntPtr    pointer         = handle.AddrOfPinnedObject();
                const int SCI_FORMATRANGE = 2151;

                return(m_oScintillaControl.DirectMessage(SCI_FORMATRANGE, new IntPtr(bDraw ? 1 : 0), pointer).ToInt32());;
            }
            finally
            {
                if (handle.IsAllocated)
                {
                    handle.Free();
                }
            }
        }
Example #2
0
        private void DrawCurrentPage(Graphics oGraphics, Rectangle oBounds)
        {
            Point[] oPoints =
            {
                new Point(oBounds.Left,  oBounds.Top),
                new Point(oBounds.Right, oBounds.Bottom)
            };
            oGraphics.TransformPoints(CoordinateSpace.Device, CoordinateSpace.Page, oPoints);

            PrintRectangle oPrintRectangle = new PrintRectangle(oPoints[0].X, oPoints[0].Y, oPoints[1].X, oPoints[1].Y);

            RangeToFormat oRangeToFormat = new RangeToFormat();

            oRangeToFormat.hdc        = oRangeToFormat.hdcTarget = oGraphics.GetHdc();
            oRangeToFormat.rc         = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.cpMin = m_iPosition;
            oRangeToFormat.chrg.cpMax = m_iPrintEnd;

            m_iPosition = FormatRange(true, ref oRangeToFormat);
        }
Example #3
0
 internal unsafe int FormatRange(RangeToFormat oRangeToFormat)
 {
     return((int)m_oScintillaControl.SendMessageDirect(2151, (IntPtr)1, (IntPtr)(&oRangeToFormat)));
 }
Example #4
0
 internal unsafe int FormatRange(bool draw, ref RangeToFormat pfr)
 {
     fixed(RangeToFormat *rtfp = &pfr)
     return(Ref.Send(Sci.SCI_FORMATRANGE, (IntPtr)(draw ? 1 : 0), (IntPtr)rtfp));
 }
Example #5
0
        private void DrawCurrentPage(Graphics oGraphics, Rectangle oBounds)
        {
            Point[] oPoints = {
                new Point(oBounds.Left, oBounds.Top),
                new Point(oBounds.Right, oBounds.Bottom)
                };
            oGraphics.TransformPoints(CoordinateSpace.Device, CoordinateSpace.Page, oPoints);

            var oPrintRectangle = new PrintRectangle(oPoints[0].X, oPoints[0].Y, oPoints[1].X, oPoints[1].Y);

            var oRangeToFormat = new RangeToFormat();
            oRangeToFormat.hdc = oRangeToFormat.hdcTarget = oGraphics.GetHdc();
            oRangeToFormat.rc = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.cpMin = this._iPosition;
            oRangeToFormat.chrg.cpMax = this._iPrintEnd;

            this._iPosition = this._oScintillaControl.NativeInterface.FormatRange(true, ref oRangeToFormat);
        }
Example #6
0
 internal unsafe int FormatRange(RangeToFormat oRangeToFormat) {
     return (int) m_oScintillaControl.SendMessageDirect(2151, (IntPtr) 1, (IntPtr) (&oRangeToFormat));
 }
Example #7
0
        private void DrawCurrentPage(Graphics oGraphics, Rectangle oBounds) {
            Point[] oPoints = {
                new Point(oBounds.Left, oBounds.Top),
                new Point(oBounds.Right, oBounds.Bottom)
                };
            oGraphics.TransformPoints(CoordinateSpace.Device, CoordinateSpace.Page, oPoints);

            PrintRectangle oPrintRectangle = new PrintRectangle(oPoints[0].X, oPoints[0].Y, oPoints[1].X, oPoints[1].Y);

            RangeToFormat oRangeToFormat = new RangeToFormat();
            oRangeToFormat.hdc = oRangeToFormat.hdcTarget = oGraphics.GetHdc();
            oRangeToFormat.rc = oRangeToFormat.rcPage = oPrintRectangle;
            oRangeToFormat.chrg.cpMin = m_iLastPrintPosition;
            oRangeToFormat.chrg.cpMax = m_iTextLength;

            m_iLastPrintPosition += FormatRange(oRangeToFormat);
        }