Beispiel #1
0
        void HandlePrintDrawPage(object o, DrawPageArgs args)
        {
            Cairo.Context g = args.Context.CairoContext;

            RenderCairo render = new RenderCairo(g);

            render.RunPage(pages[args.PageNr]);
        }
        public void DrawPage(object o, DrawPageArgs args)
        {
            var g = args.Context.CairoContext;
            int pageNumber, reportNumber;
            CalculateDocPage(args.PageNr, out reportNumber, out pageNumber);

            RenderCairo render = new RenderCairo(g);

            render.RunPage(reportPages[reportNumber][pageNumber]);
        }
        void HandlePrintDrawPage(object o, DrawPageArgs args)
        {
            Cairo.Context g = args.Context.CairoContext;

            g.Translate(report.LeftMarginPoints, 0);              //FIXME Perhaps need add top margin

            RenderCairo render = new RenderCairo(g);

            render.RunPage(pages[args.PageNr]);
        }
        protected override bool OnExposeEvent(Gdk.EventExpose ev)
        {
            base.OnExposeEvent(ev);

            if (pages == null)
            {
                return(false);
            }

            int width  = (int)(report.PageWidthPoints * Scale);
            int height = (int)(report.PageHeightPoints * Scale);

            Cairo.Rectangle rep_r = new Cairo.Rectangle(1, 1, width - 1, height - 1);

            int widgetWidth, widgetHeight;

            ev.Window.GetSize(out widgetWidth, out widgetHeight);

            using (Context g = Gdk.CairoHelper.Create(this.GdkWindow))
                using (ImageSurface rep_s = new ImageSurface(Format.Argb32, width, height))
                    using (Context rep_g = new Context(rep_s))
                        using (ImageSurface shadow_s = rep_s.Clone())
                            using (Context shadow_g = new Context(shadow_s)) {
                                g.Translate(((widgetWidth - width) / 2) - rep_padding, 0);
                                shadow_g.Pattern = new SolidPattern(new Color(0.6, 0.6, 0.6));
                                shadow_g.Paint();
                                g.SetSourceSurface(shadow_s, shadow_padding, shadow_padding);
                                g.Paint();

                                rep_g.Pattern = new SolidPattern(new Color(1, 1, 1));
                                rep_g.Paint();

                                rep_g.DrawRectangle(rep_r, new Color(0.1, 0.1, 0.1), 1);

                                SetItemsHitArea();

                                if (selectedItem != null)
                                {
                                    rep_g.Pattern = new SolidPattern(new Color(0.4, 0.4, 1));
                                    rep_g.Rectangle(GetSelectedItemRectangle());
                                    rep_g.Fill();
                                }
                                using (var render = new RenderCairo(rep_g, Scale)) {
                                    render.RunPage(pages);
                                }

                                g.SetSourceSurface(rep_s, rep_padding, rep_padding);
                                g.Paint();
                            }
            return(true);
        }
Beispiel #5
0
        protected override bool OnExposeEvent(Gdk.EventExpose ev)
        {
            base.OnExposeEvent(ev);

            if (pages == null)
            {
                return(false);
            }

            int width  = (int)(report.PageWidthPoints * Scale);
            int height = (int)(report.PageHeightPoints * Scale);

            Cairo.Rectangle rep_r = new Cairo.Rectangle(1, 1, width - 1, height - 1);

            using (Context g = Gdk.CairoHelper.Create(this.GdkWindow))
                using (ImageSurface rep_s = new ImageSurface(Format.Argb32, width, height))
                    using (Context rep_g = new Context(rep_s))
                        using (ImageSurface shadow_s = rep_s.Clone())
                            using (Context shadow_g = new Context(shadow_s)) {
                                shadow_g.Pattern = new SolidPattern(new Color(0.6, 0.6, 0.6));
                                shadow_g.Paint();
                                g.SetSourceSurface(shadow_s, shadow_padding, shadow_padding);
                                g.Paint();

                                rep_g.Pattern = new SolidPattern(new Color(1, 1, 1));
                                rep_g.Paint();

                                rep_g.DrawRectangle(rep_r, new Color(0.1, 0.1, 0.1), 1);

                                RenderCairo render = new RenderCairo(rep_g, Scale);
                                render.RunPage(pages);


                                g.SetSourceSurface(rep_s, rep_padding, rep_padding);
                                g.Paint();
                            }
            return(true);
        }
        void HandlePrintDrawPage(object o, DrawPageArgs args)
        {
            Cairo.Context g = args.Context.CairoContext;

            RenderCairo render = new RenderCairo (g);
            render.RunPage(pages[args.PageNr]);
        }
Beispiel #7
0
        protected override bool OnExposeEvent(Gdk.EventExpose ev)
        {
            base.OnExposeEvent(ev);
			
            if (pages == null)
                return false;
				
            int width = (int)(report.PageWidthPoints * Scale);
            int height = (int)(report.PageHeightPoints * Scale);
            Cairo.Rectangle rep_r = new Cairo.Rectangle(1, 1, width - 1, height - 1);

            int widgetWidth, widgetHeight;
            ev.Window.GetSize(out widgetWidth, out widgetHeight);
			
            using (Context g = Gdk.CairoHelper.Create(this.GdkWindow))
            using (ImageSurface rep_s = new ImageSurface(Format.Argb32, width, height))
            using (Context rep_g = new Context(rep_s))
            using (ImageSurface shadow_s = rep_s.Clone())
            using (Context shadow_g = new Context(shadow_s))
            {
				
                g.Translate(((widgetWidth - width) / 2) - rep_padding, 0);
                shadow_g.Pattern = new SolidPattern(new Color(0.6, 0.6, 0.6));
                shadow_g.Paint();
                g.SetSourceSurface(shadow_s, shadow_padding, shadow_padding);
                g.Paint();
				
                rep_g.Pattern = new SolidPattern(new Color(1, 1, 1));
                rep_g.Paint();
				
                rep_g.DrawRectangle(rep_r, new Color(0.1, 0.1, 0.1), 1);

                using (var render = new RenderCairo(rep_g, Scale))
                {
                    render.RunPage(pages);
                }

                g.SetSourceSurface(rep_s, rep_padding, rep_padding);
                g.Paint();
				
            }
            return true;
        }
        void HandlePrintDrawPage(object o, DrawPageArgs args)
        {
            Cairo.Context g = args.Context.CairoContext;

            g.Translate (report.LeftMarginPoints, 0); //FIXME Perhaps need add top margin

            RenderCairo render = new RenderCairo (g);
            render.RunPage(pages[args.PageNr]);
        }