public CloseButtonTBCItem(ITabButtonContainerItem pTabButtonContainerItem)
        {
            base.Name = "GISShare.Controls.WinForm.WFNew.CloseButtonTBCItem";
            base.Text = "关闭表按钮";
            base.UsingViewOverflow = false;

            this.m_Owner = pTabButtonContainerItem;
            ((ISetOwnerHelper)this).SetOwner(m_Owner as IOwner);
        }
 public NextButtonTBCItem(ITabButtonContainerItem pTabButtonContainerItem)
     : base(LTBRButtonStyle.eBottomButton)
 {
     READONLY_TimerInterval = (int)(1.5 * System.Windows.Forms.SystemInformation.DoubleClickTime);
     //
     base.Name = "GISShare.Controls.WinForm.WFNew.NextButtonTBCItem";
     base.Text = "下一个表按钮";
     //
     this.owner = pTabButtonContainerItem;
     ((ISetOwnerHelper)this).SetOwner(owner as IOwner);
     //
     this.m_Timer          = new System.Windows.Forms.Timer();
     this.m_Timer.Interval = READONLY_TimerInterval;
     this.m_Timer.Tick    += new EventHandler(Timer_Tick);
 }
Exemple #3
0
        public override bool RemoveSelf()
        {
            ITabButtonContainerItem pTabButtonContainerItem = this.pOwner as ITabButtonContainerItem;

            if (pTabButtonContainerItem == null)
            {
                return(base.RemoveSelf());
            }
            ITabControl pTabControl = pTabButtonContainerItem.TryGetTabControl();

            if (pTabControl == null)
            {
                return(base.RemoveSelf());
            }
            pTabControl.RemoveTabPage(this.pTabPageItem);
            return(true);
        }
