Exemple #1
0
        // 插入指令:变量定义
        private void button1_Click(object sender, EventArgs e)
        {
            // 检查这个节点可否插入变量
            if (this.isAbleInsert() == false)
            {
                return;
            }
            this.moveCursorToPoint(this, new Point(this.Size.Width / 2, this.Size.Height / 2), Cursor.Position, 0, 0);
            BasicInputForm bif = new BasicInputForm("定义变量", Consta.basicType);

            bif.ShowDialog(this);
            // 如果没有传回任何东西就结束
            if (passBuffer == null)
            {
                return;
            }
            // 插入定义变量操作
            core.dash_defineVariable(passBuffer);
            passBuffer = null;
        }
Exemple #2
0
        // 添加全局变量按钮
        private void button15_Click(object sender, EventArgs e)
        {
            // 开启简单输入窗口并阻塞
            BasicInputForm rif = new BasicInputForm("新建全局变量", Consta.basicType);

            rif.ShowDialog(this);
            // 如果没有传回任何东西就结束
            if (passBuffer == null)
            {
                return;
            }
            // 把更新传到后台
            string[] splitItem = passBuffer.Split('@');
            if (core.addGlobalVar(splitItem[0], splitItem[1]) == false)
            {
                MessageBox.Show("变量名重复,请重新命名", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            // 阻塞结束后,更新窗体
            this.globalvarListBox.Items.Add(passBuffer.Replace("@", " @ "));
            passBuffer = null;
        }