Exemplo n.º 1
0
        private void DrawHeaderShade(Device device)
        {
            if (this.headerBuffer == null)
            {
                this.headerBuffer = CustomPainters.CreateColoredBuffer(device);
            }
            Rectangle rect = new Rectangle(PointToScreen(Point.Empty), new Size(this.Width, 50));

            CustomPainters.PaintColoredRectangle(device, rect, this.headerBuffer, Color.DarkGoldenrod, Color.LightGoldenrodYellow, GradientDirection.Horizontal);
        }
Exemplo n.º 2
0
        private void DrawHighlight(Device device)
        {
            if (this.highlightBuffer == null)
            {
                this.highlightBuffer = CustomPainters.CreateColoredBuffer(device);
            }
            Point     origin = PointToScreen(Point.Empty);
            Rectangle rect   = new Rectangle(origin.X + 2, origin.Y + 2, this.Width - 4, this.Height - 4);

            CustomPainters.PaintColoredRectangle(device, rect, this.highlightBuffer, this.parentMenu.HighlightColor);
        }
Exemplo n.º 3
0
        private void ShadeBox(Device device)
        {
            if (this.shadeBuffer == null)
            {
                this.shadeBuffer = CustomPainters.CreateColoredBuffer(device);
            }
            Point     start = PointToScreen(Point.Empty);
            Rectangle rect  = new Rectangle(start.X, start.Y, 14, 14);

            CustomPainters.PaintColoredRectangle(device, rect, this.shadeBuffer, Color.Gray, Color.White, GradientDirection.Vertical);
        }
Exemplo n.º 4
0
        private void DrawBackGround(IDirectXControlHost controlHost)
        {
            if (this.backgroundBuffer == null)
            {
                this.backgroundBuffer = CustomPainters.CreateColoredBuffer(controlHost.Device);
            }
            Point     pt   = PointToScreen(Point.Empty);
            Rectangle rect = new Rectangle(pt.X, pt.Y + 25, this.Width, this.Height - 25);

            CustomPainters.PaintColoredRectangle(controlHost.Device, rect, this.backgroundBuffer, this.BackColor, this.BackColor2, GradientDirection.Vertical);
            CustomPainters.DrawBoundingRectangle(controlHost, new Rectangle(pt, this.Size), Color.White);
        }
Exemplo n.º 5
0
        private void DrawHeader(Device device)
        {
            if (this.headerBuffer == null)
            {
                this.headerBuffer = CustomPainters.CreateColoredBuffer(device);
            }

            Point     pt   = PointToScreen(Point.Empty);
            Rectangle rect = new Rectangle(PointToScreen(Point.Empty), new Size(this.Width, 25));

            CustomPainters.PaintColoredRectangle(device, rect, this.headerBuffer, this.headerColor1, this.headerColor2, GradientDirection.Horizontal);
            pt.Offset(3, 3);
            this.D3DFont.DrawString(null, this.Text, pt, Color.White);
        }
Exemplo n.º 6
0
        private void UpdateVertexBuffer(Device device)
        {
            if (this.vertexBuffer == null)
            {
                this.vertexBuffer = CustomPainters.CreateColoredBuffer(device);
            }
            Point     origin = PointToScreen(Point.Empty);
            float     pct    = ((float)this.percentComplete) / 100f;
            float     x      = pct * (float)this.Width;
            float     y      = this.Height;
            Rectangle rect   = new Rectangle(origin, new Size((int)x, (int)y));

            CustomPainters.PaintColoredRectangle(device, rect, this.vertexBuffer, this.ForeColor, Color.DarkSlateBlue, GradientDirection.Vertical);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Draws the highlight over the currently selected item in the <see cref="DXListControl"/>.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void DrawHighlight(Rectangle bounds)
        {
            //create the vertex buffer for the highlight if necessary
            if (this.highlightBuffer == null)
            {
                this.highlightBuffer = CustomPainters.CreateColoredBuffer(this.ControlHost.Device);
            }

            //render the rectangle
            CustomPainters.PaintColoredRectangle(
                this.ControlHost.Device,
                bounds,
                this.highlightBuffer,
                this.highlightColor,
                this.highlightColor2,
                GradientDirection.Vertical
                );
        }
Exemplo n.º 8
0
        private void DrawDropDown(IDirectXControlHost controlHost)
        {
            //draw the box
            Point     origin         = PointToScreen(Point.Empty);
            int       x              = origin.X;
            int       y              = origin.Y;
            int       bottom         = origin.Y + this.collapsedHeight;
            int       dropDownHeight = CalcDropDownHeight();
            Rectangle rect           = new Rectangle(x, bottom, this.Width, dropDownHeight);

            if (this.dropDownBuffer == null)
            {
                this.dropDownBuffer = CustomPainters.CreateColoredBuffer(controlHost.Device);
            }
            CustomPainters.PaintColoredRectangle(controlHost.Device, rect, dropDownBuffer, this.BackColor);
            CustomPainters.DrawBoundingRectangle(controlHost, rect, Color.DimGray);
            DrawItems(rect, this.hotItem);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Refreshes the control.
 /// </summary>
 public virtual void Render(RenderEventArgs e)
 {
     this.screenBounds = new Rectangle(PointToScreen(Point.Empty), this.size);
     if (this.backgroundImage == null)
     {
         if (this.vertexBuffer == null)
         {
             this.vertexBuffer = CustomPainters.CreateColoredBuffer(e.ControlHost.Device);
         }
         CustomPainters.PaintColoredRectangle(e.ControlHost.Device, this.screenBounds, this.vertexBuffer, this.backColor, this.backColor2, GradientDirection.Vertical);
     }
     else
     {
         if (this.vertexBuffer == null)
         {
             this.vertexBuffer = CustomPainters.CreateTexturedBuffer(e.ControlHost.Device);
         }
         CustomPainters.PaintTexturedRectangle(e.ControlHost.Device, this.screenBounds, this.vertexBuffer, this.backgroundImage.Texture);
     }
 }
Exemplo n.º 10
0
        //Shades the button of the combobox.
        private void ShadeButton(Device device, Rectangle rectangle)
        {
            if (this.shadeBuffer == null)
            {
                this.shadeBuffer = CustomPainters.CreateColoredBuffer(device);
            }
            if (this.pressedShadeBuffer == null)
            {
                this.pressedShadeBuffer = CustomPainters.CreateColoredBuffer(device);
            }

            if (this.expanded)
            {
                CustomPainters.PaintColoredRectangle(device, rectangle, this.pressedShadeBuffer, this.darkShade, this.lightShade, GradientDirection.Vertical);
            }
            else
            {
                CustomPainters.PaintColoredRectangle(device, rectangle, this.shadeBuffer, this.lightShade, this.darkShade, GradientDirection.Vertical);
            }
        }