Exemple #1
0
 /// <inheritdoc/>
 public override void Draw(FRPaintEventArgs e)
 {
     base.Draw(e);
     DrawCheck(e);
     DrawMarkers(e);
     Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
 }
Exemple #2
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            Graphics g = e.Graphics;

            UpdateWidth();
            if (IsDesigning)
            {
                RectangleF bounds = Bounds;
                bounds.X      *= e.ScaleX;
                bounds.Y      *= e.ScaleY;
                bounds.Width   = DesignWidth * e.ScaleX;
                bounds.Height *= e.ScaleY;

                if (ReportWorkspace.ClassicView && Width != 0)
                {
                    RectangleF fillRect = new RectangleF(bounds.Left, bounds.Top - (HeaderSize - 1) * e.ScaleY,
                                                         bounds.Width, (HeaderSize - 1) * e.ScaleY);
                    if (Bounds.Top == HeaderSize)
                    {
                        fillRect.Y       = 0;
                        fillRect.Height += e.ScaleY;
                    }
                    DrawBandHeader(g, fillRect, true);

                    ObjectInfo info = RegisteredObjects.FindObject(this);
                    string     text = Res.Get(info.Text);
                    if (GetInfoText() != "")
                    {
                        text += ": " + GetInfoText();
                    }
                    fillRect.X += 4;
                    TextRenderer.DrawText(g, text, DrawUtils.Default96Font,
                                          new Rectangle((int)fillRect.Left, (int)fillRect.Top, (int)fillRect.Width, (int)fillRect.Height),
                                          SystemColors.WindowText, TextFormatFlags.VerticalCenter);
                }

                g.FillRectangle(SystemBrushes.Window, bounds.Left, (int)Math.Round(bounds.Top),
                                bounds.Width, bounds.Height + (ReportWorkspace.ClassicView ? 1 : 4));
                DrawBackground(e);
                if (ReportWorkspace.ShowGrid)
                {
                    ReportWorkspace.Grid.Draw(g, bounds, e.ScaleX);
                }

                if (!ReportWorkspace.ClassicView)
                {
                    Pen pen = e.Cache.GetPen(Color.Silver, 1, DashStyle.Dot);
                    g.DrawLine(pen, bounds.Left, bounds.Bottom + 1, bounds.Right + 1, bounds.Bottom + 1);
                    g.DrawLine(pen, bounds.Left + 1, bounds.Bottom + 2, bounds.Right + 1, bounds.Bottom + 2);
                    g.DrawLine(pen, bounds.Left, bounds.Bottom + 3, bounds.Right + 1, bounds.Bottom + 3);
                }
            }
            else
            {
                DrawBackground(e);
                Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
            }
        }
Exemple #3
0
 /// <inheritdoc/>
 public override void Draw(FRPaintEventArgs e)
 {
     UpdateAutoSize();
     base.Draw(e);
     DrawImage(e);
     DrawMarkers(e);
     Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
     DrawDesign(e);
 }
Exemple #4
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            base.Draw(e);
            DrawText(e);
            DrawMarkers(e);
            Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));

            if (FDragAccept)
            {
                DrawDragAcceptFrame(e, Color.Silver);
            }
        }
Exemple #5
0
 /// <inheritdoc/>
 public override void Draw(FRPaintEventArgs e)
 {
     base.Draw(e);
     if (IsPrinting)
     {
         PrintRich(e);
     }
     else
     {
         DrawRich(e);
     }
     DrawMarkers(e);
     Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
 }
Exemple #6
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            if (IsDesigning)
            {
                // force set height
                EndBandHeight = EndBandHeight;
            }

            base.Draw(e);

            if (Shape == CrossBandShape.Line)
            {
                Border.Lines = BorderLines.Left;
                Width        = 0;
            }

            Border.Draw(e, new RectangleF(AbsLeft * e.ScaleX, AbsTop * e.ScaleY, Width * e.ScaleX, Height * e.ScaleY));
        }
Exemple #7
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            if (IsDesigning)
            {
                return;
            }

            Graphics   g        = e.Graphics;
            RectangleF pageRect = new RectangleF(0, 0,
                                                 WidthInPixels - 1 / e.ScaleX, HeightInPixels - 1 / e.ScaleY);
            RectangleF printableRect = new RectangleF(
                LeftMargin * Units.Millimeters,
                TopMargin * Units.Millimeters,
                (PaperWidth - LeftMargin - RightMargin) * Units.Millimeters,
                (PaperHeight - TopMargin - BottomMargin) * Units.Millimeters);

            DrawBackground(e, pageRect);
            Border.Draw(e, printableRect);
            if (Watermark.Enabled)
            {
                if (!Watermark.ShowImageOnTop)
                {
                    Watermark.DrawImage(e, pageRect, Report, IsPrinting);
                }
                if (!Watermark.ShowTextOnTop)
                {
                    Watermark.DrawText(e, pageRect, Report, IsPrinting);
                }
            }

            float leftMargin = (int)Math.Round(LeftMargin * Units.Millimeters * e.ScaleX);
            float topMargin  = (int)Math.Round(TopMargin * Units.Millimeters * e.ScaleY);

            g.TranslateTransform(leftMargin, topMargin);

            try
            {
                foreach (Base c in AllObjects)
                {
                    if (c is ReportComponentBase && c.HasFlag(Flags.CanDraw))
                    {
                        ReportComponentBase obj = c as ReportComponentBase;
                        if (!IsPrinting)
                        {
#if !MONO
                            if (!obj.IsVisible(e))
                            {
                                continue;
                            }
#endif
                        }
                        else
                        {
                            if (!obj.Printable)
                            {
                                continue;
                            }
                            else if (obj.Parent is BandBase && !(obj.Parent as BandBase).Printable)
                            {
                                continue;
                            }
                        }
                        obj.SetDesigning(false);
                        obj.SetPrinting(IsPrinting);
                        obj.Draw(e);
                        obj.SetPrinting(false);
                    }
                }
            }
            finally
            {
                g.TranslateTransform(-leftMargin, -topMargin);
            }

            if (Watermark.Enabled)
            {
                if (Watermark.ShowImageOnTop)
                {
                    Watermark.DrawImage(e, pageRect, Report, IsPrinting);
                }
                if (Watermark.ShowTextOnTop)
                {
                    Watermark.DrawText(e, pageRect, Report, IsPrinting);
                }
            }
        }
Exemple #8
0
 /// <inheritdoc/>
 public override void Draw(FRPaintEventArgs e)
 {
     DrawBackground(e);
     Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
 }