Example #1
0
        private void solutionExplorer1_TreeViewItemClick(object sender, System.EventArgs e)
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
            DevExpress.XtraTreeList.TreeList treeView = sender as DevExpress.XtraTreeList.TreeList;
            string s = treeView.FocusedNode.GetDisplayText(0);
            foreach (BaseDocument doc in tabbedView1.Documents)
            {
                if (doc.Caption == s)
                {
                    tabbedView1.ActivateDocument(doc.Control);
                    return;
                }
            }

            EditorWindow editor = new EditorWindow(this);
            editor.MdiParent = this;
            editor.Text = s;
            editor.Icon = (Icon)resources.GetObject("XorNet");
            editor.CreateControls();
            m_editorSelected = editor;
            editor.Show();

            tabbedView1.BeginUpdate();
            BaseDocument document = tabbedView1.Controller.AddDocument(editor);

            document.Image = (Image)(resources.GetObject("XorNet1"));//imageList4.Images[10];
            document.Form.Text = s;
            document.Form.Icon = (Icon)resources.GetObject("XorNet");
            document.Caption = m_editorSelected.Text;
            editor.Document = document;
            tabbedView1.EndUpdate();
        }
Example #2
0
        private void AddNewForm(string s = "UNDEFINED")
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
            EditorWindow editor = new EditorWindow(this);
            editor.MdiParent = this;
            editor.Icon = (Icon)resources.GetObject("XorNet");
            editor.Text = s;
            editor.CreateControls();
            m_editorSelected = editor;
            editor.Show();
            tabbedView1.BeginUpdate();
            BaseDocument document = tabbedView1.Controller.AddDocument(editor);

            document.Image = (Image)(resources.GetObject("XorNet1"));//imageList4.Images[10];
            document.Form.Text = m_editorSelected.Text;
            document.Form.Icon = (Icon)resources.GetObject("XorNet");
            document.Caption = m_editorSelected.Text;
            editor.Document = document;
            tabbedView1.EndUpdate();
        }