工具箱相关
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TKInfo.cs 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using GrxCAD.EditorInput;
  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 HCTools
  12. {
  13. public partial class TKInfo : Form
  14. {
  15. public TKInfo()
  16. {
  17. InitializeComponent();
  18. }
  19. #region 图廓信息参数
  20. public static string name = "";
  21. public static string note = "";
  22. public static string CTY = "";
  23. public static string TDY = "";
  24. public static string SHY = "";
  25. public static string JCY = "";
  26. public static string FCY = "";
  27. public static string SV = "";
  28. public static int DH = -1;
  29. public static string Secret = "";
  30. public static int BLC = 2000;
  31. //public static string ConstLine1 = "GB/T20257.1-2007国家基本比例尺地图图式 第一部分:";
  32. //public static string ConstLine2 = "1:500 1:1000 1:2000地形图图式";
  33. #endregion
  34. private void TKInfo_Load(object sender, EventArgs e)
  35. {
  36. //this.richTextBox1.Text = "\r\n";
  37. //this.richTextBox1.Text += ConstLine1;
  38. //this.richTextBox1.Text += "\r\n";
  39. //this.richTextBox1.Text += ConstLine2;
  40. //this.richTextBox1.Text += "\r\n";
  41. //this.richTextBox1.Text += System.DateTime.Now.Year + "年" + System.DateTime.Now.Month + "月数字化成图。";
  42. this.textBox_Name.Text = Properties.Settings.Default.TFName;
  43. this.richTextBox1.Text = Properties.Settings.Default.Note2;
  44. this.textBox_CTY.Text = Properties.Settings.Default.CTY;
  45. this.textBox_TDY.Text = Properties.Settings.Default.TDY;
  46. this.textBox_SHY.Text = Properties.Settings.Default.SDY;
  47. this.textBox_JCY.Text = Properties.Settings.Default.JCY;
  48. this.textBox_DH.Text = Properties.Settings.Default.DH.ToString();
  49. this.textBox_secret.Text = Properties.Settings.Default.secret.ToString();
  50. textBox_savepath.Text = Properties.Settings.Default.svpath;
  51. }
  52. private void btn_OK_Click(object sender, EventArgs e)
  53. {
  54. if (string.IsNullOrEmpty(textBox_Name.Text.Trim()) == true)
  55. {
  56. MessageBox.Show("请输入图名!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  57. return;
  58. }
  59. if (string.IsNullOrEmpty(comboBox_BLC1.Text))
  60. {
  61. MessageBox.Show("请选择比例尺!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  62. return;
  63. }
  64. if(string.IsNullOrEmpty(textBox_savepath.Text))
  65. {
  66. MessageBox.Show("请选择保存路径!", "温磬提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  67. return;
  68. }
  69. name = this.textBox_Name.Text;
  70. note = this.richTextBox1.Text;
  71. CTY = this.textBox_CTY.Text;
  72. TDY = this.textBox_TDY.Text;
  73. SHY = this.textBox_SHY.Text;
  74. JCY = this.textBox_JCY.Text;
  75. SV = textBox_savepath.Text;
  76. Secret = textBox_secret.Text;
  77. if (string.IsNullOrEmpty(textBox_DH.Text.Trim()) == false)
  78. {
  79. DH = Convert.ToInt32(textBox_DH.Text);
  80. }
  81. if (comboBox_BLC1.SelectedIndex == 0)
  82. {
  83. BLC = 500;
  84. }
  85. else if (comboBox_BLC1.SelectedIndex == 1)
  86. {
  87. BLC = 1000;
  88. }
  89. else
  90. {
  91. BLC = 2000;
  92. }
  93. //界面最小化
  94. this.Close();
  95. CreateSheetMap map = new CreateSheetMap();
  96. map.create();
  97. Properties.Settings.Default.TFName = name;
  98. Properties.Settings.Default.Note2 = note;
  99. Properties.Settings.Default.CTY = CTY;
  100. Properties.Settings.Default.JCY = JCY;
  101. Properties.Settings.Default.TDY = TDY;
  102. Properties.Settings.Default.SDY = SHY;
  103. Properties.Settings.Default.DH = DH;
  104. Properties.Settings.Default.svpath = SV;
  105. Properties.Settings.Default.secret = Secret;
  106. Properties.Settings.Default.Save();
  107. MessageBox.Show("生成完毕");
  108. }
  109. private void btn_Cancel_Click(object sender, EventArgs e)
  110. {
  111. this.Close();
  112. }
  113. private void button_chse_Click(object sender, EventArgs e)
  114. {
  115. FolderBrowserDialog open = new FolderBrowserDialog();
  116. open.Description = "请选择文件夹";
  117. if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  118. {
  119. textBox_savepath.Text = open.SelectedPath;
  120. }
  121. }
  122. }
  123. }