DesignerOptionsPage.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System.Windows.Forms;
  2. namespace FastReport.Forms
  3. {
  4. /// <summary>
  5. /// The base class for designer plugin's options page.
  6. /// </summary>
  7. /// <remarks>
  8. /// Use this class if you develop a designer plugin that may be configured in the
  9. /// "View|Options..." menu. You need to implement an options page for your
  10. /// plugin and return it in the <b>IDesignerPlugin.GetOptionsPage</b> method.
  11. /// </remarks>
  12. public class DesignerOptionsPage : Form
  13. {
  14. private Label lblWarn;
  15. /// <summary>
  16. /// The <b>TabControl</b> control.
  17. /// </summary>
  18. public TabControl tc1;
  19. /// <summary>
  20. /// The <b>TabPage</b> control.
  21. /// </summary>
  22. public TabPage tab1;
  23. private void InitializeComponent()
  24. {
  25. this.tc1 = new System.Windows.Forms.TabControl();
  26. this.tab1 = new System.Windows.Forms.TabPage();
  27. this.lblWarn = new System.Windows.Forms.Label();
  28. this.tc1.SuspendLayout();
  29. this.SuspendLayout();
  30. //
  31. // tc1
  32. //
  33. this.tc1.Controls.Add(this.tab1);
  34. this.tc1.Location = new System.Drawing.Point(12, 12);
  35. this.tc1.Name = "tc1";
  36. this.tc1.SelectedIndex = 0;
  37. this.tc1.Size = new System.Drawing.Size(376, 276);
  38. this.tc1.TabIndex = 0;
  39. //
  40. // tab1
  41. //
  42. this.tab1.Location = new System.Drawing.Point(4, 22);
  43. this.tab1.Name = "tab1";
  44. this.tab1.Padding = new System.Windows.Forms.Padding(3);
  45. this.tab1.Size = new System.Drawing.Size(368, 250);
  46. this.tab1.TabIndex = 0;
  47. this.tab1.Text = "tabPage1";
  48. this.tab1.UseVisualStyleBackColor = true;
  49. //
  50. // lblWarn
  51. //
  52. this.lblWarn.AutoSize = true;
  53. this.lblWarn.Location = new System.Drawing.Point(8, 300);
  54. this.lblWarn.Name = "lblWarn";
  55. this.lblWarn.Size = new System.Drawing.Size(328, 13);
  56. this.lblWarn.TabIndex = 1;
  57. this.lblWarn.Text = "Place your controls on tab page only! Add new pages if necessary.";
  58. //
  59. // DesignerOptionsPage
  60. //
  61. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  62. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
  63. this.ClientSize = new System.Drawing.Size(398, 323);
  64. this.Controls.Add(this.lblWarn);
  65. this.Controls.Add(this.tc1);
  66. this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
  67. this.Name = "DesignerOptionsPage";
  68. this.tc1.ResumeLayout(false);
  69. this.ResumeLayout(false);
  70. this.PerformLayout();
  71. }
  72. /// <summary>
  73. /// Initializes controls on this options page.
  74. /// </summary>
  75. /// <remarks>
  76. /// Override this method to fill options page's controls with initial values.
  77. /// </remarks>
  78. public virtual void Init()
  79. {
  80. }
  81. /// <summary>
  82. /// Finalizes the options page.
  83. /// </summary>
  84. /// <param name="result">The dialog result.</param>
  85. /// <remarks>
  86. /// Override this method to pass controls' values to the plugin. Do this if <b>result</b> is
  87. /// <b>DialogResult.OK</b>.
  88. /// </remarks>
  89. public virtual void Done(DialogResult result)
  90. {
  91. }
  92. /// <summary>
  93. /// Updates images used in the control.
  94. /// </summary>
  95. public virtual void UpdateDpiDependencies()
  96. {
  97. }
  98. /// <summary>
  99. /// Initializes a new instance of the <b>DesignerOptionsPage</b> class with default settings.
  100. /// </summary>
  101. /// <remarks>
  102. /// Usually you need to define another contructor which takes one parameter - the plugin.
  103. /// </remarks>
  104. /// <example>This example shows how to define own constructor which takes a plugin:
  105. /// <code>
  106. /// public DialogPageOptions(DialogPageDesigner pd) : base()
  107. /// {
  108. /// FPageDesigner = pd;
  109. /// InitializeComponent();
  110. /// }
  111. /// </code>
  112. /// </example>
  113. public DesignerOptionsPage()
  114. {
  115. InitializeComponent();
  116. }
  117. }
  118. }