Exemple #1
0
        /// <summary>
        /// Retrieves the width and height of a selection border grab handle.
        /// Designers may need this to properly position their user interfaces.
        /// </summary>
        public static Size GetAdornmentDimensions(AdornmentType adornmentType)
        {
            switch (adornmentType)
            {
            case AdornmentType.GrabHandle:
                return(new Size(HANDLESIZE, HANDLESIZE));

            case AdornmentType.ContainerSelector:
            case AdornmentType.Maximum:
                return(new Size(CONTAINERGRABHANDLESIZE, CONTAINERGRABHANDLESIZE));
            }
            return(new Size(0, 0));
        }
Exemple #2
0
        internal void DrawAdornment(Graphics gr, int x, int y, int size, Color color, AdornmentType adornmentType, RescoBorderStyle borderStyle)
        {
            Point[] points = new Point[3];
            switch (borderStyle)
            {
            case RescoBorderStyle.None:
            case RescoBorderStyle.All:
                break;

            case RescoBorderStyle.Right:
                x--;
                break;

            default:
                x++;
                break;
            }
            switch (adornmentType)
            {
            case AdornmentType.RightArrow:
                x        -= size / 2;
                points[0] = new Point(x, y + size);
                points[1] = new Point(x + size, y);
                points[2] = new Point(x, y - size);
                gr.FillPolygon(this.GetBrush(color), points);
                return;

            case AdornmentType.UpArrow:
                y        += size / 2;
                points[0] = new Point((x + size) + 1, y);
                points[1] = new Point(x, (y - size) - 1);
                points[2] = new Point(x - size, y);
                gr.FillPolygon(this.GetBrush(color), points);
                return;

            case AdornmentType.LeftArrow:
                x        += size / 2;
                points[0] = new Point(x, y - size);
                points[1] = new Point(x - size, y);
                points[2] = new Point(x, y + size);
                gr.FillPolygon(this.GetBrush(color), points);
                return;

            case AdornmentType.DownArrow:
                y        -= size / 2;
                points[0] = new Point((x - size) + 1, y);
                points[1] = new Point(x, y + size);
                points[2] = new Point(x + size, y);
                gr.FillPolygon(this.GetBrush(color), points);
                return;

            case AdornmentType.Plus:
            case AdornmentType.Minus:
            {
                int height = size / 4;
                size += (size - height) % 2;
                int num2 = x - (size / 2);
                int num3 = y - (size / 2);
                gr.FillRectangle(this.GetBrush(color), num2, y - (height / 2), size, height);
                if (adornmentType == AdornmentType.Plus)
                {
                    gr.FillRectangle(this.GetBrush(color), x - (height / 2), num3, height, size);
                }
                break;
            }

            case AdornmentType.Text:
            case AdornmentType.None:
                break;

            default:
                return;
            }
        }
        Size ISelectionUIService.GetAdornmentDimensions(AdornmentType adornmentType)
        {
            switch (adornmentType)
            {
                case AdornmentType.GrabHandle:
                    return new Size(7, 7);

                case AdornmentType.ContainerSelector:
                case AdornmentType.Maximum:
                    return new Size(13, 13);
            }
            return new Size(0, 0);
        }
        public static Size GetAdornmentDimensions(AdornmentType adornmentType)
        {
            switch (adornmentType)
            {
                case AdornmentType.GrabHandle:
                    return new Size(HANDLESIZE, HANDLESIZE);

                case AdornmentType.ContainerSelector:
                case AdornmentType.Maximum:
                    return new Size(CONTAINERGRABHANDLESIZE, CONTAINERGRABHANDLESIZE);
            }
            return new Size(0, 0);
        }
Exemple #5
0
        internal void DrawAdornment(Graphics gr, int x, int y, int size, Color color, AdornmentType adornmentType, RescoBorderStyle borderStyle)
        {
            Point[] points = new Point[3];
            switch (borderStyle)
            {
                case RescoBorderStyle.None:
                case RescoBorderStyle.All:
                    break;

                case RescoBorderStyle.Right:
                    x--;
                    break;

                default:
                    x++;
                    break;
            }
            switch (adornmentType)
            {
                case AdornmentType.RightArrow:
                    x -= size / 2;
                    points[0] = new Point(x, y + size);
                    points[1] = new Point(x + size, y);
                    points[2] = new Point(x, y - size);
                    gr.FillPolygon(this.GetBrush(color), points);
                    return;

                case AdornmentType.UpArrow:
                    y += size / 2;
                    points[0] = new Point((x + size) + 1, y);
                    points[1] = new Point(x, (y - size) - 1);
                    points[2] = new Point(x - size, y);
                    gr.FillPolygon(this.GetBrush(color), points);
                    return;

                case AdornmentType.LeftArrow:
                    x += size / 2;
                    points[0] = new Point(x, y - size);
                    points[1] = new Point(x - size, y);
                    points[2] = new Point(x, y + size);
                    gr.FillPolygon(this.GetBrush(color), points);
                    return;

                case AdornmentType.DownArrow:
                    y -= size / 2;
                    points[0] = new Point((x - size) + 1, y);
                    points[1] = new Point(x, y + size);
                    points[2] = new Point(x + size, y);
                    gr.FillPolygon(this.GetBrush(color), points);
                    return;

                case AdornmentType.Plus:
                case AdornmentType.Minus:
                {
                    int height = size / 4;
                    size += (size - height) % 2;
                    int num2 = x - (size / 2);
                    int num3 = y - (size / 2);
                    gr.FillRectangle(this.GetBrush(color), num2, y - (height / 2), size, height);
                    if (adornmentType == AdornmentType.Plus)
                    {
                        gr.FillRectangle(this.GetBrush(color), x - (height / 2), num3, height, size);
                    }
                    break;
                }
                case AdornmentType.Text:
                case AdornmentType.None:
                    break;

                default:
                    return;
            }
        }