Browse Source

添加组编辑界面并重构编辑器框架

cxs 4 months ago
parent
commit
be911f7f8e
2 changed files with 114 additions and 75 deletions
  1. 97 40
      OTSPartA_STDEditor/UI/STDRuleslist.Designer.cs
  2. 17 35
      OTSPartA_STDEditor/UI/STDRuleslist.cs

+ 97 - 40
OTSPartA_STDEditor/UI/STDRuleslist.Designer.cs

@@ -29,35 +29,22 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            this.Grid_Minerals = new SourceGrid.Grid();
             this.MenuStrip_STDRulelist = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.ToolStripMenuItem_New = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_Del = new System.Windows.Forms.ToolStripMenuItem();
-            this.button_UpOrder = new System.Windows.Forms.Button();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage_GroupView = new System.Windows.Forms.TabPage();
+            this.treeView1 = new System.Windows.Forms.TreeView();
+            this.tabPage_RuleView = new System.Windows.Forms.TabPage();
+            this.Grid_Minerals = new SourceGrid.Grid();
             this.button_DownOrder = new System.Windows.Forms.Button();
+            this.button_UpOrder = new System.Windows.Forms.Button();
             this.MenuStrip_STDRulelist.SuspendLayout();
+            this.tabControl1.SuspendLayout();
+            this.tabPage_GroupView.SuspendLayout();
+            this.tabPage_RuleView.SuspendLayout();
             this.SuspendLayout();
             // 
-            // Grid_Minerals
-            // 
-            this.Grid_Minerals.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.Grid_Minerals.BackColor = System.Drawing.SystemColors.Control;
-            this.Grid_Minerals.ContextMenuStrip = this.MenuStrip_STDRulelist;
-            this.Grid_Minerals.EnableSort = true;
-            this.Grid_Minerals.Location = new System.Drawing.Point(23, 0);
-            this.Grid_Minerals.Margin = new System.Windows.Forms.Padding(3, 3, 10, 3);
-            this.Grid_Minerals.Name = "Grid_Minerals";
-            this.Grid_Minerals.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows;
-            this.Grid_Minerals.SelectionMode = SourceGrid.GridSelectionMode.Cell;
-            this.Grid_Minerals.Size = new System.Drawing.Size(341, 751);
-            this.Grid_Minerals.TabIndex = 9;
-            this.Grid_Minerals.TabStop = true;
-            this.Grid_Minerals.ToolTipText = "";
-            this.Grid_Minerals.Click += new System.EventHandler(this.MineralsGrid_Click);
-            this.Grid_Minerals.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.Grid_Minerals_PreviewKeyDown);
-            // 
             // MenuStrip_STDRulelist
             // 
             this.MenuStrip_STDRulelist.ImageScalingSize = new System.Drawing.Size(24, 24);
@@ -82,40 +69,104 @@
             this.ToolStripMenuItem_Del.Text = "删除";
             this.ToolStripMenuItem_Del.Click += new System.EventHandler(this.ToolStripMenuItem_Del_Click);
             // 
-            // button_UpOrder
+            // tabControl1
             // 
