using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using FastReport.Utils;
namespace FastReport
{
partial class SubreportObject
{
#region Properties
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new bool Printable
{
get { return base.Printable; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new bool Exportable
{
get { return base.Exportable; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public override Border Border
{
get { return base.Border; }
set { base.Border = value; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public override FillBase Fill
{
get { return base.Fill; }
set { base.Fill = value; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new Cursor Cursor
{
get { return base.Cursor; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new Hyperlink Hyperlink
{
get { return base.Hyperlink; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new bool CanGrow
{
get { return base.CanGrow; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new bool CanShrink
{
get { return base.CanShrink; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new string Style
{
get { return base.Style; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new string BeforePrintEvent
{
get { return base.BeforePrintEvent; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new string AfterPrintEvent
{
get { return base.AfterPrintEvent; }
}
///
/// This property is not relevant to this class.
///
[Browsable(false)]
public new string ClickEvent
{
get { return base.ClickEvent; }
}
#endregion
#region Public Methods
///
public override void Draw(FRPaintEventArgs e)
{
base.Draw(e);
e.Graphics.DrawImage(Report.Designer.GetImage(104), (int)(AbsLeft * e.ScaleX) + 2, (int)(AbsTop * e.ScaleY) + 2);
TextRenderer.DrawText(e.Graphics.Graphics, Name,
e.Cache.GetFont(DrawUtils.DefaultFont.FontFamily, 8 * e.ScaleX * 96 / DrawUtils.ScreenDpi, FontStyle.Regular),
new Rectangle((int)((AbsLeft + 20) * e.ScaleX), (int)((AbsTop + 2) * e.ScaleY), (int)((Width - 20) * e.ScaleX), (int)((Height - 2) * e.ScaleY)),
Color.Black,
TextFormatFlags.PreserveGraphicsTranslateTransform);
DrawMarkers(e);
}
///
public override void SetName(string value)
{
base.SetName(value);
if (IsDesigning && ReportPage != null)
{
ReportPage.PageName = Name;
Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
}
}
///
public override void OnAfterInsert(InsertFrom source)
{
ReportPage = new ReportPage();
Report.Pages.Add(ReportPage);
ReportPage.SetDefaults();
ReportPage.ReportTitle.Dispose();
ReportPage.PageHeader.Dispose();
ReportPage.PageFooter.Dispose();
ReportPage.CreateUniqueName();
reportPage.PageName = Name;
Report.Designer.InitPages(Report.Pages.Count);
}
///
public override void Delete()
{
if (ReportPage != null)
{
RemoveSubReport(true);
if (Report != null)
Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
}
ReportPage = null;
base.Delete();
}
///
public override ContextMenuBase GetContextMenu()
{
return new SubreportObjectMenu(Report.Designer);
}
#endregion
///
public override void HandleDoubleClick()
{
if (ReportPage != null)
Report.Designer.ActiveReportTab.ActivePage = ReportPage;
}
}
}