Ejemplo n.º 1
0
        public void AddBindingList(string Lib, string Obj)
        {
            string  pageName   = Lib + "/" + Obj + " Binding Directory";
            OpenTab currentTab = EditorContains(pageName);

            //Close tab if it already exists.
            if (currentTab != null)
            {
                switch (currentTab.getSide())
                {
                case OpenTab.TAB_SIDE.Left:
                    editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                    break;

                case OpenTab.TAB_SIDE.Right:
                    editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                    break;
                }
            }

            TabPage tabPage = new TabPage(pageName);

            tabPage.ImageIndex = 1;
            BindingDirectory bnddirlist = new BindingDirectory(Lib, Obj);

            bnddirlist.BringToFront();
            bnddirlist.Dock = DockStyle.Fill;
            tabPage.Controls.Add(bnddirlist);
            editortabsleft.TabPages.Add(tabPage);

            SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
        }
Ejemplo n.º 2
0
        private void editortabs_MouseClick(object sender, MouseEventArgs e)
        {
            Control fromTabs = sender as Control;

            OpenTab.TAB_SIDE side = OpenTab.TAB_SIDE.None;
            TabControlExtra  Tab  = null;

            switch (fromTabs.Name)
            {
            case "editortabsleft":
                side = OpenTab.TAB_SIDE.Left;
                Tab  = editortabsleft;
                break;

            case "editortabsright":
                side = OpenTab.TAB_SIDE.Right;
                Tab  = editortabsright;
                break;
            }

            if (e.Button == MouseButtons.Right)
            {
                for (int ix = 0; ix < Tab.TabCount; ++ix)
                {
                    if (Tab.GetTabRect(ix).Contains(e.Location))
                    {
                        RightClickedTab = new OpenTab(side, ix);
                        toolstabrightclick.Show(Cursor.Position);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void AddSourceEditor(RemoteSource SourceInfo, Language Language = Language.None)
        {
            string pageName = "";

            switch (SourceInfo.GetFS())
            {
            case FileSystem.QSYS:
                pageName = SourceInfo.GetLibrary() + "/" + SourceInfo.GetObject() + "(" + SourceInfo.GetName() + ")";
                break;

            case FileSystem.IFS:
                pageName = SourceInfo.GetName() + "." + SourceInfo.GetExtension();
                break;
            }

            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(SourceInfo.GetLocalFile()))
            {
                //Close tab if it already exists.
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = pageName;
                SourceEditor srcEdit = new SourceEditor(SourceInfo.GetLocalFile(), Language, SourceInfo.GetRecordLength());
                srcEdit.SetReadOnly(!SourceInfo.IsEditable());
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = SourceInfo;

                tabPage.Tag = SourceInfo;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
            else
            {
                MessageBox.Show("There was an error opening the local member. '" + SourceInfo.GetLocalFile() + "' does not exist");
            }
        }
Ejemplo n.º 4
0
        public SourceEditor GetTabEditor(OpenTab Tab)
        {
            switch (Tab.getSide())
            {
            case OpenTab.TAB_SIDE.Left:
                return((SourceEditor)editortabsleft.TabPages[Tab.getIndex()].Controls[0]);

            case OpenTab.TAB_SIDE.Right:
                return((SourceEditor)editortabsright.TabPages[Tab.getIndex()].Controls[0]);
            }
            return(null);
        }
Ejemplo n.º 5
0
        private void AddMemberEditor(Member MemberInfo, ILELanguage Language = ILELanguage.None)
        {
            string  pageName   = MemberInfo.GetLibrary() + "/" + MemberInfo.GetObject() + "(" + MemberInfo.GetMember() + ")";
            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(MemberInfo.GetLocalFile()))
            {
                //Close tab if it already exists.
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = MemberInfo.GetLibrary() + "/" + MemberInfo.GetObject() + "(" + MemberInfo.GetMember() + ")";
                SourceEditor srcEdit = new SourceEditor(MemberInfo.GetLocalFile(), Language, MemberInfo.GetRecordLength());
                srcEdit.SetReadOnly(!MemberInfo.IsEditable());
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = MemberInfo;

                tabPage.Tag = MemberInfo;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
            else
            {
                MessageBox.Show("There was an error opening the local member. '" + MemberInfo.GetLocalFile() + "' does not exist");
            }
        }
Ejemplo n.º 6
0
        public OpenTab EditorContains(string Page)
        {
            OpenTab result = null;

            for (int i = 0; i < editortabsleft.TabPages.Count; i++)
            {
                if (editortabsleft.TabPages[i].Text.StartsWith(Page))
                {
                    result = new OpenTab(OpenTab.TAB_SIDE.Left, i);
                }
            }

            for (int i = 0; i < editortabsright.TabPages.Count; i++)
            {
                if (editortabsleft.TabPages[i].Text.StartsWith(Page))
                {
                    result = new OpenTab(OpenTab.TAB_SIDE.Left, i);
                }
            }

            return(result);
        }
Ejemplo n.º 7
0
        private void AddFileEditor(string FilePath, Language Language)
        {
            string  pageName   = Path.GetFileName(FilePath);
            OpenTab currentTab = EditorContains(pageName);

            if (File.Exists(FilePath))
            {
                if (currentTab != null)
                {
                    switch (currentTab.getSide())
                    {
                    case OpenTab.TAB_SIDE.Left:
                        editortabsleft.TabPages.RemoveAt(currentTab.getIndex());
                        break;

                    case OpenTab.TAB_SIDE.Right:
                        editortabsright.TabPages.RemoveAt(currentTab.getIndex());
                        break;
                    }
                }

                TabPage tabPage = new TabPage(pageName);
                tabPage.ImageIndex  = 0;
                tabPage.ToolTipText = pageName;
                SourceEditor srcEdit = new SourceEditor(FilePath, Language);
                srcEdit.BringToFront();
                srcEdit.Dock = DockStyle.Fill;
                srcEdit.Tag  = null;

                tabPage.Tag = null;
                tabPage.Controls.Add(srcEdit);
                editortabsleft.TabPages.Add(tabPage);

                SwitchToTab(OpenTab.TAB_SIDE.Left, editortabsleft.TabPages.Count - 1);
            }
        }