Exemple #4
0
        /// <summary>
        /// 选中该项
        /// </summary>
        public void Selected()
        {
            //ICollectionItem pCollectionItem = this.pOwner as ICollectionItem;
            //if (pCollectionItem == null) return;
            //foreach (ITabButtonItem one in pCollectionItem.BaseItems)
            //{
            //    if (one == null || !one.Visible) continue;
            //    //
            //    if (one == this) { ((ISetTabButtonItemHelper)one).SetIsSelected(true); }
            //    else { ((ISetTabButtonItemHelper)one).SetIsSelected(false); }
            //}
            ITabButtonContainerItem pTabButtonContainerItem = this.pOwner as ITabButtonContainerItem;

            if (pTabButtonContainerItem != null)
            {
                pTabButtonContainerItem.TabButtonItemSelectedIndex = this.TryGetIndex();
            }
        }
        private bool SelectCompnentMouseUp_DG(IUICollectionItem pUICollectionItem, Point point)
        {
            if (pUICollectionItem == null)
            {
                return(false);
            }
            if (!((IBaseItem)pUICollectionItem).Visible)
            {
                return(false);
            }
            //
            bool bIsCanvasItem             = pUICollectionItem is ICanvasItem;
            bool bIsTabButtonContainerItem = pUICollectionItem is ITabButtonContainerItem;

            //
            foreach (BaseItem one in pUICollectionItem.BaseItems)
            {
                if (this.SelectCompnentMouseUp_DG(one as IUICollectionItem, point))
                {
                    return(true);
                }
                //
                if (!bIsCanvasItem)
                {
                    if (one.DesignMouseClickRectangleContainsEx(point))
                    {
                        ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
                        if (pSelectionService != null)
                        {
                            if (bIsTabButtonContainerItem && one is TabButtonItem)
                            {
                                TabButtonItem tabButtonItem = (TabButtonItem)one;
                                this.m_Item2 = tabButtonItem;
                                ITabButtonContainerItem pTabButtonContainerItem = (ITabButtonContainerItem)pUICollectionItem;
                                if (pTabButtonContainerItem.BaseItems.ExchangeItemT(this.m_Item1, this.m_Item2))
                                {
                                    RibbonPageTabButtonItem tabButton = this.m_Item1 as RibbonPageTabButtonItem;
                                    if (tabButton != null)
                                    {
                                        BaseItem tabPageItem = tabButtonItem.pTabPageItem as BaseItem;
                                        if (tabPageItem != null)
                                        {
                                            if (this.SetSelectedComponents(pSelectionService, tabPageItem))
                                            {
                                                this.m_Control.Refresh();
                                            }
                                        }
                                    }
                                    return(true);
                                }
                                else
                                {
                                    RibbonPageItem ribbonPage = tabButtonItem.pTabPageItem as RibbonPageItem;
                                    if (ribbonPage != null)
                                    {
                                        if (this.SetSelectedComponents(pSelectionService, ribbonPage))
                                        {
                                            this.m_Control.Refresh();
                                        }
                                    }
                                    return(true);
                                }
                            }
                            else
                            {
                                this.m_Item2 = one;
                                if (pUICollectionItem.BaseItems.ExchangeItem(this.m_Item1, this.m_Item2))
                                {
                                    if (this.SetSelectedComponents(pSelectionService, this.m_Item1))
                                    {
                                        this.m_Control.Refresh();
                                    }
                                    return(true);
                                }
                                else
                                {
                                    this.m_Control.Refresh();
                                    if (this.SetSelectedComponents(pSelectionService, one))
                                    {
                                        this.m_Control.Refresh();
                                    }
                                    return(true);
                                }
                            }
                        }
                    }
                }
            }
            //
            if (bIsCanvasItem)
            {
                if (this.m_Item1 != null)
                {
                    if (this.m_MouseDownPoint != Point.Empty)
                    {
                        ISetBaseItemHelper pSetBaseItemHelper = this.m_Item1 as ISetBaseItemHelper;
                        if (pSetBaseItemHelper != null)
                        {
                            int iX = point.X - this.m_MouseDownPoint.X;
                            int iY = point.Y - this.m_MouseDownPoint.Y;
                            pSetBaseItemHelper.SetLocation(this.m_Item1.Location.X + iX, this.m_Item1.Location.Y + iY);
                            this.Translation_DG(this.m_Item1 as CanvasItem, iX, iY);
                            this.m_MouseDownPoint = Point.Empty;
                            this.m_Control.Refresh();
                        }
                    }
                    //
                    ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
                    if (pSelectionService != null)
                    {
                        this.SetSelectedComponents(pSelectionService, this.m_Item1);
                    }
                    //
                    this.m_Item1 = null;
                    //
                    return(true);
                }
            }
            //
            return(false);
        }
        private bool SelectCompnentMouseDown_DG(IUICollectionItem pUICollectionItem, Point point)
        {
            if (pUICollectionItem == null)
            {
                return(false);
            }
            if (!((IBaseItem)pUICollectionItem).Visible)
            {
                return(false);
            }
            //
            bool bIsTabButtonContainerItem = pUICollectionItem is ITabButtonContainerItem;

            //
            foreach (BaseItem one in pUICollectionItem.BaseItems)
            {
                if (bIsTabButtonContainerItem && one is TabButtonItem)
                {
                    TabButtonItem tabButtonItem = (TabButtonItem)one;
                    if (tabButtonItem.DesignMouseClickRectangleContainsEx(point))
                    {
                        ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
                        if (pSelectionService != null)
                        {
                            this.m_Item1 = tabButtonItem;
                            BaseItem tabPageItem = tabButtonItem.pTabPageItem as BaseItem;
                            if (tabPageItem != null)
                            {
                                if (this.SetSelectedComponents(pSelectionService, tabPageItem))
                                {
                                    this.m_Control.Refresh();
                                }
                            }
                            ITabButtonContainerItem pTabButtonContainerItem = (ITabButtonContainerItem)pUICollectionItem;
                            pTabButtonContainerItem.TabButtonItemSelectedIndex = pTabButtonContainerItem.BaseItems.IndexOf(tabButtonItem);
                            //
                            return(true);
                        }
                    }
                }
                else
                {
                    if (this.SelectCompnentMouseDown_DG(one as IUICollectionItem, point))
                    {
                        return(true);
                    }
                    //
                    if (one.DesignMouseClickRectangleContainsEx(point))
                    {
                        ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
                        if (pSelectionService != null)
                        {
                            this.m_Item1          = one;
                            this.m_MouseDownPoint = point;
                            if (this.SetSelectedComponents(pSelectionService, one))
                            {
                                this.m_Control.Refresh();
                            }
                            return(true);
                        }
                    }
                }
            }
            //
            if (pUICollectionItem is IBaseItemStackExItem)
            {
                IBaseItemStackExItem pBaseItemStackExItem = (IBaseItemStackExItem)pUICollectionItem;
                if (pBaseItemStackExItem.PreButtonVisible &&
                    pBaseItemStackExItem.PreButtonRectangle.Contains(point))
                {
                    if (pBaseItemStackExItem.PreButtonIncreaseIndex)
                    {
                        pBaseItemStackExItem.TopViewItemIndex++;
                    }
                    else
                    {
                        pBaseItemStackExItem.TopViewItemIndex--;
                    }
                }
                if (pBaseItemStackExItem.NextButtonVisible &&
                    pBaseItemStackExItem.NextButtonRectangle.Contains(point))
                {
                    if (pBaseItemStackExItem.PreButtonIncreaseIndex)
                    {
                        pBaseItemStackExItem.TopViewItemIndex--;
                    }
                    else
                    {
                        pBaseItemStackExItem.TopViewItemIndex++;
                    }
                }
            }
            else if (pUICollectionItem is IGalleryItem)
            {
                IGalleryItem pGalleryItem = (IGalleryItem)pUICollectionItem;
                if (pGalleryItem.ScrollUpButtonRectangle.Contains(point))
                {
                    pGalleryItem.TopViewItemIndex++;
                }
                if (pGalleryItem.ScrollDownButtonRectangle.Contains(point))
                {
                    pGalleryItem.TopViewItemIndex--;
                }
            }
            //
            return(false);
        }