Esempio n. 1
0
        public void AddTab(string url)
        {
            if (this.toAdd == null)
                return;

            Tab tb = new Tab(url, this);

            if (toAdd != null)
            {
                toAdd.Controls.Clear();
                int index = this.tabLst.IndexOf(this.currentTab);
                if (index != -1)
                    this.tabLst.Insert(index + 1, tb);
                else
                    this.tabLst.Add(tb);
                toAdd.Controls.Add(tb);
                tb.Dock = DockStyle.Fill;
                tb.currentRectangle = new Rectangle(new Point(left, 1), new Size(100, this.Height - 3));
                tb.TitleChanged += tb_TitleChanged;
                if (this.TabChanged != null)
                    this.TabChanged(tb);
                left += 100 + distance;

                //int index = this.tabLst.IndexOf(this.currentTab);
                if (index > -1 && index <= this.tabLst.Count - 1 && index + 1 <= this.tabLst.Count - 1)
                {
                    this.tabLst[index + 1].Select(this.tabLst);
                    this.currentTab = this.tabLst[index + 1];
                }
                else
                {
                    tb.Select(this.tabLst);
                    this.currentTab = tb;
                }
                this.Invalidate();
            }
        }
Esempio n. 2
0
        public void DeleteTab(Tab tb)
        {
            if (this.tabLst.Count == 1)
                return;
            int currentIndex = this.TabList.IndexOf(tb);
            this.tabLst.Remove(tb);

            if (currentIndex > -1 && currentIndex <= this.tabLst.Count - 1)
                this.tabLst[currentIndex].Select(this.tabLst);
            else
                if (this.tabLst.Count != 0)
                this.tabLst[this.tabLst.Count - 1].Select(this.tabLst);

            Tab current = this.currentTab;
            this.toAdd.Controls.Clear();
            this.toAdd.Controls.Add(current);
            current.Select(tabLst);
            if (TabChanged != null)
                TabChanged(current);
        }
Esempio n. 3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            //Tab current = Tab.getTab(e.Location, tabLst);
            List<Tab> getSideTabs = Tab.getTabsNumbers(tabLst, this.CurrentSite);
            List<Rectangle> rect = new List<Rectangle>();

            for (int i = 0; i <= getSideTabs.Count - 1; i++)
            {
                // m(x) = (a1 + a2) * x
                // ma(x) = m(x) + 100
                rect.Add(new Rectangle(110 * i, 1, 100, this.Height - 3));
            }
            for (int i = 0; i <= rect.Count - 1; i++)
            {
                if (rect[i].Contains(e.Location))
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left)
                    {
                        Tab current = getSideTabs[i];
                        this.toAdd.Controls.Clear();
                        this.toAdd.Controls.Add(current);
                        current.Select(tabLst);
                        this.currentTab = current;
                        if (TabChanged != null)
                            TabChanged(current);
                    }
                }
            }
        }
Esempio n. 4
0
        public Grade(Tab.Tab currentTab)
        {
            InitializeComponent();
            base.Size = new Size(620, 383);
            this.currentTab = currentTab;
            this.lstSchoolYear.SelectedIndex = 0;
            this.lstSchoolYear.SelectedIndexChanged += LstSchoolYear_SelectedIndexChanged;
            this.chkAbi.CheckedChanged += ChkAbi_CheckedChanged;

            lstOfHalfYears.Add(new HalfYear());
            lstOfHalfYears.Add(new HalfYear());
            lstOfHalfYears.Add(new HalfYear());
            lstOfHalfYears.Add(new HalfYear());

            this.refreshList();
        }