CodePageOptions.Mono.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. using System;
  2. using System.IO;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Windows.Forms;
  6. using System.Drawing;
  7. using System.ComponentModel;
  8. using FastReport.Utils;
  9. using FastReport.Code;
  10. using FastReport.Design.PageDesigners.Code;
  11. namespace FastReport.Forms
  12. {
  13. internal class CodePageOptions : DesignerOptionsPage
  14. {
  15. private CodePageDesigner FEditor;
  16. private CheckBox cbEnableVirtualSpace;
  17. private CheckBox cbAllowOutlining;
  18. private NumericUpDown udTabSize;
  19. private Label lblTabSize;
  20. private CheckBox cbLineNumbers;
  21. private CheckBox cbUseSpaces;
  22. private void InitializeComponent()
  23. {
  24. this.cbEnableVirtualSpace = new System.Windows.Forms.CheckBox();
  25. this.cbUseSpaces = new System.Windows.Forms.CheckBox();
  26. this.cbAllowOutlining = new System.Windows.Forms.CheckBox();
  27. this.udTabSize = new System.Windows.Forms.NumericUpDown();
  28. this.lblTabSize = new System.Windows.Forms.Label();
  29. this.cbLineNumbers = new System.Windows.Forms.CheckBox();
  30. this.tc1.SuspendLayout();
  31. this.tab1.SuspendLayout();
  32. ((System.ComponentModel.ISupportInitialize)(this.udTabSize)).BeginInit();
  33. this.SuspendLayout();
  34. //
  35. // tab1
  36. //
  37. this.tab1.Controls.Add(this.cbLineNumbers);
  38. this.tab1.Controls.Add(this.udTabSize);
  39. this.tab1.Controls.Add(this.lblTabSize);
  40. this.tab1.Controls.Add(this.cbEnableVirtualSpace);
  41. this.tab1.Controls.Add(this.cbUseSpaces);
  42. this.tab1.Controls.Add(this.cbAllowOutlining);
  43. //
  44. // cbEnableVirtualSpace
  45. //
  46. this.cbEnableVirtualSpace.AutoSize = true;
  47. this.cbEnableVirtualSpace.Location = new System.Drawing.Point(16, 16);
  48. this.cbEnableVirtualSpace.Name = "cbEnableVirtualSpace";
  49. this.cbEnableVirtualSpace.Size = new System.Drawing.Size(122, 17);
  50. this.cbEnableVirtualSpace.TabIndex = 0;
  51. this.cbEnableVirtualSpace.Text = "Enable virtual space";
  52. this.cbEnableVirtualSpace.UseVisualStyleBackColor = true;
  53. //
  54. // cbUseSpaces
  55. //
  56. this.cbUseSpaces.AutoSize = true;
  57. this.cbUseSpaces.Location = new System.Drawing.Point(16, 40);
  58. this.cbUseSpaces.Name = "cbUseSpaces";
  59. this.cbUseSpaces.Size = new System.Drawing.Size(130, 17);
  60. this.cbUseSpaces.TabIndex = 1;
  61. this.cbUseSpaces.Text = "Use spaces to fill tabs";
  62. this.cbUseSpaces.UseVisualStyleBackColor = true;
  63. //
  64. // cbAllowOutlining
  65. //
  66. this.cbAllowOutlining.AutoSize = true;
  67. this.cbAllowOutlining.Location = new System.Drawing.Point(16, 64);
  68. this.cbAllowOutlining.Name = "cbAllowOutlining";
  69. this.cbAllowOutlining.Size = new System.Drawing.Size(94, 17);
  70. this.cbAllowOutlining.TabIndex = 2;
  71. this.cbAllowOutlining.Text = "Allow outlining";
  72. this.cbAllowOutlining.UseVisualStyleBackColor = true;
  73. //
  74. // udTabSize
  75. //
  76. this.udTabSize.Location = new System.Drawing.Point(152, 116);
  77. this.udTabSize.Maximum = new decimal(new int[] {
  78. 16,
  79. 0,
  80. 0,
  81. 0});
  82. this.udTabSize.Minimum = new decimal(new int[] {
  83. 1,
  84. 0,
  85. 0,
  86. 0});
  87. this.udTabSize.Name = "udTabSize";
  88. this.udTabSize.Size = new System.Drawing.Size(76, 21);
  89. this.udTabSize.TabIndex = 5;
  90. this.udTabSize.Value = new decimal(new int[] {
  91. 1,
  92. 0,
  93. 0,
  94. 0});
  95. //
  96. // lblTabSize
  97. //
  98. this.lblTabSize.AutoSize = true;
  99. this.lblTabSize.Location = new System.Drawing.Point(16, 120);
  100. this.lblTabSize.Name = "lblTabSize";
  101. this.lblTabSize.Size = new System.Drawing.Size(50, 13);
  102. this.lblTabSize.TabIndex = 4;
  103. this.lblTabSize.Text = "Tab size:";
  104. //
  105. // cbLineNumbers
  106. //
  107. this.cbLineNumbers.AutoSize = true;
  108. this.cbLineNumbers.Location = new System.Drawing.Point(16, 88);
  109. this.cbLineNumbers.Name = "cbLineNumbers";
  110. this.cbLineNumbers.Size = new System.Drawing.Size(89, 17);
  111. this.cbLineNumbers.TabIndex = 6;
  112. this.cbLineNumbers.Text = "Line numbers";
  113. this.cbLineNumbers.UseVisualStyleBackColor = true;
  114. //
  115. // CodePageOptions
  116. //
  117. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  118. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
  119. this.ClientSize = new System.Drawing.Size(389, 313);
  120. this.Name = "CodePageOptions";
  121. this.tc1.ResumeLayout(false);
  122. this.tab1.ResumeLayout(false);
  123. this.tab1.PerformLayout();
  124. ((System.ComponentModel.ISupportInitialize)(this.udTabSize)).EndInit();
  125. this.ResumeLayout(false);
  126. this.PerformLayout();
  127. }
  128. public void Localize()
  129. {
  130. MyRes res = new MyRes("Forms,CodePageOptions");
  131. tab1.Text = res.Get("");
  132. cbEnableVirtualSpace.Text = res.Get("EnableVirtualSpace");
  133. cbUseSpaces.Text = res.Get("UseSpaces");
  134. cbAllowOutlining.Text = res.Get("AllowOutlining");
  135. cbLineNumbers.Text = res.Get("LineNumbers");
  136. lblTabSize.Text = res.Get("TabSize");
  137. }
  138. public override void Init()
  139. {
  140. cbEnableVirtualSpace.Checked = CodePageSettings.EnableVirtualSpace;
  141. cbUseSpaces.Checked = CodePageSettings.UseSpaces;
  142. cbAllowOutlining.Checked = CodePageSettings.AllowOutlining;
  143. cbLineNumbers.Checked = CodePageSettings.LineNumbers;
  144. udTabSize.Value = CodePageSettings.TabSize;
  145. }
  146. public override void Done(DialogResult result)
  147. {
  148. if (result == DialogResult.OK)
  149. {
  150. CodePageSettings.EnableVirtualSpace = cbEnableVirtualSpace.Checked;
  151. CodePageSettings.UseSpaces = cbUseSpaces.Checked;
  152. CodePageSettings.AllowOutlining = cbAllowOutlining.Checked;
  153. CodePageSettings.LineNumbers = cbLineNumbers.Checked;
  154. CodePageSettings.TabSize = (int)udTabSize.Value;
  155. }
  156. }
  157. public CodePageOptions(CodePageDesigner editor) : base()
  158. {
  159. FEditor = editor;
  160. InitializeComponent();
  161. Localize();
  162. }
  163. }
  164. }