Пример #1
0
        private void ClickDots(int left, int width)
        {
            Resco.Controls.DetailView.DetailView parent = base.Parent;
            Rectangle      rectangle        = parent.CalculateClientRect();
            PageCollection pages            = parent.Pages;
            int            height           = this.Height;
            bool           pagesRightToLeft = this.PagesRightToLeft;
            int            pageCount        = parent.PageCount;
            int            num3             = 0;

            foreach (Page page in pages)
            {
                if (page.PagingItem.Visible)
                {
                    num3++;
                }
            }
            int num4 = height / 4;
            int num5 = (rectangle.X + ((width - (num3 * height)) / 2)) + num4;

            for (int i = 0; i < pageCount; i++)
            {
                int num6 = pagesRightToLeft ? ((pageCount - i) - 1) : i;
                if (pages[num6].PagingItem.Visible)
                {
                    if ((left > num5) && (left < (num5 + height)))
                    {
                        parent.CurrentPageIndex = num6;
                        return;
                    }
                    num5 += height;
                }
            }
        }
Пример #2
0
        private bool CheckStartDrawPage(int index, int dir)
        {
            PageCollection pages     = base.Parent.Pages;
            int            pageCount = base.Parent.PageCount;

            do
            {
                index += dir;
            }while (((index < pageCount) && (index >= 0)) && !pages[index].PagingItem.Visible);
            return((index >= 0) && (index != pageCount));
        }
Пример #3
0
        private void UpdateStartDrawPage(int index, int dir)
        {
            PageCollection pages     = base.Parent.Pages;
            int            pageCount = base.Parent.PageCount;

            base.Parent.m_StartDrawPage = index;
            do
            {
                Resco.Controls.DetailView.DetailView parent = base.Parent;
                parent.m_StartDrawPage += dir;
                index += dir;
            }while (((index < pageCount) && (index > 0)) && !pages[index].PagingItem.Visible);
        }
Пример #4
0
        private void DrawDots(Graphics gr, int left, int top, int width, int height)
        {
            Resco.Controls.DetailView.DetailView parent = base.Parent;
            PageCollection pages            = parent.Pages;
            bool           pagesRightToLeft = this.PagesRightToLeft;
            int            currentPageIndex = parent.CurrentPageIndex;
            int            pageCount        = parent.PageCount;
            int            num2             = 0;

            foreach (Page page in pages)
            {
                if (page.PagingItem.Visible)
                {
                    num2++;
                }
            }
            int num3 = height / 2;
            int num4 = height / 4;
            int x    = (left + ((width - (num2 * height)) / 2)) + num4;
            int y    = top + num4;

            for (int i = 0; i < pageCount; i++)
            {
                int num7 = pagesRightToLeft ? ((pageCount - i) - 1) : i;
                if (pages[num7].PagingItem.Visible)
                {
                    if (parent.CurrentPageIndex == num7)
                    {
                        gr.FillEllipse(base.GetTextForeBrush(), x, y, num3, num3);
                    }
                    else
                    {
                        gr.FillEllipse((base.TextBackColor == Color.Transparent) ? this.m_GrayBrush : base.m_TextBackBrush, x, y, num3, num3);
                    }
                    x += height;
                }
            }
        }
