public void Render(Cairo.Context c, MonoReports.Model.Controls.Control control) { SubReport subreport = control as SubReport; Rectangle borderRect; c.Save (); borderRect = new Rectangle (subreport.Location.X, subreport.Location.Y, subreport.Width, subreport.Height); c.ClipRectangle (borderRect); borderRect = new Rectangle (subreport.Location.X, subreport.Location.Y, subreport.Width, subreport.Height); c.FillRectangle (borderRect, subreport.BackgroundColor.ToCairoColor ()); c.Restore (); }
public void Render(Cairo.Context c, MonoReports.Model.Controls.Control control) { Image image = control as Image; Rectangle borderRect; c.Save (); borderRect = new Rectangle (image.Location.X * unitMulitipier, image.Location.Y * unitMulitipier, image.Width * unitMulitipier, image.Height * unitMulitipier); c.ClipRectangle (borderRect); if ( PixbufRepository.ContainsKey(image.ImageKey)) { var pixbuf = PixbufRepository[image.ImageKey]; c.DrawPixbuf (pixbuf, new Cairo.PointD(image.Location.X * unitMulitipier , image.Location.Y * unitMulitipier), (int)(image.Width * unitMulitipier),(int)(image.Height * unitMulitipier), image.Offset.ToCairoPointD ()); }else { c.FillRectangle (borderRect, image.BackgroundColor.ToCairoColor ()); } c.DrawInsideBorder (borderRect, image.Border, true); c.Restore (); }
public void Render(Cairo.Context c,Control control) { TextBlock textBlock = control as TextBlock; Rectangle borderRect; c.Save(); borderRect = new Rectangle (textBlock.Location.X * unitMulitipier , textBlock.Location.Y * unitMulitipier, textBlock.Width * unitMulitipier, textBlock.Height * unitMulitipier); if(!textBlock.CanGrow || DesignMode) c.ClipRectangle(borderRect); var rect = c.DrawTextBlock (textBlock,false); if(!DesignMode && (textBlock.CanGrow && rect.Height > textBlock.Height || textBlock.CanShrink && rect.Height < textBlock.Height )){ borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, rect.Height); } else { borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, textBlock.Height); } c.FillRectangleInUnit(borderRect,textBlock.BackgroundColor.ToCairoColor()); if(DesignMode){ c.DrawInsideSelectorInUnits (borderRect, new Border(1),4); } c.DrawTextBlock (textBlock,true); c.DrawInsideBorderInUnit (borderRect, textBlock.Border,true); c.Restore(); if(MonoreportsSettings.debugMode) c.DrawDebug( string.Format(Catalog.GetString("bottom: {0}"),textBlock.Bottom.ToUnitString()),borderRect.X,textBlock.Bottom); }
public void Render(Cairo.Context c,Control control) { TextBlock textBlock = control as TextBlock; Rectangle borderRect; c.Save(); borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, textBlock.Height); if(!textBlock.CanGrow || DesignMode) c.ClipRectangle(borderRect); var rect = c.DrawTextBlock (textBlock,false); if(!DesignMode && (textBlock.CanGrow && rect.Height > textBlock.Height || textBlock.CanShrink && rect.Height < textBlock.Height)){ borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, rect.Height); } else { borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, textBlock.Height); } c.FillRectangle(borderRect,textBlock.BackgroundColor.ToCairoColor()); c.DrawTextBlock (textBlock,true); c.DrawInsideBorder (borderRect, textBlock.Border,true); c.Restore(); }