Browse Source

Layouter

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@6203 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 15 years ago
parent
commit
465cd08f08
  1. 20
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs
  2. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SectionBounds.cs
  3. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs
  4. 16
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseSection.cs
  5. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTableItem.cs
  6. 4
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs
  7. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/ErrorItem.cs
  8. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseCircleItem.cs
  9. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseImageItem.cs
  10. 8
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseLineItem.cs
  11. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs
  12. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
  13. 4
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs
  14. 61
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs
  15. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs

20
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/StandardPrinter.cs

@ -50,7 +50,6 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -50,7 +50,6 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
}
public static void DrawBorder (Graphics graphics,BaseStyleDecorator decorator)
{
if (decorator.DrawBorder)
@ -60,7 +59,6 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -60,7 +59,6 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
decorator.FrameColor = decorator.ForeColor;
}
Border border = new Border(new BaseLine (decorator.FrameColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
border.DrawBorder(graphics,decorator.DisplayRectangle);
}
}
@ -105,10 +103,12 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -105,10 +103,12 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
Point saveLocation = new Point (item.Location.X,item.Location.Y);
item.Location = new Point(offset.X + item.Location.X,
item.Location = new Point(item.Location.X,
offset.Y + item.Location.Y);
// item.Location = new Point(offset.X + item.Location.X,
// offset.Y + item.Location.Y);
//
var ss = MeasurementService.MeasureReportItem(rpea.PrintPageEventArgs.Graphics,item);
BaseTextItem textItem = item as BaseTextItem;
@ -137,10 +137,12 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -137,10 +137,12 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
#region Render Collection
public static Rectangle RenderPlainCollection (BaseReportItem parent,ReportItemCollection items,IExpressionEvaluatorFacade evaluator, Point offset,ReportPageEventArgs rpea)
public static Rectangle RenderPlainCollection (BaseReportItem parent,
ReportItemCollection items,
IExpressionEvaluatorFacade evaluator,
Point offset,
ReportPageEventArgs rpea)
{
Rectangle retVal = Rectangle.Empty;
Size size = Size.Empty;
if (items.Count > 0) {
foreach (BaseReportItem child in items) {
@ -178,8 +180,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing @@ -178,8 +180,8 @@ namespace ICSharpCode.Reports.Core.BaseClasses.Printing
BaseReportItem item = simpleContainer as BaseReportItem;
Rectangle retVal = new Rectangle(offset,item.Size);
Point loc = item.Location;
item.Location = new Point (offset.X + item.Location.X,offset.Y + item.Location.Y);
// item.Location = new Point (offset.X + item.Location.X,offset.Y + item.Location.Y);
item.Location = new Point (item.Location.X,offset.Y + item.Location.Y);
item.Render(rpea);
if (simpleContainer.Items != null) {

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseClasses/SectionBounds.cs

@ -103,7 +103,7 @@ namespace ICSharpCode.Reports.Core{ @@ -103,7 +103,7 @@ namespace ICSharpCode.Reports.Core{
this.pageHeaderRectangle = new Rectangle (this.reportHeaderRectangle.Left,
section.SectionOffset,
this.marginBounds.Width,
section.Size.Height + this.gap);
section.Size.Height + 3 * GlobalValues.GapBetweenContainer);
}

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseReportItem.cs

@ -84,7 +84,7 @@ namespace ICSharpCode.Reports.Core { @@ -84,7 +84,7 @@ namespace ICSharpCode.Reports.Core {
bsd.FrameColor = this.FrameColor;
bsd.Location = this.Location;
bsd.Size = this.Size;
bsd.DisplayRectangle = this.DrawingRectangle;
bsd.DisplayRectangle = this.DisplayRectangle;
return bsd;
}
@ -98,12 +98,12 @@ namespace ICSharpCode.Reports.Core { @@ -98,12 +98,12 @@ namespace ICSharpCode.Reports.Core {
protected void DrawFrame (Graphics graphics,Border border) {
if (this.DrawBorder == true) {
border.DrawBorder(graphics,this.DrawingRectangle);
border.DrawBorder(graphics,this.DisplayRectangle);
}
}
protected Rectangle DrawingRectangle
protected virtual Rectangle DisplayRectangle
{
get {
if (Parent != null) {

16
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseSection.cs

@ -49,16 +49,18 @@ namespace ICSharpCode.Reports.Core @@ -49,16 +49,18 @@ namespace ICSharpCode.Reports.Core
{
this.NotifyPrinting();
base.Render(rpea);
// if (this.DrawBorder == true) {
// Border b = new Border(new BaseLine (this.FrameColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
//// Rectangle r = new Rectangle (this.Location,this.Size);
//// b.DrawBorder(rpea.PrintPageEventArgs.Graphics,r);
// }
this.NotifyPrinted();
}
protected override Rectangle DisplayRectangle {
get {
return new Rectangle(Location.X + this.Location.X, this.Location.Y ,
this.Size.Width,this.Size.Height);
}
}
private void NotifyPrinting ()
{
if (this.SectionPrinting != null) {

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTableItem.cs

@ -48,7 +48,7 @@ namespace ICSharpCode.Reports.Core { @@ -48,7 +48,7 @@ namespace ICSharpCode.Reports.Core {
BaseStyleDecorator style = new BaseStyleDecorator();
style.BackColor = this.BackColor;
style.ForeColor = this.ForeColor;
Rectangle rect = base.DrawingRectangle;
Rectangle rect = base.DisplayRectangle;
style.Location = new Point(rect.Left,this.Location.Y);
style.Size = this.Size;
style.DrawBorder = this.DrawBorder;

4
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/BaseTextItem.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.Reports.Core @@ -62,7 +62,7 @@ namespace ICSharpCode.Reports.Core
style.Location = this.Location;
style.Size = this.Size;
style.DrawBorder = this.DrawBorder;
style.DisplayRectangle = this.DrawingRectangle;
style.DisplayRectangle = this.DisplayRectangle;
style.StringFormat = this.stringFormat;
style.StringTrimming = this.stringTrimming;
@ -90,7 +90,7 @@ namespace ICSharpCode.Reports.Core @@ -90,7 +90,7 @@ namespace ICSharpCode.Reports.Core
string formated = StandardFormatter.FormatOutput(this.text,this.FormatString,this.DataType,String.Empty);
Print (rpea,formated,base.DrawingRectangle);
Print (rpea,formated,base.DisplayRectangle);
base.NotifyAfterPrint (rpea.LocationAfterDraw);
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/ErrorItem.cs

@ -42,7 +42,7 @@ namespace ICSharpCode.Reports.Core @@ -42,7 +42,7 @@ namespace ICSharpCode.Reports.Core
this.SetErrorLayout();
Border b = new Border(new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1));
base.DrawFrame(rpea.PrintPageEventArgs.Graphics,b);
Print (rpea,this.errMess,base.DrawingRectangle);
Print (rpea,this.errMess,base.DisplayRectangle);
}
#region IExportColumnBuilder implementation

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseCircleItem.cs

@ -47,7 +47,7 @@ namespace ICSharpCode.Reports.Core { @@ -47,7 +47,7 @@ namespace ICSharpCode.Reports.Core {
throw new ArgumentNullException("rpea");
}
base.Render (rpea);
Rectangle rect = base.DrawingRectangle;
Rectangle rect = base.DisplayRectangle;
shape.FillShape(rpea.PrintPageEventArgs.Graphics,
new SolidFillPattern(this.BackColor),

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseImageItem.cs

@ -125,8 +125,8 @@ namespace ICSharpCode.Reports.Core { @@ -125,8 +125,8 @@ namespace ICSharpCode.Reports.Core {
Graphics g = rpea.PrintPageEventArgs.Graphics;
if (this.Image == null){
this.Image = ErrorBitmap(new Size (base.DrawingRectangle.Width,
base.DrawingRectangle.Height) );
this.Image = ErrorBitmap(new Size (base.DisplayRectangle.Width,
base.DisplayRectangle.Height) );
}
if (this.scaleImageToSize) {
@ -135,7 +135,7 @@ namespace ICSharpCode.Reports.Core { @@ -135,7 +135,7 @@ namespace ICSharpCode.Reports.Core {
this.Location.Y + this.Image.Height);
} else {
RectangleF rect = base.DrawingRectangle;
RectangleF rect = base.DisplayRectangle;
g.DrawImage(this.Image,rect);
rpea.LocationAfterDraw = new Point (this.Location.X + (int)rect.Width,
this.Location.Y + (int)rect.Height);

8
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseLineItem.cs

@ -78,10 +78,10 @@ namespace ICSharpCode.Reports.Core { @@ -78,10 +78,10 @@ namespace ICSharpCode.Reports.Core {
this.startLineCap,
this.endLineCap,
this.dashLineCap),
new Point(base.DrawingRectangle.Left + this.fromPoint.X,
this.FromPoint.Y + base.DrawingRectangle.Top),
new Point (base.DrawingRectangle.Left + this.ToPoint.X,
this.ToPoint.Y + base.DrawingRectangle.Top));
new Point(base.DisplayRectangle.Left + this.fromPoint.X,
this.FromPoint.Y + base.DisplayRectangle.Top),
new Point (base.DisplayRectangle.Left + this.ToPoint.X,
this.ToPoint.Y + base.DisplayRectangle.Top));
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/BaseItems/Graphics/BaseRectangleItem.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.Reports.Core { @@ -45,7 +45,7 @@ namespace ICSharpCode.Reports.Core {
throw new ArgumentNullException("rpea");
}
base.Render(rpea);
Rectangle rect = base.DrawingRectangle;
Rectangle rect = base.DisplayRectangle;
StandardPrinter.FillBackground(rpea.PrintPageEventArgs.Graphics,this.BaseStyleDecorator);
shape.DrawShape (rpea.PrintPageEventArgs.Graphics,

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs

@ -99,9 +99,9 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -99,9 +99,9 @@ namespace ICSharpCode.Reports.Core.Exporter
ExporterCollection list = new ExporterCollection();
if (section.DrawBorder == true) {
section.Items.Insert(0,CreateDebugItem(section));
}
// if (section.DrawBorder == true) {
// section.Items.Insert(0,CreateDebugItem(section));
// }
if (section.Items.Count > 0) {

4
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs

@ -130,7 +130,7 @@ namespace ICSharpCode.Reports.Core @@ -130,7 +130,7 @@ namespace ICSharpCode.Reports.Core
row.Size = rs;
}
rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X,rpea.LocationAfterDraw.Y + 20);
// rpea.LocationAfterDraw = new Point(rpea.LocationAfterDraw.X,rpea.LocationAfterDraw.Y + 5);
// base.NotifyAfterPrint (rpea.LocationAfterDraw);
}
@ -156,8 +156,6 @@ namespace ICSharpCode.Reports.Core @@ -156,8 +156,6 @@ namespace ICSharpCode.Reports.Core
}
private Point RenderSectionWithSimpleContainer (BaseSection section,
ISimpleContainer container,
Point offset,

61
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs

@ -211,49 +211,40 @@ namespace ICSharpCode.Reports.Core @@ -211,49 +211,40 @@ namespace ICSharpCode.Reports.Core
{
Point currentPosition = Point.Empty;
if (this.CurrentSection.Visible){
this.CurrentSection.Render (rpea);
this.CurrentSection.Render (rpea);
Evaluator.SinglePage = this.reportDocument.SinglePage;
if (this.CurrentSection.Items.Count > 0) {
Evaluator.SinglePage = this.reportDocument.SinglePage;
Rectangle desiredRectangle = Layout.Layout(rpea.PrintPageEventArgs.Graphics,this.CurrentSection);
if (this.CurrentSection.Items.Count > 0) {
Rectangle sectionRectangle = new Rectangle(this.CurrentSection.Location.X,
this.CurrentSection.Location.Y,
this.CurrentSection.Size.Width,
this.CurrentSection.Size.Height);
Rectangle desiredRectangle = Layout.Layout(rpea.PrintPageEventArgs.Graphics,this.CurrentSection);
Rectangle sectionRectangle = new Rectangle(this.CurrentSection.Location.X,
this.CurrentSection.Location.Y,
this.CurrentSection.Size.Width,
this.CurrentSection.Size.Height);
if (desiredRectangle.Height >= sectionRectangle.Height) {
this.CurrentSection.Size = new Size(this.CurrentSection.Size.Width,desiredRectangle.Height + 10);
}
if (this.CurrentSection.DrawBorder) {
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.CurrentSection.BaseStyleDecorator);
}
// PrintHelper.DebugRectangle(rpea.PrintPageEventArgs.Graphics,Pens.Blue,new Rectangle(CurrentSection.Location,CurrentSection.Size));
}
if (desiredRectangle.Height >= sectionRectangle.Height) {
this.CurrentSection.Size = new Size(this.CurrentSection.Size.Width,desiredRectangle.Height + 10);
}
Rectangle r = StandardPrinter.RenderPlainCollection (this.CurrentSection,this.CurrentSection.Items,Evaluator,new Point(this.CurrentSection.Location.X,
this.CurrentSection.SectionOffset),rpea);
if (this.CurrentSection.DrawBorder) {
StandardPrinter.DrawBorder(rpea.PrintPageEventArgs.Graphics,this.CurrentSection.BaseStyleDecorator);
}
currentPosition = PrintHelper.ConvertRectangleToCurentPosition(r);
if ((this.CurrentSection.CanGrow == false)&& (this.CurrentSection.CanShrink == false)) {
// return new Point(this.CurrentSection.Location.X,
// this.CurrentSection.Size.Height);
return currentPosition;
}
return currentPosition;
// PrintHelper.DebugRectangle(rpea.PrintPageEventArgs.Graphics,Pens.Blue,new Rectangle(CurrentSection.Location,CurrentSection.Size));
}
return currentPosition;
Rectangle r = StandardPrinter.RenderPlainCollection (this.CurrentSection,
this.CurrentSection.Items,
Evaluator,
new Point(this.CurrentSection.Location.X,this.CurrentSection.SectionOffset),
rpea);
return PrintHelper.ConvertRectangleToCurentPosition(r);
}

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs

@ -31,7 +31,7 @@ namespace ICSharpCode.Reports.Core { @@ -31,7 +31,7 @@ namespace ICSharpCode.Reports.Core {
public RenderDataReport(IReportModel model,
IDataManager dataManager,
ReportDocument reportDocument,
ILayouter layout):base (model,dataManager,reportDocument,layout)
ILayouter layout):base (model,dataManager,reportDocument,layout)
{
}

Loading…
Cancel
Save