Beispiel #1
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     if (this.ActiveMdiChild != null)
     {
         frmScriptEdit fse = this.ActiveMdiChild as frmScriptEdit;
         fse.Close();
     }
 }
Beispiel #2
0
        private void tabStrip1_SelectedTabChanged(object sender, DevComponents.DotNetBar.TabStripTabChangedEventArgs e)
        {
            if (this.ActiveMdiChild == null)
            {
                return;
            }
            frmScriptEdit fse = this.ActiveMdiChild as frmScriptEdit;

            scriptTree1.selectedByIdsNoEvent(fse.fieldid, fse.tabid);
        }
Beispiel #3
0
        private void scriptTree1_SelectedScriptNode(object sender, treeEventArgs e)
        {
            //MessageBox.Show(e.scriptPath);
            frmScriptEdit fseshow = null;

            foreach (frmScriptEdit fse in this.MdiChildren)
            {
                if (e.scriptPath == fse.Tag.ToString())
                {
                    fseshow = fse;
                    break;
                }
            }
            if (fseshow == null)
            {
                fseshow           = new frmScriptEdit();
                fseshow.Tag       = e.scriptPath;
                fseshow.Text      = e.scriptPath;
                fseshow.fieldid   = e.fieldid;
                fseshow.tabid     = e.tabid;
                fseshow.strCode   = e.scriptCode;
                fseshow.tag       = e.tag;
                fseshow.MdiParent = this;
                fseshow.OnSave   += new OnSaveEventsHandle(fseshow_OnSave);
                if (this.OnNewWindow != null)
                {
                    this.OnNewWindow(this, new svEventsArgs(fseshow.luaEditorControl1));
                }
                fseshow.WindowState = FormWindowState.Maximized;
                fseshow.Show();
            }

            //激活窗口到前台
            foreach (DevComponents.DotNetBar.TabItem ti in this.tabStrip1.Tabs)
            {
                if (ti.AttachedControl == fseshow)
                {
                    tabStrip1.SelectedTab = ti;
                }
            }

            fseshow.GoToPosition(curPosition);
            curPosition = null;

            if (mScriptFont != null)
            {
                fseshow.luaEditorControl1.ScriptFont = mScriptFont;
            }
        }
Beispiel #4
0
        public void OpenFileWindow(string filename, object tag)
        {
            frmScriptEdit fseshow = null;

            foreach (frmScriptEdit fse in this.MdiChildren)
            {
                if (filename == fse.Tag.ToString())
                {
                    fseshow = fse;
                    break;
                }
            }

            if (fseshow == null)
            {
                fseshow = new frmScriptEdit();
                fseshow.luaEditorControl1.ForWho = "GameLuaEditor";

                fseshow.Tag       = filename;
                fseshow.filename  = filename;
                fseshow.Text      = filename;
                fseshow.fieldid   = "";
                fseshow.tabid     = "";
                fseshow.strCode   = FileToString(filename);
                fseshow.MdiParent = this;
                if (this.OnNewWindow != null)
                {
                    //this.OnNewWindow(this, new svEventsArgs(fseshow.luaEditorControl1));
                }
                fseshow.WindowState = FormWindowState.Maximized;


                fseshow.Show();
            }

            foreach (DevComponents.DotNetBar.TabItem ti in this.tabStrip1.Tabs)
            {
                if (ti.AttachedControl == fseshow)
                {
                    tabStrip1.SelectedTab = ti;
                }
            }

            ResetScriptFont();
        }
Beispiel #5
0
        private void btnHistory_Click(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild == null)
            {
                return;
            }
            frmHistory frmh = new frmHistory();

            frmh.listBox1.Items.Clear();
            frmScriptEdit fse = this.ActiveMdiChild as frmScriptEdit;

            if (fse.filename != "")
            {
                MessageBox.Show("没有历史纪录");
                return;
            }
            fillListBox(frmh.listBox1, fse.fieldid, fse.tabid, fse.strCode);
            DialogResult ret = frmh.ShowDialog();

            if (ret == DialogResult.OK)
            {
                fse.setCode(frmh.strRetCode);
            }
        }
Beispiel #6
0
        private void scriptTree1_SelectedScriptNode(object sender, treeEventArgs e)
        {
            //MessageBox.Show(e.scriptPath);
            frmScriptEdit fseshow = null;
            foreach (frmScriptEdit fse in this.MdiChildren)
            {
                if (e.scriptPath == fse.Tag.ToString())
                {
                    fseshow = fse;
                    break;
                }
            }
            if (fseshow == null)
            {
                fseshow = new frmScriptEdit();
                fseshow.Tag = e.scriptPath;
                fseshow.Text = e.scriptPath;
                fseshow.fieldid = e.fieldid;
                fseshow.tabid = e.tabid;
                fseshow.strCode = e.scriptCode;
                fseshow.tag = e.tag;
                fseshow.MdiParent = this;
                fseshow.OnSave += new OnSaveEventsHandle(fseshow_OnSave);
                if (this.OnNewWindow != null)
                {
                    this.OnNewWindow(this, new svEventsArgs(fseshow.luaEditorControl1));
                }
                fseshow.WindowState = FormWindowState.Maximized;
                fseshow.Show();

            }

            //激活窗口到前台
            foreach (DevComponents.DotNetBar.TabItem ti in this.tabStrip1.Tabs)
            {
                if (ti.AttachedControl == fseshow)
                {
                    tabStrip1.SelectedTab = ti;
                }
            }

            fseshow.GoToPosition(curPosition);
            curPosition = null;

            if (mScriptFont != null)
            {
                fseshow.luaEditorControl1.ScriptFont = mScriptFont;
            }
        }
Beispiel #7
0
        public void OpenFileWindow(string filename, object tag)
        {
            frmScriptEdit fseshow = null;
            foreach (frmScriptEdit fse in this.MdiChildren)
            {
                if(filename == fse.Tag.ToString())
                {
                    fseshow = fse;
                    break;
                }
            }

            if (fseshow == null)
            {
                fseshow = new frmScriptEdit();
                fseshow.luaEditorControl1.ForWho = "GameLuaEditor";

                fseshow.Tag = filename;
                fseshow.filename = filename;
                fseshow.Text = filename;
                fseshow.fieldid = "";
                fseshow.tabid = "";
                fseshow.strCode = FileToString(filename);
                fseshow.MdiParent = this;
                if (this.OnNewWindow != null)
                {
                    //this.OnNewWindow(this, new svEventsArgs(fseshow.luaEditorControl1));
                }
                fseshow.WindowState = FormWindowState.Maximized;

                
                fseshow.Show();
            }

            foreach (DevComponents.DotNetBar.TabItem ti in this.tabStrip1.Tabs)
            {
                if (ti.AttachedControl == fseshow)
                {
                    tabStrip1.SelectedTab = ti;
                }
            }

            ResetScriptFont();
        }