using System.Drawing; using System.ComponentModel; using System.Drawing.Printing; using FastReport.Utils; namespace FastReport { partial class ReportPage { #region Public Methods internal void DrawSearchHighlight(FRPaintEventArgs e, int objIndex, CharacterRange range) { IGraphics g = e.Graphics; float leftMargin = LeftMargin * Units.Millimeters * e.ScaleX; float topMargin = TopMargin * Units.Millimeters * e.ScaleY; ObjectCollection allObjects = AllObjects; if (objIndex < 0 && objIndex >= allObjects.Count) return; ISearchable obj = allObjects[objIndex] as ISearchable; if (obj != null) { g.TranslateTransform(leftMargin, topMargin); try { obj.DrawSearchHighlight(e, range); } finally { g.TranslateTransform(-leftMargin, -topMargin); } } } internal void Print(FRPaintEventArgs e) { try { SetPrinting(true); SetDesigning(false); Draw(e); } finally { SetPrinting(false); } } internal ReportComponentBase HitTest(PointF mouse) { mouse.X -= LeftMargin * Units.Millimeters; mouse.Y -= TopMargin * Units.Millimeters; ObjectCollection allObjects = AllObjects; for (int i = allObjects.Count - 1; i >= 0; i--) { ReportComponentBase c = allObjects[i] as ReportComponentBase; if (c != null) { if (c.PointInObject(mouse)) return c; } } return null; } #endregion private void InitPreview() { firstPageSource = 7; otherPagesSource = 7; lastPageSource = 7; duplex = Duplex.Default; } } }