Beispiel #1
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 #2
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 #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();
        }