Пример #1
0
 public PreButtonItem(IBaseItemStackExItem pBaseItemContainer)
     : base(LTBRButtonStyle.eTopButton)
 {
     READONLY_TimerInterval = (int)(1.5 * System.Windows.Forms.SystemInformation.DoubleClickTime);
     //
     base.Name = "GISShare.Controls.WinForm.WFNew.PreButtonItem";
     base.Text = "前一个";
     //
     this.owner = pBaseItemContainer;
     ((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);
 }
        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);
        }