Inheritance: MonoReports.Core.ControlRendererBase, IControlRenderer
Ejemplo n.º 1
0
 public TextBlockView(TextBlock textBlock,TextBlockRenderer textBlockRenderer, SectionView parentSection)
     : base(textBlock)
 {
     this.ParentSection = parentSection;
     TextBlockRenderer = textBlockRenderer;
     invaildateBound();
 }
Ejemplo n.º 2
0
 public TextBlockView(TextBlock textBlock,SectionView parentSection)
     : base(textBlock)
 {
     this.ParentSection = parentSection;
     AbsoluteBound = new Rectangle (parentSection.AbsoluteDrawingStartPoint.X + textBlock.Location.X,
                                     parentSection.AbsoluteDrawingStartPoint.Y + textBlock.Location.Y, textBlock.Width, textBlock.Height);
     TextBlockRenderer = new TextBlockRenderer(){ DesignMode = true};
 }
Ejemplo n.º 3
0
        public void BreakOffControlAtMostAtHeight_WithHeightInText_FirstControlAlwaysLowerOrEqualThanHeight()
        {
            TextBlockRenderer tbr = new TextBlockRenderer();
            using(Cairo.PdfSurface pdf = new Cairo.PdfSurface( System.IO.Path.Combine( System.Environment.CurrentDirectory, "monoreports_tmp_test.pdf"),600,800)) {

                var cr = new  Cairo.Context(pdf);

                TextBlock tb = new TextBlock();
                tb.Text = loremIpsum;
                tb.Location = new Point(10,50);
                tb.Width = 89;
                tb.Height = 40;

                Control[] tab = null;

                tab = tbr.BreakOffControlAtMostAtHeight(cr,tb,120);

                Assert.LessOrEqual(tab[0].Height,120);

                tab = tbr.BreakOffControlAtMostAtHeight(cr,tb,330);

                Assert.LessOrEqual(tab[0].Height,330);

                //chhamge padding

                tb.Padding = new Thickness(4,22,8,8);

                tab = tbr.BreakOffControlAtMostAtHeight(cr,tb,20);

                Assert.LessOrEqual(tab[0].Height,20);

                tab = tbr.BreakOffControlAtMostAtHeight(cr,tb,47);

                Assert.LessOrEqual(tab[0].Height,47);

                pdf.Finish();
            }
        }