12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- 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;
- }
- }
- }
|