-            this.button_UpOrder.Font = new System.Drawing.Font("华文彩云", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_UpOrder.Location = new System.Drawing.Point(3, 14);
-            this.button_UpOrder.Name = "button_UpOrder";
-            this.button_UpOrder.Size = new System.Drawing.Size(18, 92);
-            this.button_UpOrder.TabIndex = 28;
-            this.button_UpOrder.Text = "↑";
-            this.button_UpOrder.UseVisualStyleBackColor = true;
-            this.button_UpOrder.Click += new System.EventHandler(this.button_UpOrder_Click);
+            this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom;
+            this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.tabControl1.Controls.Add(this.tabPage_GroupView);
+            this.tabControl1.Controls.Add(this.tabPage_RuleView);
+            this.tabControl1.Location = new System.Drawing.Point(1, 1);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 1;
+            this.tabControl1.Size = new System.Drawing.Size(313, 782);
+            this.tabControl1.TabIndex = 30;
+            this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
+            // 
+            // tabPage_GroupView
+            // 
+            this.tabPage_GroupView.Controls.Add(this.treeView1);
+            this.tabPage_GroupView.Location = new System.Drawing.Point(4, 4);
+            this.tabPage_GroupView.Name = "tabPage_GroupView";
+            this.tabPage_GroupView.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage_GroupView.Size = new System.Drawing.Size(305, 756);
+            this.tabPage_GroupView.TabIndex = 0;
+            this.tabPage_GroupView.Text = "分组视图";
+            this.tabPage_GroupView.UseVisualStyleBackColor = true;
+            // 
+            // treeView1
+            // 
+            this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.treeView1.Location = new System.Drawing.Point(3, 3);
+            this.treeView1.Name = "treeView1";
+            this.treeView1.Size = new System.Drawing.Size(299, 750);
+            this.treeView1.TabIndex = 0;
+            // 
+            // tabPage_RuleView
+            // 
+            this.tabPage_RuleView.Controls.Add(this.Grid_Minerals);
+            this.tabPage_RuleView.Controls.Add(this.button_DownOrder);
+            this.tabPage_RuleView.Controls.Add(this.button_UpOrder);
+            this.tabPage_RuleView.Location = new System.Drawing.Point(4, 4);
+            this.tabPage_RuleView.Name = "tabPage_RuleView";
+            this.tabPage_RuleView.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage_RuleView.Size = new System.Drawing.Size(305, 756);
+            this.tabPage_RuleView.TabIndex = 1;
+            this.tabPage_RuleView.Text = "规则视图";
+            this.tabPage_RuleView.UseVisualStyleBackColor = true;
+            // 
+            // Grid_Minerals
+            // 
+            this.Grid_Minerals.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.Grid_Minerals.BackColor = System.Drawing.SystemColors.Control;
+            this.Grid_Minerals.ContextMenuStrip = this.MenuStrip_STDRulelist;
+            this.Grid_Minerals.EnableSort = true;
+            this.Grid_Minerals.Location = new System.Drawing.Point(27, 3);
+            this.Grid_Minerals.Margin = new System.Windows.Forms.Padding(3, 3, 10, 3);
+            this.Grid_Minerals.Name = "Grid_Minerals";
+            this.Grid_Minerals.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows;
+            this.Grid_Minerals.SelectionMode = SourceGrid.GridSelectionMode.Cell;
+            this.Grid_Minerals.Size = new System.Drawing.Size(273, 751);
+            this.Grid_Minerals.TabIndex = 30;
+            this.Grid_Minerals.TabStop = true;
+            this.Grid_Minerals.ToolTipText = "";
+            this.Grid_Minerals.Click += new System.EventHandler(this.MineralsGrid_Click);
             // 
             // button_DownOrder
             // 
             this.button_DownOrder.Font = new System.Drawing.Font("华文彩云", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.button_DownOrder.Location = new System.Drawing.Point(3, 115);
+            this.button_DownOrder.Location = new System.Drawing.Point(3, 118);
             this.button_DownOrder.Name = "button_DownOrder";
             this.button_DownOrder.Size = new System.Drawing.Size(18, 92);
-            this.button_DownOrder.TabIndex = 29;
+            this.button_DownOrder.TabIndex = 32;
             this.button_DownOrder.Text = "↓";
             this.button_DownOrder.UseVisualStyleBackColor = true;
             this.button_DownOrder.Click += new System.EventHandler(this.button_DownOrder_Click);
             // 
+            // button_UpOrder
+            // 
+            this.button_UpOrder.Font = new System.Drawing.Font("华文彩云", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.button_UpOrder.Location = new System.Drawing.Point(3, 17);
+            this.button_UpOrder.Name = "button_UpOrder";
+            this.button_UpOrder.Size = new System.Drawing.Size(18, 92);
+            this.button_UpOrder.TabIndex = 31;
+            this.button_UpOrder.Text = "↑";
+            this.button_UpOrder.UseVisualStyleBackColor = true;
+            this.button_UpOrder.Click += new System.EventHandler(this.button_UpOrder_Click);
+            // 
             // STDRuleslist
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.AutoScroll = true;
             this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
-            this.ClientSize = new System.Drawing.Size(364, 751);
+            this.ClientSize = new System.Drawing.Size(317, 785);
             this.CloseButton = false;
             this.CloseButtonVisible = false;
-            this.Controls.Add(this.button_UpOrder);
-            this.Controls.Add(this.button_DownOrder);
-            this.Controls.Add(this.Grid_Minerals);
+            this.Controls.Add(this.tabControl1);
             this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Name = "STDRuleslist";
             this.ShowIcon = false;
@@ -123,17 +174,23 @@
             this.Load += new System.EventHandler(this.STDRuleslist_Load);
             this.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.Grid_Minerals_PreviewKeyDown);
             this.MenuStrip_STDRulelist.ResumeLayout(false);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage_GroupView.ResumeLayout(false);
+            this.tabPage_RuleView.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
-
-        public SourceGrid.Grid Grid_Minerals;
         private System.Windows.Forms.ContextMenuStrip MenuStrip_STDRulelist;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_New;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_Del;
-        public System.Windows.Forms.Button button_UpOrder;
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage_GroupView;
+        private System.Windows.Forms.TabPage tabPage_RuleView;
         public System.Windows.Forms.Button button_DownOrder;
+        public System.Windows.Forms.Button button_UpOrder;
+        private System.Windows.Forms.TreeView treeView1;
+        public SourceGrid.Grid Grid_Minerals;
     }
 }

