InclusionViewSetting.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. using PaintDotNet;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace Metis.DedicatedAnalysis.Inclusions
  12. {
  13. public partial class InclusionViewSetting : PdnBaseForm
  14. {
  15. private Label label1;
  16. private GroupBox groupBox1;
  17. private Button button1;
  18. private Button btn_close;
  19. private NumericUpDown numericUpDown1;
  20. private System.Action<int> closeCallback;
  21. private int viewNum;
  22. public InclusionViewSetting(int viewNum ,System.Action<int> closeCallback)
  23. {
  24. InitializeComponent();
  25. this.closeCallback = closeCallback;
  26. this.viewNum = viewNum;
  27. Initialize();
  28. }
  29. private void InitializeComponent()
  30. {
  31. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  32. this.label1 = new System.Windows.Forms.Label();
  33. this.groupBox1 = new System.Windows.Forms.GroupBox();
  34. this.button1 = new System.Windows.Forms.Button();
  35. this.btn_close = new System.Windows.Forms.Button();
  36. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  37. this.groupBox1.SuspendLayout();
  38. this.SuspendLayout();
  39. //
  40. // numericUpDown1
  41. //
  42. this.numericUpDown1.DecimalPlaces = 0;
  43. this.numericUpDown1.Location = new System.Drawing.Point(69, 87);
  44. this.numericUpDown1.Maximum = new decimal(new int[] {
  45. 1241513983,
  46. 370409800,
  47. 542101,
  48. 0});
  49. this.numericUpDown1.Name = "numericUpDown1";
  50. this.numericUpDown1.Size = new System.Drawing.Size(111, 21);
  51. this.numericUpDown1.TabIndex = 7;
  52. this.numericUpDown1.Value = new decimal(new int[] {
  53. 71,
  54. 0,
  55. 0,
  56. 0});
  57. //
  58. // label1
  59. //
  60. this.label1.AutoSize = true;
  61. this.label1.Location = new System.Drawing.Point(10, 89);
  62. this.label1.Name = "label1";
  63. this.label1.Size = new System.Drawing.Size(53, 12);
  64. this.label1.TabIndex = 8;
  65. this.label1.Text = "视场边长";
  66. //
  67. // groupBox1
  68. //
  69. this.groupBox1.Controls.Add(this.button1);
  70. this.groupBox1.Controls.Add(this.btn_close);
  71. this.groupBox1.Location = new System.Drawing.Point(12, 3);
  72. this.groupBox1.Name = "groupBox1";
  73. this.groupBox1.Size = new System.Drawing.Size(369, 53);
  74. this.groupBox1.TabIndex = 13;
  75. this.groupBox1.TabStop = false;
  76. //
  77. // button1
  78. //
  79. this.button1.Location = new System.Drawing.Point(198, 20);
  80. this.button1.Name = "button1";
  81. this.button1.Size = new System.Drawing.Size(75, 23);
  82. this.button1.TabIndex = 5;
  83. this.button1.Text = "恢复默认";
  84. this.button1.UseVisualStyleBackColor = true;
  85. this.button1.Click += new System.EventHandler(this.button1_Click);
  86. //
  87. // btn_close
  88. //
  89. this.btn_close.Location = new System.Drawing.Point(279, 20);
  90. this.btn_close.Name = "btn_close";
  91. this.btn_close.Size = new System.Drawing.Size(75, 23);
  92. this.btn_close.TabIndex = 4;
  93. this.btn_close.Text = "保存修改";
  94. this.btn_close.UseVisualStyleBackColor = true;
  95. this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
  96. //
  97. // InclusionViewSetting
  98. //
  99. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  100. this.ClientSize = new System.Drawing.Size(393, 149);
  101. this.Controls.Add(this.groupBox1);
  102. this.Controls.Add(this.label1);
  103. this.Controls.Add(this.numericUpDown1);
  104. this.MaximizeBox = false;
  105. this.MinimizeBox = false;
  106. this.Name = "InclusionViewSetting";
  107. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  108. this.Text = "视场设置";
  109. this.Controls.SetChildIndex(this.numericUpDown1, 0);
  110. this.Controls.SetChildIndex(this.label1, 0);
  111. this.Controls.SetChildIndex(this.groupBox1, 0);
  112. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  113. this.groupBox1.ResumeLayout(false);
  114. this.ResumeLayout(false);
  115. this.PerformLayout();
  116. }
  117. private void Initialize() {
  118. this.FormClosed += new FormClosedEventHandler(formClosed);
  119. this.numericUpDown1.Value = viewNum;
  120. }
  121. private void button1_Click(object sender, EventArgs e)
  122. {
  123. this.numericUpDown1.Value = 710;
  124. }
  125. private void btn_close_Click(object sender, EventArgs e)
  126. {
  127. this.viewNum = (int)this.numericUpDown1.Value;
  128. this.Close();
  129. }
  130. private void formClosed(object sender, EventArgs e)
  131. {
  132. this.closeCallback(viewNum);
  133. }
  134. }
  135. }