SubreportObject.DesignExt.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. using System.ComponentModel;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using FastReport.Utils;
  5. namespace FastReport
  6. {
  7. partial class SubreportObject
  8. {
  9. #region Properties
  10. /// <summary>
  11. /// This property is not relevant to this class.
  12. /// </summary>
  13. [Browsable(false)]
  14. public new bool Printable
  15. {
  16. get { return base.Printable; }
  17. }
  18. /// <summary>
  19. /// This property is not relevant to this class.
  20. /// </summary>
  21. [Browsable(false)]
  22. public new bool Exportable
  23. {
  24. get { return base.Exportable; }
  25. }
  26. /// <summary>
  27. /// This property is not relevant to this class.
  28. /// </summary>
  29. [Browsable(false)]
  30. public override Border Border
  31. {
  32. get { return base.Border; }
  33. set { base.Border = value; }
  34. }
  35. /// <summary>
  36. /// This property is not relevant to this class.
  37. /// </summary>
  38. [Browsable(false)]
  39. public override FillBase Fill
  40. {
  41. get { return base.Fill; }
  42. set { base.Fill = value; }
  43. }
  44. /// <summary>
  45. /// This property is not relevant to this class.
  46. /// </summary>
  47. [Browsable(false)]
  48. public new Cursor Cursor
  49. {
  50. get { return base.Cursor; }
  51. }
  52. /// <summary>
  53. /// This property is not relevant to this class.
  54. /// </summary>
  55. [Browsable(false)]
  56. public new Hyperlink Hyperlink
  57. {
  58. get { return base.Hyperlink; }
  59. }
  60. /// <summary>
  61. /// This property is not relevant to this class.
  62. /// </summary>
  63. [Browsable(false)]
  64. public new bool CanGrow
  65. {
  66. get { return base.CanGrow; }
  67. }
  68. /// <summary>
  69. /// This property is not relevant to this class.
  70. /// </summary>
  71. [Browsable(false)]
  72. public new bool CanShrink
  73. {
  74. get { return base.CanShrink; }
  75. }
  76. /// <summary>
  77. /// This property is not relevant to this class.
  78. /// </summary>
  79. [Browsable(false)]
  80. public new string Style
  81. {
  82. get { return base.Style; }
  83. }
  84. /// <summary>
  85. /// This property is not relevant to this class.
  86. /// </summary>
  87. [Browsable(false)]
  88. public new string BeforePrintEvent
  89. {
  90. get { return base.BeforePrintEvent; }
  91. }
  92. /// <summary>
  93. /// This property is not relevant to this class.
  94. /// </summary>
  95. [Browsable(false)]
  96. public new string AfterPrintEvent
  97. {
  98. get { return base.AfterPrintEvent; }
  99. }
  100. /// <summary>
  101. /// This property is not relevant to this class.
  102. /// </summary>
  103. [Browsable(false)]
  104. public new string ClickEvent
  105. {
  106. get { return base.ClickEvent; }
  107. }
  108. #endregion
  109. #region Public Methods
  110. /// <inheritdoc/>
  111. public override void Draw(FRPaintEventArgs e)
  112. {
  113. base.Draw(e);
  114. IGraphics g = e.Graphics;
  115. RectangleF textRect = new RectangleF((AbsLeft + 20) * e.ScaleX, (AbsTop + 2) * e.ScaleY,
  116. (Width - 20) * e.ScaleX, (Height - 2) * e.ScaleY);
  117. g.DrawImage(Report.Designer.GetImage(104), (int)(AbsLeft * e.ScaleX) + 2, (int)(AbsTop * e.ScaleY) + 2);
  118. g.DrawString(Name, DrawUtils.DefaultFont, Brushes.Black, textRect);
  119. DrawMarkers(e);
  120. }
  121. /// <inheritdoc/>
  122. public override void SetName(string value)
  123. {
  124. base.SetName(value);
  125. if (IsDesigning && ReportPage != null)
  126. {
  127. ReportPage.PageName = Name;
  128. Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
  129. }
  130. }
  131. /// <inheritdoc/>
  132. public override void OnAfterInsert(InsertFrom source)
  133. {
  134. ReportPage = new ReportPage();
  135. Report.Pages.Add(ReportPage);
  136. ReportPage.SetDefaults();
  137. ReportPage.ReportTitle.Dispose();
  138. ReportPage.PageHeader.Dispose();
  139. ReportPage.PageFooter.Dispose();
  140. ReportPage.CreateUniqueName();
  141. reportPage.PageName = Name;
  142. Report.Designer.InitPages(Report.Pages.Count);
  143. }
  144. /// <inheritdoc/>
  145. public override void Delete()
  146. {
  147. if (ReportPage != null)
  148. {
  149. RemoveSubReport(true);
  150. if (Report != null)
  151. Report.Designer.InitPages(Report.Pages.IndexOf(Page) + 1);
  152. }
  153. ReportPage = null;
  154. base.Delete();
  155. }
  156. /// <inheritdoc/>
  157. public override ContextMenuBase GetContextMenu()
  158. {
  159. return new SubreportObjectMenu(Report.Designer);
  160. }
  161. #endregion
  162. /// <inheritdoc/>
  163. public override void HandleDoubleClick()
  164. {
  165. if (reportPage != null)
  166. reportPage.Report.Designer.ActiveReportTab.ActivePage = this.ReportPage;
  167. }
  168. }
  169. }