コード例 #1
0
 private void listViewFields_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Clicks == 1)
     {
         if (e.Button == MouseButtons.Right)
         {
             contextMenuStrip1.Tag = listViewFields;
             contextMenuStrip1.Show(listViewFields, e.Location);
         }
     }
     else if (e.Clicks == 2)
     {
         if (listViewFields.SelectedItems.Count == 1)
         {
             InputValueDialogForm dlg = new InputValueDialogForm("编辑字段", listViewFields.SelectedItems[0].Tag);
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 Exec("Refresh");
             }
         }
         else
         {
             Exec("NewField");
         }
         Exec("Refresh");
     }
 }
コード例 #2
0
        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NodeClass            nodeClass = new NodeClass();
            InputValueDialogForm testForm  = new InputValueDialogForm("编辑", nodeClass);

            testForm.ShowDialog();
        }
コード例 #3
0
        private void NewField()
        {
            NodeField            field = new NodeField();
            InputValueDialogForm form  = new InputValueDialogForm("添加字段", field);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_NodeClass.AddField(field))
                {
                    Exec("Refresh");
                }
            }
        }
コード例 #4
0
        private void New()
        {
            VariableFieldDesigner field = new VariableFieldDesigner();
            InputValueDialogForm  form  = new InputValueDialogForm("添加变量", field);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_EditContextVariable.Add(field))
                {
                    AddVariableFieldItem(field);
                }
            }
        }
コード例 #5
0
        private void Edit()
        {
            if (listView1.SelectedIndices.Count == 1)
            {
                int                   selectIdx    = listView1.SelectedIndices[0];
                ListViewItem          selectedItem = listView1.Items[selectIdx];
                VariableFieldDesigner variableItem = selectedItem.Tag as VariableFieldDesigner;

                InputValueDialogForm testForm = new InputValueDialogForm("编辑", variableItem);
                if (testForm.ShowDialog() == DialogResult.OK)
                {
                    UpdateVariableFieldItem(variableItem);
                }
            }
        }
コード例 #6
0
 private void EditBehaviorTreeVar()
 {
     if (listView2.SelectedItems.Count == 1)
     {
         VariableFieldDesigner field = listView2.SelectedItems[0].Tag as VariableFieldDesigner;
         InputValueDialogForm  dlg   = new InputValueDialogForm("编辑行为树变量", listView2.SelectedItems[0].Tag);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             Exec("Refresh_BehaviorTreeVar");
             ListViewItem listViewItem = GetListViewItem(listView2, field);
             if (listViewItem != null)
             {
                 listViewItem.Selected = true;
             }
         }
     }
 }
コード例 #7
0
 private void EditField()
 {
     if (listView1.SelectedItems.Count == 1)
     {
         FieldDesigner        field = listView1.SelectedItems[0].Tag as FieldDesigner;
         InputValueDialogForm dlg   = new InputValueDialogForm("编辑字段", listView1.SelectedItems[0].Tag);
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             Exec("Refresh_Field");
             ListViewItem listViewItem = GetListViewItem(listView1, field);
             if (listViewItem != null)
             {
                 listViewItem.Selected = true;
             }
         }
     }
 }
コード例 #8
0
        private void NewBehaviorTreeVar()
        {
            VariableFieldDesigner field = new VariableFieldDesigner();
            InputValueDialogForm  form  = new InputValueDialogForm("添加行为树变量", field);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_EditBehaviorTree.AddBehaviorTreeVar(field))
                {
                    Exec("Refresh_BehaviorTreeVar");
                    ListViewItem listViewItem = GetListViewItem(listView2, field);
                    if (listViewItem != null)
                    {
                        listViewItem.Selected = true;
                    }
                }
            }
        }
コード例 #9
0
        private void NewField()
        {
            FieldDesigner        field = new FieldDesigner();
            InputValueDialogForm form  = new InputValueDialogForm("添加字段", field);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (m_EditBehaviorTree.AddField(field))
                {
                    Exec("Refresh_Field");
                    ListViewItem listViewItem = GetListViewItem(listView1, field);
                    if (listViewItem != null)
                    {
                        listViewItem.Selected = true;
                    }
                }
            }
        }