Exemplo n.º 1
0
        protected override void OnParentChanged(EventArgs e)
        {
            base.OnParentChanged(e);
            DSkinTabBar c = this.HostControl as DSkinTabBar;

            if (c != null && c.Items.IndexOf(this) > 0)
            {
                this.Margin = new Padding(-13, 0, 0, 0);
            }
            else
            {
                this.Margin = new Padding();
            }
        }
Exemplo n.º 2
0
 private void LastPannelShow()
 {
     try
     {
         DSkinTabBar c = this.HostControl as DSkinTabBar;
         if (c != null)
         {
             var currentIndex = c.Items.IndexOf(this);
             var lastIndex    = currentIndex - 1;
             if (lastIndex < 0)
             {
                 return;
             }
             for (int i = 0; i < c.Items.Count; i++)
             {
                 var item = c.Items[i] as TabrisTabItem;
                 if (item == null)
                 {
                     continue;
                 }
                 if (item.Tag == null)
                 {
                     continue;
                 }
                 var container = item.Tag as TabrisControlContainer;
                 if (container == null)
                 {
                     continue;
                 }
                 if (i == lastIndex)
                 {
                     container.ButtonPannel.Show();
                     container.LogPannel.Show();
                 }
                 else
                 {
                     container.ButtonPannel.Hide();
                     container.LogPannel.Hide();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemplo n.º 3
0
        void closeBtn_MouseClick(object sender, DuiMouseEventArgs e)
        {
            DSkinTabBar c = this.HostControl as DSkinTabBar;

            if (c != null)
            {
                var currentIndex = c.Items.IndexOf(this);
                if (currentIndex == 0)
                {
                    return;
                }

                if (c.TabControl != null)
                {
                    TabPage p;
                    if (this.TabPage == null)
                    {
                        p = c.TabControl.TabPages[c.Items.IndexOf(this)];
                    }
                    else
                    {
                        p = this.TabPage;
                    }
                    if (p != null)
                    {
                        c.TabControl.TabPages.Remove(p);
                        p.Dispose();
                    }
                }
                this.Visible = false;
                int            index     = currentIndex + 1;
                DuiBaseControl d         = c.Items[index];
                var            lastIndex = currentIndex - 1;
                if (lastIndex > 0)
                {
                    var item = c.Items[lastIndex] as TabrisTabItem;
                    if (item != null)
                    {
                        c.SetSelect(item);
                    }
                }

                LastPannelShow();
                int left = d.Left;
                d.DoEffect(left, left - this.Width + 13, 150, "Left", (p) =>
                {
                    if (!p)
                    {
                        c.Items.Remove(this);
                        if (c.Items.Count > 1)
                        {
                            c.Items[0].Margin = new Padding();
                        }
                    }
                });
            }

            var container = this.Tag as TabrisControlContainer;

            if (container != null)
            {
                container.ButtonPannel?.Hide();
                container.LogPannel?.Hide();
                container?.Dispose();
            }

            var container2 = this.Tag as ViewControlContainer;

            if (container2 != null)
            {
                container2.OnClosing();
                container2.ButtonPannel?.Hide();
                container2.LogPannel?.Hide();
                container2?.Dispose();
            }
            this.Dispose();
        }