Пример #5
0
        private void OnItemsChanged(object sender, DetailViewEventArgsType e, object oParam)
        {
            switch (e)
            {
                case DetailViewEventArgsType.ItemAdd:
                    this.m_pages = null;
                    if (sender is ItemPageBreak)
                    {
                        this.m_iPages++;
                        break;
                    }
                    ((Item) sender).Clicked += new ItemEventHandler(this.OnItemClick);
                    ((Item) sender).LabelClicked += new ItemEventHandler(this.OnItemLabelClick);
                    ((Item) sender).Changed += new ItemEventHandler(this.OnItemChanged);
                    ((Item) sender).GotFocus += new ItemEventHandler(this.OnItemGotFocus);
                    ((Item) sender).LostFocus += new ItemEventHandler(this.OnItemLostFocus);
                    ((Item) sender).Validating += new ItemValidatingEventHandler(this.OnItemValidating);
                    if (this.m_iSuspendRedraw <= 0)
                    {
                        this.m_iActualMaximumValue = this.m_ItemCollection.CalculateItemsHeight();
                        this.SetVScrollBar(this.m_iActualMaximumValue);
                    }
                    break;

                case DetailViewEventArgsType.ItemRemove:
                    this.m_pages = null;
                    if (sender is ItemPageBreak)
                    {
                        this.m_iPages--;
                        break;
                    }
                    ((Item) sender).Clicked -= new ItemEventHandler(this.OnItemClick);
                    ((Item) sender).LabelClicked -= new ItemEventHandler(this.OnItemLabelClick);
                    ((Item) sender).Changed -= new ItemEventHandler(this.OnItemChanged);
                    ((Item) sender).GotFocus -= new ItemEventHandler(this.OnItemGotFocus);
                    ((Item) sender).LostFocus -= new ItemEventHandler(this.OnItemLostFocus);
                    ((Item) sender).Validating -= new ItemValidatingEventHandler(this.OnItemValidating);
                    if (this.m_iSuspendRedraw <= 0)
                    {
                        this.m_iActualMaximumValue = this.m_ItemCollection.CalculateItemsHeight();
                        this.SetVScrollBar(this.m_iActualMaximumValue);
                    }
                    break;
            }
            if (this.m_iSuspendRedraw <= 0)
            {
                base.Invalidate();
            }
        }
Пример #6
0
 protected override void Dispose(bool disposing)
 {
     this.SuspendRedraw();
     if (this.m_TouchScrollingTimer != null)
     {
         this.m_TouchScrollingTimer.Dispose();
     }
     this.m_TouchScrollingTimer = null;
     BackBufferManager.Release();
     this.m_gradientBackColor = null;
     this.m_pages = null;
     if (this.m_ItemCollection != null)
     {
         this.m_ItemCollection.Clear();
     }
     this.m_ItemCollection = null;
     if (this.m_itemList != null)
     {
         this.m_itemList.Clear();
     }
     this.m_itemList = null;
     if (disposing)
     {
         foreach (Control control in this.m_Controls.Values)
         {
             control.Dispose();
         }
         this.m_Controls.Clear();
         if (this.m_vScroll != null)
         {
             this.m_vScroll.Detach();
         }
         this.m_vScroll = null;
     }
     if (m_sPen != null)
     {
         m_sPen.Dispose();
     }
     m_sPen = null;
     if (m_sPixel != null)
     {
         m_sPixel.Dispose();
     }
     m_sPixel = null;
     if (disposing && (this.components != null))
     {
         this.components.Dispose();
     }
     base.Dispose(disposing);
 }