+ 17 - 35
OTSPartA_STDEditor/UI/STDRuleslist.cs

@@ -120,42 +120,7 @@ namespace OTSPartA_STDEditor
 
         private void MineralsGrid_Click(object sender, EventArgs e)
         {
-            SourceGrid.Grid ls_gd = (SourceGrid.Grid)sender;
-            ls_gd.Focus();
-            int i = ls_gd.Selection.ActivePosition.Row;
-            int j = ls_gd.Selection.ActivePosition.Column;
-            //string jj =m_MainForm.m_Attributes.Grid_Attributes[10, 1].Value.ToString();
-            /// 保证鼠标点击的GRID行和列是有效的
-            if (i >= 0 && j >= 0)
-            {
-                ////规则名称不为空
-                //if (Grid_Minerals[i, 0].Value.ToString().Replace(" ", "").Trim() != "")
-                //{
-                //    if (m_MainForm.CheckAttributes() && m_MainForm.Checktextbox_STDEditor())
-                //    {
-
-                        m_MainForm.SaveDataOfSelRule(PreRow, 0);
-                        m_MainForm.ChangeSTDEditorAndGrid_Attributes(int.Parse(Grid_Minerals[i, 0].Tag.ToString()));
-                        m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
-                        PreRow = i;
 
-                //    }
-                //    else
-                //    {
-                //        Position pos = new Position(PreRow, 0);
-                //        Grid_Minerals.Selection.Focus(pos, true);
-                //        m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
-                //    }
-                //}
-                //else
-                //{
-                //    Position pos = new Position(PreRow, 0);
-                //    Grid_Minerals.Selection.Focus(pos, true);
-                //    m_MainForm.m_SubMidWindow.m_ComparativeLibrary.MakeCheckboxUnchecked();
-                //}
-            }
-
-            SetOrderButtonsStatus();
         }
         /// <summary>
         /// 新建
@@ -552,5 +517,22 @@ namespace OTSPartA_STDEditor
                 button_DownOrder.Enabled = false;
             }
         }
+
+        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (tabControl1.SelectedIndex == 0)
+            {
+                InitGroupEditorView();
+            }
+            else if (tabControl1.SelectedIndex == 1)
+            {
+                
+            }
+        }
+
+        void InitGroupEditorView()
+        {
+
+        }
     }
 }