123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- using FastReport.Utils;
- namespace FastReport
- {
- partial class SubreportObject
- {
- #region Properties
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new bool Printable
- {
- get { return base.Printable; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new bool Exportable
- {
- get { return base.Exportable; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public override Border Border
- {
- get { return base.Border; }
- set { base.Border = value; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public override FillBase Fill
- {
- get { return base.Fill; }
- set { base.Fill = value; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new Cursor Cursor
- {
- get { return base.Cursor; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new Hyperlink Hyperlink
- {
- get { return base.Hyperlink; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new bool CanGrow
- {
- get { return base.CanGrow; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new bool CanShrink
- {
- get { return base.CanShrink; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new string Style
- {
- get { return base.Style; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new string BeforePrintEvent
- {
- get { return base.BeforePrintEvent; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new string AfterPrintEvent
- {
- get { return base.AfterPrintEvent; }
- }
- /// <summary>
- /// This property is not relevant to this class.
- /// </summary>
- [Browsable(false)]
- public new string ClickEvent
- {
- get { return base.ClickEvent; }
- }
- #endregion
- #region Public Methods
- /// <inheritdoc/>
- 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);
- }
- /// <inheritdoc/>
- public override void SetName(string value)
- {
- base.SetName(value);
- if (IsDesigning && ReportPage != null)
- {
- ReportPage.PageName = Name;
- Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
- }
- }
- /// <inheritdoc/>
- 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);
- }
- /// <inheritdoc/>
- public override void Delete()
- {
- if (ReportPage != null)
- {
- RemoveSubReport(true);
- if (Report != null)
- Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
- }
- ReportPage = null;
- base.Delete();
- }
- /// <inheritdoc/>
- public override ContextMenuBase GetContextMenu()
- {
- return new SubreportObjectMenu(Report.Designer);
- }
- #endregion
- /// <inheritdoc/>
- public override void HandleDoubleClick()
- {
- if (ReportPage != null)
- Report.Designer.ActiveReportTab.ActivePage = ReportPage;
- }
- }
- }
|