Пример #7
0
        private void DrawTabStrip(Graphics gr, int left, int top, int width, int height)
        {
            Resco.Controls.DetailView.DetailView parent = base.Parent;
            PageCollection pages            = parent.Pages;
            int            num              = (parent.PagesLocation == RescoPagesLocation.Top) ? height : 0;
            int            pageCount        = parent.PageCount;
            bool           pagesRightToLeft = this.PagesRightToLeft;
            int            num3             = left;

            if (parent.PagesLocation == RescoPagesLocation.Top)
            {
                top--;
            }
            left += pagesRightToLeft ? width : 0;
            int num4 = 0;

            for (int i = 0; i < pageCount; i++)
            {
                if (pages[i].PagingItem.Visible)
                {
                    string        text       = pages[i].Text;
                    ItemPageBreak pagingItem = pages[i].PagingItem;
                    SizeF         ef         = gr.MeasureString(text, pagingItem.TextFont);
                    pagingItem.m_TextWidth  = Convert.ToInt32(Math.Ceiling((double)ef.Width));
                    pagingItem.m_TextHeight = Convert.ToInt32(Math.Ceiling((double)ef.Height));
                    num4 += pagingItem.m_TextWidth + 10;
                    parent.m_PagesOverWidth = (parent.m_StartDrawPage != 0) || (num4 >= width);
                    if (i >= parent.m_StartDrawPage)
                    {
                        int x = left - (pagesRightToLeft ? (pagingItem.m_TextWidth + 10) : 0);
                        if (parent.CurrentPageIndex == i)
                        {
                            if ((base.TextBackColor != Color.Transparent) || !base.Parent.UseGradient)
                            {
                                gr.FillRectangle(base.m_TextBackBrush, x, top, pagingItem.m_TextWidth + 10, height);
                            }
                        }
                        else
                        {
                            gr.FillRectangle(this.m_GrayBrush, x, top, pagingItem.m_TextWidth + 10, height);
                        }
                        if (parent.CurrentPageIndex != i)
                        {
                            gr.DrawLine(this.m_BlackPen, x, top + num, ((x + pagingItem.m_TextWidth) + 10) - 1, top + num);
                        }
                        gr.DrawLine(this.m_BlackPen, x + (pagesRightToLeft ? 0 : ((pagingItem.m_TextWidth + 10) - 1)), top, x + (pagesRightToLeft ? 0 : ((pagingItem.m_TextWidth + 10) - 1)), top + height);
                        gr.DrawString(text, pagingItem.TextFont, pagingItem.GetTextForeBrush(), new Rectangle(x + 5, top + ((height - pagingItem.m_TextHeight) / 2), pagingItem.m_TextWidth, pagingItem.m_TextHeight));
                        if (pagesRightToLeft)
                        {
                            left -= pagingItem.m_TextWidth + 10;
                            if (left < 0)
                            {
                                break;
                            }
                        }
                        else
                        {
                            left += pagingItem.m_TextWidth + 10;
                            if (left > width)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            if (pagesRightToLeft)
            {
                if (left > 0)
                {
                    gr.DrawLine(this.m_BlackPen, num3, top + num, left, top + num);
                }
            }
            else if (left < width)
            {
                gr.DrawLine(this.m_BlackPen, left, top + num, num3 + width, top + num);
            }
            if (parent.m_PagesOverWidth)
            {
                bool  isLeftRight = this.ArrowStyle == RescoArrowStyle.LeftRight;
                Image image       = Resco.Controls.DetailView.DetailView.GetArrow(true, isLeftRight, parent.m_RightArrowClicked, true);
                Image image2      = Resco.Controls.DetailView.DetailView.GetArrow(false, isLeftRight, parent.m_LeftArrowClicked, true);
                if (isLeftRight)
                {
                    Rectangle destRect = new Rectangle(num3 + (pagesRightToLeft ? 0 : (width - (Resco.Controls.DetailView.DetailView.TabImageSize.Width * 2))), top, Resco.Controls.DetailView.DetailView.TabImageSize.Width, Resco.Controls.DetailView.DetailView.TabImageSize.Height);
                    Rectangle srcRect  = new Rectangle(0, 0, image2.Width, image2.Height);
                    gr.DrawImage(image2, destRect, srcRect, GraphicsUnit.Pixel);
                    destRect.X = num3 + (pagesRightToLeft ? Resco.Controls.DetailView.DetailView.TabImageSize.Width : (width - Resco.Controls.DetailView.DetailView.TabImageSize.Width));
                    srcRect    = new Rectangle(0, 0, image.Width, image.Height);
                    gr.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
                }
                else
                {
                    Rectangle rectangle3 = new Rectangle(num3 + (pagesRightToLeft ? 0 : (width - Resco.Controls.DetailView.DetailView.TabImageSize.Width)), top, Resco.Controls.DetailView.DetailView.TabImageSize.Width, Resco.Controls.DetailView.DetailView.TabImageSize.Height);
                    Rectangle rectangle4 = new Rectangle(0, 0, image2.Width, image2.Height);
                    gr.DrawImage(image2, rectangle3, rectangle4, GraphicsUnit.Pixel);
                    rectangle3.Y = top + Resco.Controls.DetailView.DetailView.TabImageSize.Height;
                    rectangle4   = new Rectangle(0, 0, image.Width, image.Height);
                    gr.DrawImage(image, rectangle3, rectangle4, GraphicsUnit.Pixel);
                }
            }
        }