ReferenceLibrary.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. using OTS.WinFormsUI.Docking;
  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 OTSPartA_STDEditor
  12. {
  13. public partial class ReferenceLibrary : DockContent
  14. {
  15. public SubMidWindow m_SubMidWindow = null;
  16. protected SourceGrid.Cells.Views.Cell m_CellGroupType = null;
  17. public Dictionary<int, STDdata> ReferenceDictionary = new Dictionary<int, STDdata>();
  18. System.Collections.Hashtable table_ReferenceLibrary;
  19. Dictionary<int, string> ReferenceGroup = new Dictionary<int, string>();
  20. public ReferenceLibrary(SubMidWindow SubMidWindow)
  21. {
  22. InitializeComponent();
  23. m_SubMidWindow = SubMidWindow;
  24. }
  25. private void InitGrid()
  26. {
  27. int iColumnWidth = 20; // 第一列的宽度
  28. int width = this.Width;
  29. PropGrid.Redim(1, 12);
  30. PropGrid.Columns.SetWidth(0, iColumnWidth);
  31. PropGrid.Columns.AutoSizeColumn(2); // 固定进度条
  32. PropGrid.Columns.SetWidth(2, 1 * (width - iColumnWidth) / 30);
  33. PropGrid.Columns.SetWidth(3, 25 * (width - iColumnWidth) / 30);
  34. PropGrid.Columns.SetWidth(4, 3 * (width - iColumnWidth) / 30);
  35. PropGrid.Columns.SetWidth(5, 1 * (width - iColumnWidth) / 30);
  36. PropGrid.Columns.SetWidth(6, 1 * (width - iColumnWidth) / 30);
  37. PropGrid.Columns.SetWidth(7, 2 * (width - iColumnWidth) / 30);
  38. PropGrid.Columns.SetWidth(8, 1 * (width - iColumnWidth) / 30);
  39. PropGrid.Columns.SetWidth(9, 3 * (width - iColumnWidth) / 30);
  40. PropGrid.Columns.SetWidth(10, 10 * (width - iColumnWidth) / 30);
  41. PropGrid.Columns.SetWidth(11, 1 * (width - iColumnWidth) / 30);
  42. PropGrid.AutoStretchColumnsToFitWidth = true;
  43. // 创建列标题
  44. if (null == PropGrid[0, 1])
  45. {
  46. List<String> listColName = new List<string>();
  47. if (m_SubMidWindow.m_MainForm.lan.GetNameTable("Form_Main")["language"].ToString() == "ZH")
  48. {
  49. listColName.Add("规则名称");
  50. listColName.Add("颜色");
  51. listColName.Add("表达式");
  52. listColName.Add("必须存在元素");
  53. listColName.Add("硬度");
  54. listColName.Add("密度");
  55. listColName.Add("导电性");
  56. listColName.Add("BSE");
  57. listColName.Add("化学式");
  58. listColName.Add("元素");
  59. listColName.Add("分组名称");
  60. }
  61. else
  62. {
  63. listColName.Add("Rule Name");
  64. listColName.Add("Color");
  65. listColName.Add("Expression");
  66. listColName.Add("Elements must exist");
  67. listColName.Add("Hardness");
  68. listColName.Add("Density");
  69. listColName.Add("Conductivity");
  70. listColName.Add("BSE");
  71. listColName.Add("Formula");
  72. listColName.Add("Element");
  73. listColName.Add("GroupName");
  74. }
  75. for (int i = 0; i < listColName.Count; i++)
  76. {
  77. if (null == PropGrid[0, 1 + i])
  78. {
  79. PropGrid[0, 1 + i] = new SourceGrid.Cells.Cell(listColName[i]);
  80. }
  81. else
  82. {
  83. PropGrid[0, 1 + i].Value = listColName[i];
  84. }
  85. }
  86. PropGrid.FixedRows = 1; // 第一行是列标题不可以滚动
  87. PropGrid.Selection.EnableMultiSelection = false;
  88. PropGrid.Refresh();
  89. }
  90. }
  91. private void ComparativeLibrary_Load(object sender, EventArgs e)
  92. {
  93. m_SubMidWindow.m_MainForm.lan = new Language(this);
  94. table_ReferenceLibrary = m_SubMidWindow.m_MainForm.lan.GetNameTable("ReferenceLibrary");
  95. InitGrid();
  96. }
  97. bool LoadClassifyToDictionary(string DBAddress, ref Dictionary<int, STDdata> STDDictionary)
  98. {
  99. try
  100. {
  101. System.Data.SQLite.SQLiteConnection m_dbConnection = new System.Data.SQLite.SQLiteConnection("data source='" + DBAddress + "'");
  102. m_dbConnection.Open();
  103. //加载STD信息
  104. System.Data.SQLite.SQLiteDataAdapter m_dataAdapter = new System.Data.SQLite.SQLiteDataAdapter("select * from ClassifySTD", m_dbConnection);
  105. DataSet ds = new DataSet();
  106. m_dataAdapter.Fill(ds);
  107. DataTable dt = ds.Tables[0];
  108. ReferenceGroup.Clear();
  109. STDDictionary.Clear();
  110. if (dt != null)
  111. {
  112. if (dt.Rows.Count > 0)
  113. {
  114. foreach (DataRow item in dt.Rows)
  115. {
  116. STDdata new_STDdata = new STDdata();
  117. new_STDdata.STDId = (int)item["STDId"];
  118. new_STDdata.Hardness = item["Hardness"].ToString();
  119. new_STDdata.Density = item["Density"].ToString();
  120. new_STDdata.Electrical_conductivity = item["Electrical_conductivity"].ToString();
  121. new_STDdata.BSE = item["BSE"].ToString();
  122. new_STDdata.Formula = item["Formula"].ToString();
  123. new_STDdata.Element = item["Formula"].ToString();
  124. new_STDdata.StrName = item["StrName"].ToString();
  125. new_STDdata.Expression = item["Expression"].ToString();
  126. new_STDdata.Color = item["Color"].ToString();
  127. new_STDdata.KeyElementList = item["KeyElementList"].ToString();
  128. new_STDdata.SubElementList = item["SubElementList"].ToString();
  129. new_STDdata.GroupId = (int)item["GroupId"];
  130. STDDictionary.Add(int.Parse(item["STDId"].ToString()), new_STDdata);
  131. }
  132. }
  133. }
  134. System.Data.SQLite.SQLiteDataAdapter m_dataAdapterGroup = new System.Data.SQLite.SQLiteDataAdapter("select Id,name from STDGroups", m_dbConnection);
  135. DataSet dsGroup = new DataSet();
  136. m_dataAdapterGroup.Fill(dsGroup);
  137. DataTable dtGroup = dsGroup.Tables[0];
  138. if (dtGroup != null)
  139. {
  140. if (dtGroup.Rows.Count >= 0)
  141. {
  142. foreach (DataRow item in dtGroup.Rows)
  143. {
  144. ReferenceGroup.Add(int.Parse(item["Id"].ToString()), item["name"].ToString());
  145. }
  146. if(!ReferenceGroup.Keys.Contains(0))
  147. {
  148. ReferenceGroup.Add(0, "Default");
  149. }
  150. }
  151. }
  152. return true;
  153. }
  154. catch (Exception)
  155. {
  156. MessageBox.Show("Reference library format error, please open the correct reference library!", "Tip");
  157. return false;
  158. }
  159. }
  160. void AddDataToRefereceLiberary(Dictionary<int, STDdata> RefDictionary)
  161. {
  162. PropGrid.Redim(RefDictionary.Count+1, 12);
  163. int i = 1;
  164. foreach (KeyValuePair<int, STDdata> kv in RefDictionary)
  165. {
  166. if (null == PropGrid[i, 0])
  167. {
  168. PropGrid[i, 0] = new SourceGrid.Cells.CheckBox(null, false);
  169. SourceGrid.Cells.Controllers.CheckBox clickEvent = new SourceGrid.Cells.Controllers.CheckBox();
  170. clickEvent.CheckedChanged += new EventHandler(clickEvent_Click);
  171. PropGrid[i, 0].AddController(clickEvent);
  172. }
  173. else
  174. {
  175. PropGrid[i, 0].Value = false;
  176. }
  177. PropGrid.Rows[i].Height = 25;
  178. PropGrid.Rows[i].Tag = kv.Value;
  179. PropGrid[i, 1] = new SourceGrid.Cells.Cell(kv.Value.StrName, typeof(string));
  180. PropGrid[i, 1].Tag = kv.Value;
  181. PropGrid[i, 2] = new SourceGrid.Cells.Cell("", typeof(string));
  182. SourceGrid.Cells.Views.Cell view = new SourceGrid.Cells.Views.Cell();
  183. view.BackColor = STDRuleslist.colorHx16toRGB(kv.Value.Color);
  184. PropGrid[i, 2].View = view;
  185. PropGrid[i, 3] = new SourceGrid.Cells.Cell(kv.Value.Expression, typeof(string));
  186. PropGrid[i, 4] = new SourceGrid.Cells.Cell(kv.Value.KeyElementList, typeof(string));
  187. PropGrid[i, 5] = new SourceGrid.Cells.Cell(kv.Value.Hardness, typeof(string));
  188. PropGrid[i, 6] = new SourceGrid.Cells.Cell(kv.Value.Density, typeof(string));
  189. PropGrid[i, 7] = new SourceGrid.Cells.Cell(kv.Value.Electrical_conductivity, typeof(string));
  190. PropGrid[i, 8] = new SourceGrid.Cells.Cell(kv.Value.BSE, typeof(string));
  191. PropGrid[i, 9] = new SourceGrid.Cells.Cell(kv.Value.Formula, typeof(string));
  192. PropGrid[i, 10] = new SourceGrid.Cells.Cell(kv.Value.Element, typeof(string));
  193. PropGrid[i, 11] = new SourceGrid.Cells.Cell(ReferenceGroup[kv.Value.GroupId], typeof(string));
  194. i++;
  195. }
  196. PropGrid.AutoSizeCells();
  197. int iColumnWidth = 45; // 第一列的宽度
  198. int width = this.Width;
  199. PropGrid.Columns.SetWidth(0, iColumnWidth);
  200. PropGrid.Columns.SetWidth(2, 1 * (width - iColumnWidth) / 20);
  201. //PropGrid.Columns.SetWidth(3, 25 * (width - iColumnWidth) / 30);
  202. //PropGrid.Columns.SetWidth(4, 3 * (width - iColumnWidth) / 30);
  203. //PropGrid.Columns.SetWidth(5, 1 * (width - iColumnWidth) / 30);
  204. //PropGrid.Columns.SetWidth(6, 1 * (width - iColumnWidth) / 30);
  205. //PropGrid.Columns.SetWidth(7, 2 * (width - iColumnWidth) / 30);
  206. //PropGrid.Columns.SetWidth(8, 1 * (width - iColumnWidth) / 30);
  207. //PropGrid.Columns.SetWidth(9, 3 * (width - iColumnWidth) / 30);
  208. //PropGrid.Columns.SetWidth(10, 10 * (width - iColumnWidth) / 30);
  209. for (int ro = 0; ro < PropGrid.RowsCount; ro++)
  210. {
  211. PropGrid.Rows.SetHeight(ro,25);
  212. }
  213. for (int col = 1; col < PropGrid.ColumnsCount; col++)
  214. {
  215. for (int ro = 0; ro < PropGrid.RowsCount; ro++)
  216. {
  217. PropGrid[ro,col].AddController(SourceGrid.Cells.Controllers.Unselectable.Default);
  218. }
  219. }
  220. PropGrid.Refresh();
  221. //为修改bug 第一次点击sourcegrid滚动界面时,取数不准问题(载入数据时将第一次点击落在1,0单元格)
  222. if (PropGrid[1,0] != null)
  223. {
  224. SourceGrid.Position pos = new SourceGrid.Position(1, 0);
  225. PropGrid.Selection.Focus(pos, true);
  226. }
  227. }
  228. public void MakeCheckboxUnchecked()
  229. {
  230. for (int i = 1; i < PropGrid.RowsCount; i++)
  231. {
  232. if ((bool)PropGrid[i, 0].Value == true)
  233. {
  234. PropGrid[i, 0].Value = false;
  235. }
  236. }
  237. }
  238. private void clickEvent_Click(object sender, EventArgs e)
  239. {
  240. int t = PropGrid.Selection.ActivePosition.Column;
  241. if (t == 0)//选择事件
  242. {
  243. if ((bool)PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value == true)
  244. {
  245. PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = false;
  246. }
  247. else
  248. {
  249. int r = PropGrid.Selection.ActivePosition.Row;
  250. MakeCheckboxUnchecked();
  251. PropGrid[PropGrid.Selection.ActivePosition.Row, 0].Value = true;
  252. }
  253. PropGrid.Refresh();
  254. }
  255. }
  256. private void TSLoad_Click(object sender, EventArgs e)
  257. {
  258. OpenFileDialog fileSel = new OpenFileDialog();
  259. fileSel.Filter = "(*.db)|*.db";
  260. if (DialogResult.OK == fileSel.ShowDialog())
  261. {
  262. ReferenceDictionary.Clear();
  263. if (LoadClassifyToDictionary(fileSel.FileName, ref ReferenceDictionary))
  264. {
  265. AddDataToRefereceLiberary(ReferenceDictionary);
  266. this.Text = " " + fileSel.FileName;
  267. PropGrid.Refresh();
  268. }
  269. }
  270. }
  271. private void TSClose_Click(object sender, EventArgs e)
  272. {
  273. if (PropGrid.RowsCount > 1)
  274. {
  275. PropGrid.Rows.RemoveRange(1, PropGrid.RowsCount - 1);
  276. ReferenceDictionary.Clear();
  277. this.Text = this.Text.Split(' ')[0];
  278. PropGrid.Refresh();
  279. }
  280. else
  281. {
  282. ReferenceDictionary.Clear();
  283. this.Text = this.Text.Split(' ')[0];
  284. PropGrid.Refresh();
  285. }
  286. }
  287. private void PropGrid_MouseClick(object sender, MouseEventArgs e)
  288. {
  289. SourceGrid.Grid oSender = (SourceGrid.Grid)sender;
  290. oSender.Focus();
  291. // 表示右击的是无效区域, 则退出(第0行是标题)
  292. if (oSender.MouseCellPosition.Row < 1 || oSender.MouseCellPosition.Column < 0)
  293. {
  294. return;
  295. }
  296. // 右击的区域获取焦点
  297. PropGrid.Selection.Focus(new SourceGrid.Position(oSender.MouseCellPosition.Row, oSender.MouseCellPosition.Column), true);
  298. try
  299. {
  300. if (MouseButtons.Right == e.Button && e.Clicks == 1)
  301. {
  302. // 此处编写在什么情况下弹出右击菜单
  303. contextMenuStrip.Show(PointToScreen(e.Location));
  304. // 判断左侧区域是否已经选中了某个stdmineral
  305. bool bEnable = false;
  306. bEnable = (null == m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata) ? false : true;
  307. this.insertToolStripMenuItem.Enabled = bEnable;
  308. }
  309. }
  310. catch (Exception/* ex*/)
  311. {
  312. }
  313. }
  314. private void insertToolStripMenuItem_Click(object sender, EventArgs e)
  315. {
  316. if (m_SubMidWindow.m_MainForm.m_STDRuleslist.tabControl1.SelectedIndex == 0)
  317. {
  318. MessageBox.Show("Please do not operate the reference library in the grouping interface!");
  319. return;
  320. }
  321. m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Focus(true);
  322. int i = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row;
  323. int j = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Column;
  324. /// 保证鼠标点击的GRID行和列是有效的
  325. if (i >= 0 && j >= 0)
  326. {
  327. //规则名称不为空
  328. if (m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Value.ToString().Replace(" ", "").Trim() != "")
  329. {
  330. int id = ((STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Tag).STDId;
  331. m_SubMidWindow.m_MainForm.SaveDataOfSelRule(id);
  332. PropGrid.Focus(true);
  333. int selrow = PropGrid.Selection.ActivePosition.Row;
  334. int STDnum = ((STDdata)PropGrid[selrow, 1].Tag).STDId;
  335. int STDId = 1;
  336. foreach (KeyValuePair<int, STDdata> kv in m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary)
  337. {
  338. if (STDId < kv.Key)
  339. {
  340. STDId = kv.Key;
  341. }
  342. }
  343. STDdata sT = new STDdata();
  344. sT.BSE = ReferenceDictionary[STDnum].BSE;
  345. sT.StrName = ReferenceDictionary[STDnum].StrName;
  346. sT.Color = ReferenceDictionary[STDnum].Color;
  347. sT.Density = ReferenceDictionary[STDnum].Density;
  348. sT.Expression = ReferenceDictionary[STDnum].Expression;
  349. sT.Formula = ReferenceDictionary[STDnum].Formula;
  350. sT.Hardness = ReferenceDictionary[STDnum].Hardness;
  351. sT.UsingImgPropertyList = ReferenceDictionary[STDnum].UsingImgPropertyList;
  352. sT.UsingOtherPropertyList = ReferenceDictionary[STDnum].UsingOtherPropertyList;
  353. sT.KeyElementList = ReferenceDictionary[STDnum].KeyElementList;
  354. sT.SubElementList = ReferenceDictionary[STDnum].SubElementList;
  355. sT.Electrical_conductivity = ReferenceDictionary[STDnum].Electrical_conductivity;
  356. sT.Element = ReferenceDictionary[STDnum].Element;
  357. sT.GroupId = ReferenceDictionary[STDnum].GroupId;
  358. sT.STDId = STDnum;
  359. m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary.Add(STDId + 1, sT);
  360. m_SubMidWindow.m_MainForm.m_STDRuleslist.InsertNewRow(STDId + 1, sT.StrName, STDRuleslist.colorHx16toRGB(sT.Color));
  361. m_SubMidWindow.m_MainForm.m_STDRuleslist.Refresh();
  362. m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata = (STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Tag;
  363. }
  364. }
  365. else
  366. {
  367. AddIntoMainLab();
  368. }
  369. }
  370. #region 因为复制容易引起用户误操作,故取消
  371. private void copyDataToolStripMenuItem_Click(object sender, EventArgs e)
  372. {
  373. //int selrow = PropGrid.Selection.ActivePosition.Row;
  374. //int STDnum = (int)PropGrid[selrow, 1].Tag;
  375. //int STDid = (int)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow, 0].Tag;
  376. //m_SubMidWindow.m_MainForm.STDDictionary[STDid] = ReferenceDictionary[STDnum];
  377. //m_SubMidWindow.m_MainForm.m_STDRuleslist.ChangeStrName(m_SubMidWindow.m_MainForm.m_STDRuleslist.PreRow, ReferenceDictionary[STDnum].StrName);
  378. //m_SubMidWindow.m_MainForm.ChangeSTDEditorAndGrid_Attributes(STDid);
  379. //m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Refresh();
  380. }
  381. #endregion
  382. private void addIntoMainLabToolStripMenuItem_Click(object sender, EventArgs e)
  383. {
  384. if (m_SubMidWindow.m_MainForm.m_STDRuleslist.tabControl1.SelectedIndex == 0)
  385. {
  386. MessageBox.Show("Please do not operate the reference library in the grouping interface!");
  387. return;
  388. }
  389. m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Focus(true);
  390. int i = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Row;
  391. int j = m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.Selection.ActivePosition.Column;
  392. /// 保证鼠标点击的GRID行和列是有效的
  393. if (i > 0 && j >= 0)
  394. {
  395. //规则名称不为空
  396. if (m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, j].Value.ToString().Replace(" ", "").Trim() != "")
  397. {
  398. int id = ((STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[i, 0].Tag).STDId; ;
  399. m_SubMidWindow.m_MainForm.SaveDataOfSelRule(id);
  400. AddIntoMainLab();
  401. }
  402. }
  403. else if(i==-1&&j==-1)
  404. {
  405. AddIntoMainLab();
  406. }
  407. }
  408. void AddIntoMainLab()
  409. {
  410. PropGrid.Focus(true);
  411. int selrow = PropGrid.Selection.ActivePosition.Row;
  412. int STDnum = ((STDdata)PropGrid[selrow, 1].Tag).STDId;
  413. int STDId = 1;
  414. foreach (KeyValuePair<int, STDdata> kv in m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary)
  415. {
  416. if (STDId < kv.Key)
  417. {
  418. STDId = kv.Key;
  419. }
  420. }
  421. STDdata sT = new STDdata();
  422. sT.STDId = STDId + 1;
  423. sT.BSE = ReferenceDictionary[STDnum].BSE;
  424. sT.StrName = ReferenceDictionary[STDnum].StrName;
  425. sT.Color = ReferenceDictionary[STDnum].Color;
  426. sT.Density = ReferenceDictionary[STDnum].Density;
  427. sT.Expression = ReferenceDictionary[STDnum].Expression;
  428. sT.Formula = ReferenceDictionary[STDnum].Formula;
  429. sT.Hardness = ReferenceDictionary[STDnum].Hardness;
  430. sT.UsingImgPropertyList = ReferenceDictionary[STDnum].UsingImgPropertyList;
  431. sT.UsingOtherPropertyList = ReferenceDictionary[STDnum].UsingOtherPropertyList;
  432. sT.KeyElementList = ReferenceDictionary[STDnum].KeyElementList;
  433. sT.SubElementList = ReferenceDictionary[STDnum].SubElementList;
  434. sT.Electrical_conductivity = ReferenceDictionary[STDnum].Electrical_conductivity;
  435. sT.Element = ReferenceDictionary[STDnum].Element;
  436. if (m_SubMidWindow.m_MainForm._sTDEditor.GroupIdDictionaryFromId.ContainsKey(ReferenceDictionary[STDnum].GroupId))
  437. { sT.GroupId = ReferenceDictionary[STDnum].GroupId; }
  438. else
  439. {
  440. MessageBox.Show("As this classification group is not defined, it has been adjusted to the default grouping!");
  441. }
  442. m_SubMidWindow.m_MainForm._sTDEditor.STDDictionary.Add(STDId + 1, sT);
  443. m_SubMidWindow.m_MainForm.m_STDRuleslist.AddNewRow(STDId + 1, sT.StrName, STDRuleslist.colorHx16toRGB(sT.Color));
  444. m_SubMidWindow.m_MainForm.m_STDRuleslist.Refresh();
  445. m_SubMidWindow.m_MainForm.m_STDRuleslist.Predata = (STDdata)m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals[m_SubMidWindow.m_MainForm.m_STDRuleslist.Grid_Minerals.RowsCount - 1, 0].Tag;
  446. }
  447. }
  448. }