|
@@ -0,0 +1,98 @@
|
|
|
+using OTS.WinFormsUI.Docking;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.ComponentModel;
|
|
|
+using System.Data;
|
|
|
+using System.Drawing;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Windows.Forms;
|
|
|
+
|
|
|
+namespace OTSPartA_STDEditor
|
|
|
+{
|
|
|
+ public partial class SubMidWindow : DockContent
|
|
|
+ {
|
|
|
+ public Form_Main m_MainForm = null;
|
|
|
+ public STDEditor m_STDEditor = null;
|
|
|
+ public ReferenceLibrary m_ComparativeLibrary = null;
|
|
|
+
|
|
|
+ public SubMidWindow(Form_Main mainForm)
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+
|
|
|
+ m_MainForm = mainForm;
|
|
|
+ m_STDEditor = new STDEditor(this,m_MainForm.STDDBAddress);
|
|
|
+ m_ComparativeLibrary = new ReferenceLibrary(this);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void SubMidWindow_Load(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ m_MainForm.lan = new Language(this);
|
|
|
+ CreateSubMidWindow();
|
|
|
+ }
|
|
|
+ public void CreateSubMidWindow()
|
|
|
+ {
|
|
|
+ dockPanel1.DockTopPortion = 660;
|
|
|
+ dockPanel1.DockBottomPortion = 550;
|
|
|
+ m_STDEditor.DockAreas = DockAreas.DockTop;
|
|
|
+ m_STDEditor.Show(dockPanel1, DockState.DockTop);
|
|
|
+ m_ComparativeLibrary.DockAreas = DockAreas.DockBottom;
|
|
|
+ m_ComparativeLibrary.Show(dockPanel1, DockState.DockBottom);
|
|
|
+
|
|
|
+ m_STDEditor.AutoHidePortion = 0.55;
|
|
|
+ m_ComparativeLibrary.AutoHidePortion = 0.35;
|
|
|
+
|
|
|
+ //m_SubMidWindow.m_STDEditor.Show(m_SubMidWindow.dockPanel1, OTS.WinFormsUI.Docking.DockState.DockTop);
|
|
|
+ //m_SubMidWindow.m_STDEditor.DockAreas = OTS.WinFormsUI.Docking.DockAreas.DockTop;
|
|
|
+ //m_SubMidWindow.m_ComparativeLibrary.Show(m_SubMidWindow.m_STDEditor.Pane, OTS.WinFormsUI.Docking.DockAlignment.Bottom, 0.5);
|
|
|
+ //m_SubMidWindow.m_ComparativeLibrary.DockAreas = OTS.WinFormsUI.Docking.DockAreas.DockTop;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void ChangeText_textbox_STDEditor(int STDId)
|
|
|
+ {
|
|
|
+ m_STDEditor.textbox_STDEditor.Text = m_MainForm.STDDictionary[STDId].Expression;
|
|
|
+ m_STDEditor.STDId = STDId;
|
|
|
+
|
|
|
+ m_STDEditor.dataGridView_KeyElements.Rows.Clear();
|
|
|
+ m_STDEditor.dataGridView_KeyElements.Columns.Clear();
|
|
|
+
|
|
|
+ string[] KeyElement = m_MainForm.STDDictionary[STDId].KeyElementList.Trim().Split(',');
|
|
|
+ for (int i = 0; i < KeyElement.Length; i++)
|
|
|
+ {
|
|
|
+ if (KeyElement[0] != "")
|
|
|
+ {
|
|
|
+ DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
|
|
|
+ dataGridViewButtonColumn.Name = m_STDEditor.dataGridView_SubElements.Columns.Count.ToString();
|
|
|
+ m_STDEditor.dataGridView_KeyElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
+ if (m_STDEditor.dataGridView_KeyElements.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ DataGridViewRow row = new DataGridViewRow();
|
|
|
+ m_STDEditor.dataGridView_KeyElements.Rows.Add(row);
|
|
|
+ }
|
|
|
+ m_STDEditor.dataGridView_KeyElements.Rows[0].Cells[i].Value = KeyElement[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ m_STDEditor.dataGridView_SubElements.Rows.Clear();
|
|
|
+ m_STDEditor.dataGridView_SubElements.Columns.Clear();
|
|
|
+
|
|
|
+ string[] SubElement = m_MainForm.STDDictionary[STDId].SubElementList.Trim().Split(',');
|
|
|
+ for (int i = 0; i < SubElement.Length; i++)
|
|
|
+ {
|
|
|
+ if (SubElement[i] != "")
|
|
|
+ {
|
|
|
+ DataGridViewButtonColumn dataGridViewButtonColumn = new DataGridViewButtonColumn();
|
|
|
+ dataGridViewButtonColumn.Name = m_STDEditor.dataGridView_SubElements.Columns.Count.ToString();
|
|
|
+ m_STDEditor.dataGridView_SubElements.Columns.Add(dataGridViewButtonColumn);
|
|
|
+ if (m_STDEditor.dataGridView_SubElements.Rows.Count == 0)
|
|
|
+ {
|
|
|
+ DataGridViewRow row = new DataGridViewRow();
|
|
|
+ m_STDEditor.dataGridView_SubElements.Rows.Add(row);
|
|
|
+ }
|
|
|
+ m_STDEditor.dataGridView_SubElements.Rows[0].Cells[i].Value = SubElement[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|